Products

DeviceVSP_Get

This will retrieve a value/status pair object (VSPair) from a device if it matches the value and type provided.

Public Function DeviceVSP_Get(ByVal dvRef As Integer, _
                                              ByVal Value As Double, _
                                              ByVal VSPType As ePairStatusControlAs VSPair

MyPair = hs.DeviceVSP_Get(ref, Value, VSPType)
If MyPair Is Nothing Then
    hs.WriteLog("Error","Could not find the value/status 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/status pair you are looking for (use the starting value of the range to retrieve a range type pair).

VSPType = The ePairStatusControl type (Status, Control, Both) that you are looking for.


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.