0

我显然无意中更改了一些设置,因此发送到我的设备的所有包含问号的 SCPI 命令都会抛出 -110(命令标题错误),如此处所述:

-110 命令头错误 - 表示命令中存在语法错误。在这种情况下,SENSE 和 VOLT 之间有两个冒号。示例“:SENSE::VOLT:RANGE 10”

所有其他命令(当然,如果使用得当)工作正常。由于该错误,我的猜测是我的计算机发送非信件的方式有问题?

注意:我正在使用#echo "READ?" > /dev/ttyS0. 我仍然收到回复,cat /dev/ttyS0但我收到哔声和错误。(同样的错误发生在我的 C 代码中)

4

1 回答 1

0

Just figured out the solution! It appears that somehow (perhaps the blue screen I had yesterday on the Windows where I was running my linux VM from) the settings for ttyS0 were reset so that there was software flow control for sending data but not receiving. Thus, my transmissions didn't work with either no flow control or xon_xoff.

To fix this, I set no flow control on my external serial device and ran stty -F /dev/ttyS0 -ixon on the linux box.

Alternatively, I could have set flow control on the serial device to xon_xoff and ran stty -F /dev/ttyS0 ixoff on the linux box.

于 2013-06-27T20:30:38.320 回答