Installation manual
DEVICE OBJECT
87
7
EXAMPLE
...
...
‘
‘ Data Event Handler In this example if kind value is TRUE
‘ the frame is two ways, so
‘ the device is waiting for a response from the PC
‘
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 vaData As Variant
Dim strData As String
……
Set sDevice = OCX.Devices.Device(DevID)
vaData = sDevice.DeviceData
'
'Data interpretation
'
……
'
'Answer manager
'
If Cbool(Kind) = True Then
item.ListSubItems.Add , ,"Two Way"
'Send back the string “OK”
strAnswer = “OK”
If Not sDevice.DataWrite(strAnswer, Len(strAnswer))=True
Then ListData.ListItems.Add , ,"Error Send Data"
Else
item.ListSubItems.Add , , "One Way"
End If
End Sub
...
...