Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating An Exception After Using A Wrong Command

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

0 Kudos
Message 1 of 4
(1,187 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,166 Views)

Thanks for the answer. Is there any NI library which can do this, or do you use your own library which can do this?

0 Kudos
Message 3 of 4
(1,155 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(1,148 Views)