问题一
错误信息:
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2019.11.3.1
错误所在事件:串口监视器,DataReceived
详细错误信息:
索引超出了数组界限。
错误代码:
'串口读取数据代码
Dim i,cnt As Integer
Dim jssj As String
Select Case e.Port.PortName
Case “com1”
cnt = e.Port.BytesToRead
If cnt = vars("coml") Then
Dim Vr(cnt - 1) As Byte
e.Port.Read(Vr,0,cnt)
jssj = ""
For i = 0 To cnt - 1
If jssj = "" Then
jssj = Vr(i)
Else
jssj = jssj & "-" & Vr(i)
End If
Next
Functions.AsyncExecute("AC200",jssj)
End If
Case “com2”
cnt = e.Port.BytesToRead
If cnt > 0 Then
Dim Vr(cnt - 1) As Byte
e.Port.Read(Vr,0,cnt)
jssj = ""
For i = 0 To cnt - 1
If jssj = "" Then
jssj = Vr(i)
Else
jssj = jssj & "-" & Vr(i)
End If
Next
Functions.AsyncExecute("TCU",jssj)
End If
Case “com3”
cnt = e.Port.BytesToRead
If cnt > 0 Then
Dim Vr(cnt - 1) As Byte
e.Port.Read(Vr,0,cnt)
jssj = ""
For i = 0 To cnt - 1
If jssj = "" Then
jssj = Vr(i)
Else
jssj = jssj & "-" & Vr(i)
End If
Next
Functions.AsyncExecute("LLNJ",jssj)
End If
Case Functions.Execute("GET","串口号","WD","值")
cnt = e.Port.BytesToRead
If cnt > 0 Then
Dim Vr(cnt - 1) As Byte
e.Port.Read(Vr,0,cnt)
jssj = ""
For i = 0 To cnt - 1
If jssj = "" Then
jssj = Vr(i)
Else
jssj = jssj & "-" & Vr(i)
End If
Next
Functions.AsyncExecute("WD",jssj)
End If
End Select
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2019.11.3.1
错误所在事件:自定义函数TCU
详细错误信息:
调用的目标发生了异常。
没有为 类型“DBNull” 和 类型“Integer” 定义运算符“=”
错误代码:
Dim sj As String = args(0)
If vars("kt") = 1 Then
If Forms("主窗口").opened Then
Forms("主窗口").Controls("tt").text = Format(Date.now,"HHmmssfff")
If vars("sjt") > "" Then
vars("sjt") = vars("sjt") & "-" & sj
Else
vars("sjt") = sj
End If
End If
End If
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2019.11.3.1
错误所在事件:自定义函数TCU
详细错误信息:
调用的目标发生了异常。
索引超出范围。必须为非负值并小于集合大小。
参数名: index
错误代码:
Dim sj As String = args(0)
If vars("kt") = 1 Then
If Forms("主窗口").opened Then
Forms("主窗口").Controls("tt").text = Format(Date.now,"HHmmssfff")
If vars("sjt") > "" Then
vars("sjt") = vars("sjt") & "-" & sj
Else
vars("sjt") = sj
End If
End If
End If
[此贴子已经被作者于2019/11/28 16:58:10编辑过]