Before starting to talk about SCPI commands that is already implemented and will be included into the firmware M1 maybe it's good to say something in general about SCPI.
SCPI is used for remote control of various electronic devices what are called
Instruments. The remote "console" software is called
Controller and it is used to send SCPI commands or queries. In general commands are used for setting certain parameters (i.e. set voltage or current), enable some function (i.e. output enable) or start execution (i.e. start arbitrary waveform generation). To get information from the instrument (power supply) a query form of the command is usually used that represents command with
question mark (?). For example to set output voltage to 20V you can use:
VOLTage 20 and to get what is currently set (but is not necessary present on the output since channel is in CC mode or output is disabled) you can use:
VOLTage?
20.00I wrote VOLTage as a mix of upper and lower case to indicate another specific feature of the SCPI: all commands are
case insensitive and commands have short (three or four character) and long form. It's a common practice to make distinction between short and long variant by using upper case for the short variant. Therefore all of the following is allowed:
VoLtaGe
voltage
VOLT
volt
... but you cannot use other then short or long word such as:
VOL
volta
VOLTAG
Before starting to talk about SCPI commands that is already implemented and will be included into the firmware M1 maybe it's good to say something in general about SCPI. SCPI is used for remote control of various electronic devices what are called instruments. The remote "console" software is called controlled and it is used to send SCPI commands or queries. In general commands are used for setting certain parameters (i.e. set voltage or current), enable some function (i.e. output enable) or start execution (i.e. start arbitrary waveform generation). To get information from the instrument (power supply) a query form of the command is usually used that represents command with
question mark (?). For example to set output voltage to 20V you can use:
VOLTage 20 and to get what is currently set (but is not necessary present on the output since channel is in CC mode or output is disabled) you can use:
VOLTage?
20.00I wrote VOLTage as a mix of upper and lower case to indicate another specific feature of the SCPI: all commands are
case insensitive and commands have short (three or four character) and long form. It's a common practice to make distinction between short and long variant by using upper case for the short variant. Therefore all of the following is allowed:
VoLtaGe
voltage
VOLT
volt
... but you cannot use other then short or long word such as:
VOL
volta
VOLTAG
The primary communication channel for SCPI was IEEE 488 bus (GPIB) and due to that there is a mandatory set of IEEE 488.2 commands that has to be supported by any SCPI compliant instrument. Such command regularly
started with asterisk (*) and also could have query form (by using question mark). Some example are:
*CLR
*IDN?
*RST
*TST?
IEEE 488 bus could be partially emulated via serial port or almost completely over Ethernet with two sockets opened to emulate SRQ (ServiceReQuest)) that will be discussed in some of the future posts. The SCPI represent a group of commands divided in various so-called subsystem. Not all SCPI commands are applicable to any particular SCPI-enabled instrument. The Volume 4 of the SCPI specification 1999.0 specifically address mandatory command set for each class of instrument (power supply is one of them). Each SCPI subsystem is hierarchical and that should helps user to remember valid commands for particular action. Each command (word) in the system represent node and each node starts with :, while for root node ":" is optional. Some nodes (commands) could be also optional and it is written in square brackets. Here is an example od the TEMPerature subsystem that will be supported in M1:
TEMPerature
:PROTection
[:HIGH]
:CLEar, {MAIN|S1|S2|BAT1|BAT2}
[:LEVel] <temperature>, {MAIN|S1|S2|BAT1|BAT2}
:STATe <bool>, {MAIN|S1|S2|BAT1|BAT2}
:DELay
[:TIME] <delay>, {MAIN|S1|S2|BAT1|BAT2}
:TRIPped? {MAIN|S1|S2|BAT1|BAT2}
Notice also that mandatory arguments are closed in curly brackets ({}). Here nodes HIGH and LEVel are optional therefore you can set protection against higher temperature the 50oC by sending any of the following commands:
TEMPerature:PROTection:HIGH:LEVel 50
TEMP:PROT 50
temp:prot 50
temperature:protection 50
If command execution failed an error will be generated and the easier way to check that is by using command SYSTem:ERRor? (or simply syst:err?). The instrument will return an up to three digit integer and optionally textual description. For example if I wants to set out of range voltage I'll get the following error:
volt 60
syst:err?
-222,"Data out of range"
Complete error mechanism and list of error messages is an important topic that will be addressed separately. The support for SCPI is built around
open-source parser. My colleague took active part to make it more suitable for AVR platform (Mega) and fork it
here because without such intervention we will shortly run out of SRAM (8Kb). But that's the beauty of the open-source
.
You can concatenate more then one command in the single command line by using ";". For example in you'd like to set voltage and current to the new desired values in the single line use:
volt 30;curr 1.25
We already can access power supply using serial or Ethernet communication. Here is a session over serial (gtkTerm):
When during development some debug information are necessary than serial port can also be used for displaying it. This is an example of power on initialization with debug enabled:
When Ethernet port is enabled you can for example test communication with the power supply using ping:
... or start session using telnet: