GPIB远程控制CMS54综测仪(加单位控不成功)

使用GPIB控制CMS54综测仪,加单位之后控不成功

问题描述:

使用GPIB指令控制CMS54综测仪,如果不加单位,指定参数就可以控成功;如果加了单位,比如 MHz 或者dBm等,参数就控不成功。(使用GPIB提供的小工具,发控制命令是可以控成功的,自己写通过代码发参数控不成功)

GPIB读写小工具:
这里写图片描述

原因:

在大多数情况下,可能是因为GPIB字符串的终止是错误的。如果使用终止0x0A(\n),则GPIB程序将正常运行。

例子:

命令频率:RF:TXTEST 200 KHZ如果字符串被一个新行字符(十六进制0a)终止,就可以工作。这意味着您必须编写“频率:RF:TXTEST 200 KHZ \n”。在CMS中使用指定单元的所有设置命令,终止字符是必需的。

英文资料:

Changing Units for Remote Control
Question
I have a GPIB interface and want to remote control with the CMS. My example is running, but some units such as MHz or dBm are not accepted although they are listed in the CMS manual. What is the reason for this?
Answer
In most cases, the termination of the GPIB string is wrong. If you use the termination 0x0A, the GPIB program will run.
Example:
The command FREQUENCY:RF:TXTEST 200 KHZ works if the string is terminated by a new-line character (hex 0a). This means you have to write “FREQUENCY:RF:TXTEST 200 KHZ\n”.
The termination character is necessary for all setting commands in the CMS with a specified unit.
For Rohde&Schwarz BASIC, you can use the IEC TERM 10 command.

最近在做自动测试项目,在项目进行的过程中遇到了这个坑,所以总结一下,希望能帮助后来者。