Hey anyone got any ideas what i am doing to cause this error. Would comm mode be an issue? I have tried both.
Type mismatch: '[string: "OK"]' in line 21 More info: Type mismatch: '[string: "OK"]' (line 21 is select case)
The device is sending a "0" or "1" as reply.
Here is the script in question...
Const CommPort = 4
sub main()
Dim Data
Dim Count
For Count = 1 to 8
hs.SendToComPort CommPort,"GI" & Count
Do
Data = hs.GetComPortData(CommPort)
Loop While InStr(1,Data, "") = 0
Select Case Data
Case 0
hs.SetDeviceStatus "x" & Count, 3 'is ON
Case 1
hs.SetDeviceStatus "x" & Count, 2 'is ON
Case Else
hs.writelog "Comport data error",Data
End Select
Next
Type mismatch: '[string: "OK"]' in line 21 More info: Type mismatch: '[string: "OK"]' (line 21 is select case)
The device is sending a "0" or "1" as reply.
Here is the script in question...
Const CommPort = 4
sub main()
Dim Data
Dim Count
For Count = 1 to 8
hs.SendToComPort CommPort,"GI" & Count
Do
Data = hs.GetComPortData(CommPort)
Loop While InStr(1,Data, "") = 0
Select Case Data
Case 0
hs.SetDeviceStatus "x" & Count, 3 'is ON
Case 1
hs.SetDeviceStatus "x" & Count, 2 'is ON
Case Else
hs.writelog "Comport data error",Data
End Select
Next
Comment