118142-001 Rev B
Page 35 of 104
4.3.5.4
Example Input Routine
Notice on line 26 we check for data first before extracting data from
the input. Then if we have actual data we turn off the timer.
Otherwise the timer routine toggles the port open/close.
1: Private Function inputInputString() As String
2: Dim str As String
3: Dim t1 As Single
4: Dim temp$
5: Dim stra As String
6: Dim stri(300) As String
7: t1 = Timer
8:
9: If (portType = "ethernet") Then
10: Do
11: DoEvents
12: tcpClient.GetData temp$
13: str = str + temp$
14: Loop Until InStr(str, Chr(3)) Or Timer - t1 > 1
15: On Error Resume Next
16: ElseIf (portType = "USB") Then
17: Do
18: DoEvents
19: stra = usb.ReadReport
20: str = str & stra
21: 'str = str & ReadReport
22: Loop Until InStr(str, Asc(3)) Or Timer - t1 > 0.09
23: Else
24: Do
25: DoEvents
26: If MSComm1.InBufferCount > 0 Then
27: str = str & MSComm1.Input
28: End If
29: Loop Until InStr(str, Chr(3)) Or Timer - t1 > 1
30:
31: If InStr(str, Chr(3)) > 0 Then
32: tmrOpenClose.Enabled = False
33: End If
34:
35: frm_EXTRAS.txt_MSCOMMBUFF.Text = str
36: tmr_COMMWDT.Enabled = True
37: On Error Resume Next
Содержание DXM100 Series
Страница 11: ...DXM100 MANUAL 5 118147 001 Rev D Figure 2 1 Unit Dimensions ...
Страница 16: ...DXM100 MANUAL 10 118147 001 Rev D Figure 3 3 Local Programming Via External Voltage Source ...
Страница 17: ...DXM100 MANUAL 11 118147 001 Rev D Figure 3 4 Remote Monitoring ...
Страница 18: ...DXM100 MANUAL 12 118147 001 Rev D RELAY Figure 3 5 Enable Interlock Logic Control ...
Страница 37: ...118142 001 Rev B Page 13 of 104 Figure 9 Web Page 1 Contact Information ...