OPC Mobile Read Values

Refer to the VB.NET WinForm Example application for a full example on how to read data from OPC Systems.NET using the OPC Controls.NET Data component which performs exactly as the OPC Mobile.NET Data component.

To read values from any OPC Systems Service involves one simple method to let the OPC Systems Services which Tags you wish to read and one simple event to receive all changes and updates to the Tags you wish to read.

Use the AddTag or AddTags as many times as you desire to subscribe to both local and remote OPC Systems Services.

        Dim Tags(2) As String

        Tags(0) = "\\192.168.0.1\Ramp.Value"

        Tags(1) = "\\192.168.0.1\Sine.Value"

        Tags(2) = "\\192.168.0.1\Random.Value"

        OpcMobileData.AddTags(Tags)

Use the ValuesChanged Event to receive the requested values continuously any time the values are requested or the values change.

Private Sub OpcMobileData_ValuesChanged(ByVal Tag As String, ByVal Value As Object, ByVal Quality As Boolean) Handles OpcMobileData.ValuesChanged

Use the RemoveTag or RemoveTags as many times as you desire to unsubscribe to remote OPC Systems Services.

        Dim Tags(2) As String

        Tags(0) = "\\192.168.0.1\Ramp.Value"

        Tags(1) = "\\192.168.0.1\Sine.Value"

        Tags(2) = "\\192.168.0.1\Random.Value"

        OpcMobileData.RemoveTags(Tags)