118142-001 Rev B
Page 37 of 104
15: If MSComm1.PortOpen = False Then
16:
17: MSComm1.PortOpen = True
18: Else
19: MSComm1.PortOpen = False
20: End If
21:
22: End If
4.3.5.7
Data Parsing Example
Here we have an example of a code that parses incoming data.
Notice that it makes use of our generic input and output routines.
The important consideration is to gracefully handle corrupted input
data after a noise event. In this case we may get data, so a test
against empty string returns false, but we may not get commas in
the correct place. Notice that we register an error handler on line 26
so that the mid function, which would raise an error when given a
negative number, is handled.
1: Private Sub btn_EMI_Click()
2: Dim temp2$
3: Dim Response1$
4: Dim Response2$
5: Dim number$
6: Dim Comma
7: Dim CommaPos
8: Dim Start
9: Dim ODATA$
10:
11: Comma = ","
12: Start = 5
13:
14: If tmr_RCVTIMER.Enabled = True Then
tmr_RCVTIMER.Enabled = False
15: If tmr_NETRCVTMR.Enabled = True Then
tmr_NETRCVTMR.Enabled = False
16:
17: If AutoUpdate = True Then
18: tmr_UPDATE.Enabled = False
19: End If
20:
21: number$ = "15,"
22: outputOutputString (number$)
23:
24: temp2$ = inputInputString
25: CommaPos = InStr(Start, temp2$, Comma, vbTextCompare)
Summary of Contents for DXM100 Series
Page 11: ...DXM100 MANUAL 5 118147 001 Rev D Figure 2 1 Unit Dimensions ...
Page 16: ...DXM100 MANUAL 10 118147 001 Rev D Figure 3 3 Local Programming Via External Voltage Source ...
Page 17: ...DXM100 MANUAL 11 118147 001 Rev D Figure 3 4 Remote Monitoring ...
Page 18: ...DXM100 MANUAL 12 118147 001 Rev D RELAY Figure 3 5 Enable Interlock Logic Control ...
Page 37: ...118142 001 Rev B Page 13 of 104 Figure 9 Web Page 1 Contact Information ...