Difference between revisions of "DataSubscriber"

From AdvancedHMI
Jump to: navigation, search
(DataSubscriber)
(Walk Through)
Line 16: Line 16:
  
 
== Walk Through ==
 
== Walk Through ==
1) Add a driver to the form and set the corresponding properties
+
1) Add a driver to the form and set the corresponding properties<br>
2) Add a DataSubscriber to the form
+
2) Add a DataSubscriber to the form<br>
3) Enter a valid PLC address in the PLCAddressValue property
+
3) Enter a valid PLC address in the PLCAddressValue property<br>
4) Double click the DataSubscriber to get back to the DataChanged event handler
+
4) Double click the DataSubscriber to get back to the DataChanged event handler<br>
5) Enter this code:
+
5) Enter this code:<br>
 
<code>
 
<code>
 
Me.Text = e.values(0)
 
Me.Text = e.values(0)

Revision as of 19:11, 8 September 2016

DataSubscriber

This component is used to monitor a value within the PLC without a visual control. It has to events to indicate when data has returned from the PLC and when the value has changed. Within these events you would add your own code to perform any action desired.

Properties
ComComponent Points to the driver instance for reading its values through
PLCAddressValue Enter the PLC address of the value you wish to monitor


Walk Through

1) Add a driver to the form and set the corresponding properties
2) Add a DataSubscriber to the form
3) Enter a valid PLC address in the PLCAddressValue property
4) Double click the DataSubscriber to get back to the DataChanged event handler
5) Enter this code:
Me.Text = e.values(0)

When the application runs, the value from the PLC will be put into the title bar of the window.