Eliminating Common SCPI Errors
There are three SCPI errors which occur more often than any others:
- -113, "Undefined header"
- -410, "Query INTERRUPTED"
- -420, "Query UNTERMINATED"
This paper gives likely causes for these errors, and ideas for avoiding them.
-113, "Undefined header"
This error indicates that what you sent to the instrument did not contain a recognizable command name. The most likely causes for this are:
- Missing space between the command and its parameter. There must be one or more spaces (blanks) between the command and its parameter. For example: :sens:volt:dc:rang100 wrong
- Improper short or long form. Check the manual or the Quick Reference Guide for the correct command name.
- Blanks (spaces) within the command name. Blanks are not permitted within the command name. For example: :syst:err? right
:sens:volt:dc:rang 100 right
:syst: err? wrong
-410, "Query INTERRUPTED"
This error occurs when you have sent a valid query to the instrument, then send it another command or query, or a Group Execute Trigger (GET) before it has had a chance to send the entire response message (including the line-feed/EOI terminator). The most likely causes are:
- Sending a query to the instrument and then sending another command or query before reading the response to the first query. For example, the following sequence of commands will cause an error -410: send syst:err?
- Incorrectly configured IEEE 488 driver. The driver must be configured so that when talking on the bus it sends line-feed with EOI as the terminator, and when listening on the bus it expects line-feed with EOI as the terminator. See the reference manual for your particular IEEE 488 interface.
because you must read the response to syst:err? before sending another command or query.
-420, "Query UNTERMINATED"
This error occurs when you addess the instrument to talk and it has nothing to say. The most likely causes are:
- Not sending a query. You must send a valid query to the instrument before addressing it to talk. This is true even of measuring instruments, such as the Model 2001. You cannot get a reading from the 2001 until you send it a query.
- Sending an invalid query. If you have sent a query and still get this error, make sure that the instrument is processing the query without error. For example, sending an ill-formed query which generates an error -113, "Undefined header" and then addressing the instrument to talk will generate an error -420, "Query UNTERMINATED" as well.
- Valid query following an invalid command. This can occur when you send mutiple commands or queries (program message units) within one command string (program message). When the Model 2001 detects an error in a program message unit, it discards all further program message units until the end of the string. For example, in the following program message: :sens:date?;:sens:func?
the first program message unit :sens:date? will generate error -113, "Undefined header", and the Model 2001 will discard the second program message unit :sens:func? even though it is a valid query. NOTE: There are plans to modify the behavior of our SCPI instruments, such that queries following an erroneous program message unit do not get discarded, but commands do. This feature will be listed in the release notes for existing products when new firmware contains this modification, and in the User Manual for new products.