38: End If
39: StatusBar1.Panels(3).Text = "RX: " & str
40: inputInputString = str
41: tmr_RCVTIMER.Enabled = True
42: End Function
4.3.5.5
Example Timer Routine: Toggle Port State
This is the timer routine in which the open/closed state of the port is
toggled. If communications are interrupted, the USB device will re-
register itself with the OS (vendor term: renumeration). Once this
happens, re-opening the port will enable communications. Until the
re-registration happens, open operations will fail. Notice line 5
where we register an error handler.
1:Private Sub tmrOpenClose_Timer()
2: If MSComm1.PortOpen = True Then
3:
4: MSComm1.PortOpen = False
5: On Error GoTo done
6: MSComm1.PortOpen = True
7: done:
8: tmrOpenClose.Enabled = False
9: End If
10:
11: End Sub
4.3.5.6
Example Timer Routine: Port Reconnection
This is another timer routine whose purpose is to turn the port on if
it is off. Notice that in line 8 an error handler is called because if the
device has not re-registered itself with the OS, an error will be
raised.
1: Private Sub tmr_COMMWDT_Timer()
2:
3: tmr_COMMWDT.Enabled = False
4:
5: If CommStatusFlag = True Then
6:
7: If MSComm1.PortOpen = False Then
8: On Error GoTo done
9: MSComm1.PortOpen = True
10: done:
11: End If
12:
13: ElseIf CommStatusFlag = False Then
14:
118080-001 REV A
Page 34 of 95
Summary of Contents for SLM SERIES
Page 15: ...SLM MANUAL 6 118073 001 Rev C Figure 2 2 Unit Dimensions 1200W ...
Page 19: ...SLM MANUAL 10 118073 001 Rev C Figure 3 3 Local Programming via External Voltage Source ...
Page 20: ...SLM MANUAL 11 118073 001 Rev C Figure 3 4 Remote Monitoring ...
Page 40: ...Figure 9 Web Page 1 Contact Information 118080 001 REV A Page 13 of 95 ...
Page 98: ...Request Faults 68 20 ASCII 118080 001 REV A Page 71 of 95 ...