Author Topic: AdvancedHMI Controls and Subscriptions  (Read 5079 times)

kdcui

  • Newbie
  • *
  • Posts: 4
    • View Profile
AdvancedHMI Controls and Subscriptions
« on: October 28, 2013, 04:23:13 PM »
Hi all,

Did some searching and am still a bit confused on a few points.

I'm not exactly sure how to use the Subscription ability.  Is it global or on a per control / plc tag basis?

If I create a Basic Label or Indicator, is it automatically subscribed to, or do I need to enable a subscription?
If I don't use a subscription, do I need to manually program a Read in order for the control to update?

Right now the few programs I have made do not use the AdvancedHMI controls.  Instead I have been manually reading each tag asynchronously, using an event handler to tell what just updated, and moving the new data into a Winform control (button, textbox, label, etc...).

Thanks!

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: AdvancedHMI Controls and Subscriptions
« Reply #1 on: October 29, 2013, 02:08:02 PM »
Well, I have same questions. I hope Archie could beam some light about subscriptions, like where we can find more information about.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: AdvancedHMI Controls and Subscriptions
« Reply #2 on: October 29, 2013, 09:11:42 PM »
The controls, such as the BasicLabel, encapsulate all of the necessary code required to retrieve values from the PLC. By using these pre-built controls, there is no need to write your own code.

All of the controls do use subscriptions. A subscription is the most complicated method to acquire data, but the most efficient because the controls just sits idle waiting for updated values to be sent to them. Subscriptions are also optimized by the driver when possible. If multiple values can be read in a single packet, the driver takes care of this by grouping multiple subscriptions.

In order to simplify the use of subscriptions, the DataSubscriber was created. You simply add one for each value you want to subscribe to, then double click the DataSubscriber and it will take you to the DataChanged event handler.

kdcui

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AdvancedHMI Controls and Subscriptions
« Reply #3 on: October 31, 2013, 05:02:10 PM »
Thanks for the info Archie.

Just as a clarification:
You said the AdvancedHMI controls have all of the necessary code encapsulated for retrieving values.  Did you mean these use subscriptions as their means of retrieving data, or that they can use subscriptions if I choose to enable them with a DataSubscriber?

Thanks again.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: AdvancedHMI Controls and Subscriptions
« Reply #4 on: October 31, 2013, 06:16:41 PM »
You said the AdvancedHMI controls have all of the necessary code encapsulated for retrieving values.  Did you mean these use subscriptions as their means of retrieving data, or that they can use subscriptions if I choose to enable them with a DataSubscriber?
The controls create their own subscriptions. For instance, let's say you do the following:

1) Add a DF1Comm driver to the form
2) Add a DigitalPanelMeter to the form
3) In the PLCAddressValue property you put N7:0

Once you start the application, the DigitalPanelMeter will establish a subscription with the DF1Comm driver. The driver will then establish connection with the PLC and begin polling for the value of N7:0. Once the value is returned from the PLC, the driver will send it to the DigitalPanelMeter to be displayed.

All of this happens via code that is part of the driver and DigitalPanelMeter, so there is no need for a DataSubscriber or any code writing of your own.

kdcui

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AdvancedHMI Controls and Subscriptions
« Reply #5 on: November 01, 2013, 10:19:20 AM »
Great, thanks again.

I'll have to start playing with the controls more.