GPIB错误提示
编程菜鸟,遇到有关GPIB编程问题如下:设备通信接口由USB变成了现在的GPIB接口,编写相应代码后运行程式就出现“send failed[28]<-[*RST]"的错误提示(28是设备地址)。但不理会它继续运行程式电脑也能控制仪器。不知为何?请高手指点!
问题可能出现在以下GPIB代码中,
If ENABLE_TEST_EQUIPEMNT = False Then Exit Function
On Error GoTo ErrHandler
Ret = GpBoardsts(&H8, MyAddr)
cmd(0) = 2
cmd(1) = MyAddr
cmd(2) = DeviceAddr
Srbuf = Str
Srlen = Len(Str)
Ret = GpTalk(cmd(0), Srlen, Srbuf)
If (Ret <> 0) Then
GpibPrint = 1
RetTmp = CheckRet("GpTalk", Ret, ErrText)
Ret = MsgBox("Send failed [ " & DeviceAddr & " ] <- [ " & Str & " ] ", vbYesNo, "Continue?")
If Ret = vbNo Then GpibPrint = 1
If Ret = vbYes Then GpibPrint = 0
End If