我使用以下函数向仪器发送命令并接收查询结果,它工作正常。
Public Function InstrSndRcv(cmd2Send As String) As String
MyInstrument.WriteLine(cmd2Send)
' if myTimeout(desierdtime) then
'Return "my string"
'else
Dim qryRetrn As String = MyInstrument.ReadLine()
Return qryRetrn
'End if
End Function
我已经用子程序 myTimeout(desiredtime) 注释掉了我需要的条件功能。如何在 VB.NET 中实现它?
这个想法是在仪器不响应查询命令的情况下返回“我的字符串”。可能有更好的方法来做到这一点......