Difference between revisions of "IComComponent"
Line 11: | Line 11: | ||
<b>''Function Subscribe(ByVal plcAddress As String, ByVal numberOfElements As Int16, ByVal pollRate As Integer, ByVal callback As EventHandler(Of Common.PlcComEventArgs)) As Integer''</b><br> | <b>''Function Subscribe(ByVal plcAddress As String, ByVal numberOfElements As Int16, ByVal pollRate As Integer, ByVal callback As EventHandler(Of Common.PlcComEventArgs)) As Integer''</b><br> | ||
− | |||
Subscriptions are used by the majority of the AdvancedHMI controls to receive their data from the PLC. Once a subscription is created, the driver will read the value at a rate defined by the PollRateOverride property and return it to the subscriber. Most drivers optimize their subscription list in as few reads as possible. For values that need continuous updates, subscriptions will be the most efficient method. | Subscriptions are used by the majority of the AdvancedHMI controls to receive their data from the PLC. Once a subscription is created, the driver will read the value at a rate defined by the PollRateOverride property and return it to the subscriber. Most drivers optimize their subscription list in as few reads as possible. For values that need continuous updates, subscriptions will be the most efficient method. | ||
Line 18: | Line 17: | ||
<b>''Function Unsubscribe(ByVal id As Integer) As Integer''</b><br> | <b>''Function Unsubscribe(ByVal id As Integer) As Integer''</b><br> | ||
− | |||
Calling this method and passing the SubscriptionID that was return from the subscribe call will remove the item from the subscription list and the driver will stop updating the value. | Calling this method and passing the SubscriptionID that was return from the subscribe call will remove the item from the subscription list and the driver will stop updating the value. | ||
<b>''Function BeginRead(ByVal startAddress As String, ByVal numberOfElements As Integer) As Integer''</b><br> | <b>''Function BeginRead(ByVal startAddress As String, ByVal numberOfElements As Integer) As Integer''</b><br> | ||
− | Function Read(ByVal startAddress As String, ByVal numberOfElements As Integer) As String()<br> | + | <b>''Function Read(ByVal startAddress As String, ByVal numberOfElements As Integer) As String()''</b><br> |
− | Function BeginWrite(ByVal startAddress As String, ByVal numberOfElements As Integer, ByVal dataToWrite() As String) As Integer<br> | + | <b>''Function BeginWrite(ByVal startAddress As String, ByVal numberOfElements As Integer, ByVal dataToWrite() As String) As Integer''</b><br> |
− | Function Write(ByVal startAddress As String, ByVal dataToWrite As String) As String<br> | + | <b>''Function Write(ByVal startAddress As String, ByVal dataToWrite As String) As String''</b><br> |
Revision as of 18:54, 3 September 2016
IComComponent Interface
AdvancedHMI's controls work by requesting or sending data to a driver. In order for a single control to work with any driver, the driver's must implement a common interface. This interface is defined as the IComComponent. All AdvancedHMI drivers implement the methods and properties defined by this interface.
Properties
DisableSubscriptions - Pauses updating of subscriptions. This is useful in cases such as when hiding a form and there is no longer a need to refresh the values. Or when used with a Trend Chart, it can pause the charting.
Methods
Function Subscribe(ByVal plcAddress As String, ByVal numberOfElements As Int16, ByVal pollRate As Integer, ByVal callback As EventHandler(Of Common.PlcComEventArgs)) As Integer
Subscriptions are used by the majority of the AdvancedHMI controls to receive their data from the PLC. Once a subscription is created, the driver will read the value at a rate defined by the PollRateOverride property and return it to the subscriber. Most drivers optimize their subscription list in as few reads as possible. For values that need continuous updates, subscriptions will be the most efficient method.
When using this function, it is important to store the SubscriptionID result for unsubscribing when no longer needed.
Function Unsubscribe(ByVal id As Integer) As Integer
Calling this method and passing the SubscriptionID that was return from the subscribe call will remove the item from the subscription list and the driver will stop updating the value.
Function BeginRead(ByVal startAddress As String, ByVal numberOfElements As Integer) As Integer
Function Read(ByVal startAddress As String, ByVal numberOfElements As Integer) As String()
Function BeginWrite(ByVal startAddress As String, ByVal numberOfElements As Integer, ByVal dataToWrite() As String) As Integer
Function Write(ByVal startAddress As String, ByVal dataToWrite As String) As String