Installation manual

DEVICE COLLECTION OBJECT
55
5
EXAMPLE
...
Private Sub RFNCCTL_DataEvent(ByVal SatID As Integer, ByVal
DevID As Integer, ByVal Kind As Boolean)
On Error Resume Next
Dim item As ListItem
Dim sDevice As Device
Dim strAnswer As String
Dim vaData As Variant
Dim strData As String
Dim byteData As Byte
Dim i As Integer
Set sDevice = OCX.Devices.Device(DevID)
vaData = sDevice.DeviceData
'
'Data interpretation
'
strData = ""
If OCX.Mode <> MODE_BINARY Then
‘vaData has been set to VT_BSTR type by the control
strData = CStr(vaData)
Else
‘vaData has been set to VT_ARRAY | VT_UI1 type by the
control
For i = 0 To sDevice.DataLen -1
byteData = vaData(i)
strData = strData & Right("000" + CStr(byteData),3)+""
Next i
End if
Set item = ListData.ListItems.Add(, ,CStr(nItem))
item.ListSubItems.Add , , CStr(DevID)
item.ListSubItems.Add , , strData
...
End Sub