Content deleted Content added
GreenC bot (talk | contribs) Rescued 1 archive link. Wayback Medic 2.5 per WP:URLREQ#webcitation.org |
→488.2 commands: clarify |
||
(43 intermediate revisions by 3 users not shown) | |||
Line 4:
[[File:Rigol DS1074Z Oscilloscope - back.jpg|thumb|right|Rear-panel of [[Rigol]] DS1074Z digital [[oscilloscope]] showing [[USB]]-B and [[Ethernet]] ([[RJ45]]) connectors that accept remote SCPI commands.<ref>[https://int.rigol.com/Public/Uploads/uploadfile/files/ftp/DS/手册/DS1000Z/EN/DS1000Z_ProgrammingGuide_EN.pdf Rigol DS1074Z Oscilloscope Programmer Manual; 2019; 264 pages.]</ref>]]
The '''Standard Commands for Programmable Instruments''' ('''SCPI'''; often pronounced "skippy") defines a standard for syntax and commands to use in controlling programmable test and measurement devices, such as [[automatic test equipment]] and [[electronic test equipment]].<ref name="SCPI-1999-spec">[
== Overview ==
SCPI was defined as an additional layer on top of the {{nowrap|IEEE 488.2-1987}} specification "Standard Codes, Formats, Protocols, and Common Commands".<ref>[http://zone.ni.com/devzone/cda/tut/p/id/3419 ni.com - History of GPIB - Developer Zone]</ref> The standard specifies a common [[syntax]], [[command (computing)|command]] structure, and [[Data type|data format]]s, to be used with all instruments. It introduced generic commands (such as <code>CONFigure</code> and <code>MEASure</code>) that could be used with any instrument. These commands are grouped into subsystems. SCPI also defines several classes of instruments. For example, any controllable [[power supply]] would implement the same <code>DCPSUPPLY</code> base functionality class. Instrument classes specify which subsystems they implement, as well as any instrument-specific features.
The physical hardware communications link (physical layer) is not defined by SCPI.<ref name="IVI-SCPI"/> While it was originally created for the [[IEEE-488]].1 (GPIB) bus,<ref name="IVI-SCPI"/> SCPI can also be used with [[RS-232]], [[RS-422]], [[
SCPI commands are [[ASCII]] textual strings,<ref name="IVI-SCPI"/> which are sent to the instrument over the physical layer
The SCPI specification consists of four volumes: Volume 1: "Syntax and Style", Volume 2: "Command Reference", Volume 3: "Data Interchange Format", Volume 4: "Instrument Classes".
===SCPI history===
Line 40:
:AC?
...
===Case===
Though the command syntax above shows commands in mixed case, SCPI is not [[Case sensitivity|case sensitive]].
:For example, for <code>VOLTage</code>, all of the following are valid representations:<code>VOLTAGE</code>, <code>voltage</code>, <code>Voltage</code>, <code>VoLtAgE</code>.
===Abbreviating commands===
The command syntax shows some characters in a mixture of upper and lower case. Abbreviating the command to only sending the upper case has the same meaning as sending the upper and lower case command.<ref name="SCPI-1999-spec"/>
:For example, the command “<code>SYSTem:COMMunicate:SERial:BAUD 2400</code>” would set an RS-232 serial communications interface to 2400 [[Bit rate|bit/s]]. This could also alternatively be abbreviated “<code>SYST:COMM:SER:BAUD 2400</code>”. The query command “<code>SYSTem:COMMunicate:SERial:BAUD?</code>” or “<code>SYST:COMM:SER:BAUD?</code>” would instruct the instrument to report its current baud rate.
The only valid commands are the short form and long form of each command, all other subset variations are invalid.
:For example, for <code>COMMunicate</code>, only <code>COMM</code> (short form) and <code>COMMUNICATE</code> (long form) are valid, but <code>COM</code>, <code>COMMUN</code>, <code>COMMUNIC</code> subsets are invalid, also appended letters are invalid too, such as <code>COMMUNICATED</code>.
=== Concatenating commands ===
Multiple commands can be issued to an instrument in a single string. They are made of simple commands separated by a semicolon character (<code>;</code>).
:For example, the command to "Measure a DC voltage then measure an AC current" would be issued as <code>MEASure:VOLTage:DC?;:MEASure:CURRent:AC?</code>. Simple commands which start with a colon (<code>:</code>) are interpreted with respect to the root of the command tree. Otherwise, they refer implicitly to the last node of the previous command (unless they already begin with an asterisk). For example,
Line 58 ⟶ 69:
===Arguments===
Some commands accept or require one or more additional arguments. Arguments are given after the command, and are separated from the command using a space.<ref name="
===Integer arguments===
Line 68 ⟶ 79:
* Octal: <code>#Q32</code> or <code>#q32</code>
* Binary: <code>#B11010</code> or <code>#b11010</code>
===488.2 commands===
Since SCPI was defined as an additional layer on top of the IEEE 488.2 specification, a SCPI compliant device should recognize various 488.2 commands too.<ref name="SCPI-1999-spec"/> These commands might also be known unofficially as asterisk commands (or star commands), because they start with the [[asterisk]] <code>*</code> character.
According to section 4.1.1 of Volume 1 of SCPI, all SCPI devices must implement the following 488.2 commands.<ref name="SCPI-1999-spec"/> In the real world some low-end test equipment may only support a subset of these 488.2 commands, or may even accept the commands but not perform any operation. A user should check the official programmers manual for each device before assuming all of these 488.2 commands are supported.
{{Div col|colwidth=15em}}
* <code>*CLS</code>
* <code>*ESE</code>
* <code>*ESE?</code>
* <code>*ESR?</code>
* <code>*IDN?</code>
* <code>*OPC</code>
* <code>*OPC?</code>
* <code>*RST</code>
* <code>*SRE</code>
* <code>*SRE?</code>
* <code>*STB?</code>
* <code>*TST?</code>
* <code>*WAI</code>
{{Div col end}}
According to section 4.1.2 of Volume 1 of SCPI, all other 488.2 commands not listed above are considered optional and not required by SCPI.<ref name="SCPI-1999-spec"/>
{{Div col|colwidth=15em}}
* <code>*AAD</code>
* <code>*CAL?</code>
* <code>*DDT</code>
* <code>*DDT?</code>
* <code>*DLF</code>
* <code>*DMC</code>
* <code>*EMC</code>
* <code>*EMC?</code>
* <code>*GMC?</code>
* <code>*IST?</code>
* <code>*LMC?</code>
* <code>*LRN?</code>
* <code>*OPT?</code>
* <code>*PCB</code>
* <code>*PMC</code>
* <code>*PRE</code>
* <code>*PRE?</code>
* <code>*PSC</code>
* <code>*PSC?</code>
* <code>*PUD</code>
* <code>*PUD?</code>
* <code>*RCL</code>
* <code>*RDT</code>
* <code>*RDT?</code>
* <code>*SAV</code>
* <code>*TRG</code>
* <code>*RMC</code>
* <code>*SDS</code>
{{Div col end}}
== See also ==
Line 76 ⟶ 139:
==References==
{{Reflist
==External links==
Line 82 ⟶ 145:
* [https://www.ivifoundation.org/About-IVI/scpi.html SCPI Organization], official website
;Specifications
* [https://www.ivifoundation.org/downloads/SCPI/scpi-99.pdf SCPI-1999, Volume 1-4], 819 page PDF file, '''free'''
* [https://
* [https://
===Programming Manual Examples===
|