Difference between revisions of "IComComponent"

From AdvancedHMI
Jump to: navigation, search
(IComComponent Interface)
Line 21: Line 21:
 
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.
  
Function BeginRead(ByVal startAddress As String, ByVal numberOfElements As Integer) As Integer<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>
 
Function Read(ByVal startAddress As String, ByVal numberOfElements As Integer) As String()<br>
 
Function BeginWrite(ByVal startAddress As String, ByVal numberOfElements As Integer, ByVal dataToWrite() As String) As Integer<br>
 
Function BeginWrite(ByVal startAddress As String, ByVal numberOfElements As Integer, ByVal dataToWrite() As String) As Integer<br>
 
Function Write(ByVal startAddress As String, ByVal dataToWrite As String) As String<br>
 
Function Write(ByVal startAddress As String, ByVal dataToWrite As String) As String<br>

Revision as of 18:52, 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. 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