07-26-2021 05:58 AM - edited 07-26-2021 06:01 AM
Hi everyone,
I use SCPI commands and c# programming language in my program to communicate with various devices. After sending incorrect or incomplete commands to the devices, only way to understand that if my command is correct or wrong is sending error query command (SYST:ERR?) afterwards. For example, if I send wrong command like "SOUR:V" instead of correct version "SOUR:VOLT 10(value)", I can only understand if it is correct or wrong after sending error query command. Is there a way to understand if the command is wrong without sending error query command? For example, generating an exception after sending a wrong command.
Thanks in advance
07-26-2021 07:08 AM
@Bbusra wrote:
Is there a way to understand if the command is wrong without sending error query command?
Only if the instrument automatically sends the error back when an error is generated. I have yet to see an instrument do this. So I use a library where I query the error queue after every command.
07-26-2021 07:36 AM
Thanks for the answer. Is there any NI library which can do this, or do you use your own library which can do this?
07-26-2021 08:02 AM
@Bbusra wrote:
Thanks for the answer. Is there any NI library which can do this, or do you use your own library which can do this?
It is a self made "SCPI Instrument" library. Not hard to make, but used in a large percentage of drivers that I have written.