Difference between revisions of "IComComponent"

From AdvancedHMI
Jump to: navigation, search
(IComComponent Interface)
Line 10: Line 10:
 
<font size="4"><u>'''Methods'''</u></font>
 
<font size="4"><u>'''Methods'''</u></font>
  
Function Subscribe(ByVal plcAddress As String, ByVal numberOfElements As Int16, ByVal pollRate As Integer, ByVal callback As EventHandler(Of Common.PlcComEventArgs)) As Integer<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>
Function Unsubscribe(ByVal id As Integer) As Integer<br>
+
 
 +
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.
 +
 
 +
<b>''Function Unsubscribe(ByVal id As Integer) As Integer''</b><br>
 +
 
 
Function BeginRead(ByVal startAddress As String, ByVal numberOfElements As Integer) As Integer<br>
 
Function BeginRead(ByVal startAddress As String, ByVal numberOfElements As Integer) As Integer<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:50, 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

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