Products

DeviceVGP_Get

This will retrieve a value/graphic pair object (VGPair) from a device if it matches the value provided.

Public Function DeviceVGP_Get(ByVal dvRef As Integer, _
                                              ByVal Value As DoubleAs VGPair

MyPair = hs.DeviceVGP_Get(ref, Value)
If MyPair Is Nothing Then
    hs.WriteLog("Error","Could not find the value/graphic pair for the value " & Value.ToString & " on the device " & hs.DeviceName(ref))
    Exit Sub
End If

Where:

ref= device reference #

Value = The value of the value/graphic pair you are looking for (use the starting value of the range to retrieve a range type pair).


You can check the return value (VSPair object) to determine if it was successful or not.  If the returned object = Nothing, then the pair matching the provided parameters was not found.