7. instrument error checking -ag真人试玩网址

instrument error checking (further referred to as error checking) is the second most important aspect of your remote-control application. the goal of error checking is to assure error-free communication with your instrument, so that all desired settings have been correctly performed, and the measurement results obtained have been acquired using the desired settings.

a part of the instrument status subsystem is a error messages buffer called error queue. if you, for example, send a scpi command that the instrument does not recognize, it generates a new entry in the error queue. error queue has a finite length, usually 10 entries and the oldest entry is discarded to make space for a new one.

explained in chapter measurement sychronization, the status byte contains bit 2 - error message available. to find out whether the error queue is empty, query the *stb? bit 2. if its value is 0, continue further with no additional actions. otherwise, use the scpi query system:error?. the instrument returns the last generated error e.g. -113,”undefined header”. at the same time, this entry is deleted from the error queue. to read all the entries, you need to call the system:error? in a loop until you receive the response 0,”no error” indicating that there are no more errors pending.

the following visa trace shows error checking in action:

  • the first command '*rst' is sent correctly, resulting in no error being generated.
  • the second command '*rsat' is misspelled, which generates -113, "undefined header" error. the syst:err? query is sent in a loop until the response is 0,"no error".
rsvisatracetool log with error checking

if you use instrument drivers, the error checking is already implemented and performed in every function and after setting every property (attribute). this is very convenient, since you are immediately informed that the error that has occurred and after which command it has occurred. if you require maximum speed, the drivers offer the possibility to switch this feature off (see the first tip of the next chapter 8: speed optimization).

if you use direct scpi commands, you need to take care of the error checking yourself. we recommend to do the error checking after logical block of commands. here, keep in mind that the more commands you send in one block, the harder it is to point to a specific command that has generated the error.

let us take the example from the previous and focus only on the actions in the pc. practical realization of error checking is already integrated in the examples that are linked in that chapter. the picture below shows the error checking performed after logical blocks of commands:

request information

do you have questions or need additional information? simply fill out this form and we will get right back to you.




我同意,在网站imprint中提到的rohde & schwarz gmbh & co. kg和罗德与施瓦茨实体及分支机构 可出于营销和广告之目的(例如提供特价优惠和折扣促销信息)而通过选定渠道(电子邮件或邮政信件)与我联系并提供相关信息,包括但不限于测试与测量、安全通信、监测与网络测试、广播电视与媒体以及网络安全领域的产品和ag真人试玩网址的解决方案相关信息


您可以随时发送电子邮件至 撤销此同意声明,邮件主题注明“unsubscribe”即可。此外,我们发送给您的每一封电子邮件中都含有电子邮件取消订阅链接。有关个人数据使用和撤销程序的详情,请参阅“隐私声明”

an error is occurred, please try it again later.