User manual

Table Of Contents
FieldMaxII-TO User Manual
54
is a countdown value that starts at 60 and decrements by
one for each event. The terminal value for ZeroDevice-
TimeoutCounter will be 0 or -1 when zero completes. 0
indicates a successful completion. -1 indicates a failure.
Teardown Devices connected to the application must be closed. The
cFM2Notify object passes a reference to the
cFM2Devices collection with every callback to the
application code via the IFM2DeviceEvents_
NotifyDeviceStatus callback method. All connections
must be closed by calling the IFM2Device_
CloseAllUSBDeviceDrivers() using the IFM2Device_
DeviceHandle as the method argument.
The following Visual Basic 6.0 code shows how to close
the connections:
‘Global declarations:
‘Devices collection returned from the callback object
Dim DevicesList As cFM2Devices
‘Executable code:
If Not (DevicesList Is Nothing) Then
If Not (DevicesList.Count = 0) Then
Dim device As IFM2Device
For Each device In DevicesList
device.CloseAllUSBDeviceDrivers device.DeviceHandle
Next
End If
End If
The remaining teardown is simply the process of
undoing the setup.