Installation manual

STAR-LINK™
40
3
EVENT DEVICEINFOEVENT
PURPOSE
Device coming into the network.
DESCRIPTION
This event will be sent from the control to the application when a new device
becomes active in the network. The device must link to the network before sending
data. In this way it is possible to capture the particular frame and communicate it to
the application.
IDL
[id(8), helpstring("method DeviceInfoEvent")] HRESULT DeviceInfoEvent(short DevID);
INPUT PARAMETERS
None
OUTPUT VALUE
DevID as short with the ID of the device becoming active
EXAMPLE
...
Private Sub RFNCCTL_DeviceInfoEvent(ByVal DevID As Integer)
Dim db As Database
Dim rs As Recordset
Dim strAnser As String
Dim strSQL As String
strSQL = "SELECT * FROM DeviceTable WHERE DevID = '" & CStr(DevID)
& "'"
Set db = OpenDatabase(“C:\Example\DeviceDB.mdb”)
Set rs = db.OpenRecordset(strSQL, , dbOpenDynaset)
On Error GoTo ErrorHandler
‘ We have found the device so we do not add it to DB
rs.MoveFirst
db.Close
Exit Sub
ErrorHandler:
rs.AddNew
rs.Fields("DevID") = CStr(DevID)
rs.Fields("Answer") = "Answer for device " & CStr(DevID)
rs.Update
End Sub
...