For faster navigation, this Iframe is preloading the Wikiwand page for SCPI.

SCPI

可编程仪器标准命令(英语:Standard Commands for Programmable Instruments缩写SCPI)定义了一套用于控制可编程测试测量仪器的标准语法和命令。

概述

[编辑]

SCPI于1990与IEEE 488.2协议一起面世。这套标准定义了可用于控制一切仪器的语法,命令结构以及数据格式。比如,通用的命令,如配置仪器参数的命令CONFigure,测量命令MEASure等。这些命令可用于任一仪器,并且同一类的命令属于同一子系统里。SCPI同时也定义了若干仪器的种类。比如,任何可控制的电源都会实现DCPSUPPLY基本功能类型。仪器的类别规定了它们会去实现什么样的子系统,当然也包括针对仪器的特定功能。

需要注意的是,SCPI并未定义物理层的传输信道的实现方法。虽然上文指出它最开始是和IEEE 488.2(即GPIB)面世的,但SCPI控制命令也可用于串口(RS-232)、以太网USB接口、VXIbus等若干硬件总线。

SCPI命令是ASCII字符串,通过物理传输层传入仪器。命令由一连串的关键字构成,有的还需要包括参数。在协议中,命令规定为如下形式:CONFigure。在使用中,即可以写全名,也可以仅写仅包含大写字母的缩写。通常仪器对于查询命令的反馈也为ASCII代码。在传输大量数据时,二进制数据也是可以使用的。

语法

[编辑]

SCPI命令大致分为两种功能,

改变仪器运行状态的set操作(打开/关闭电源输出),或者查询仪器状态的query操作(例如读取输出电压值)。查询命令一般以问号(?)结尾。有些命令即可以用来设置,也可以用来查询仪器。

相似的命令可以被归类成一种层状或树状结构。例如,任何读取仪器测量结果的命令均可以MEASure开头。特定的子命令以冒号同上级命令分隔开。例如,测量直流电压会是这样的形式:MEASure:VOLTage:DC?,或者测量交流电流会是这样的形式:MEASure:CURRent:AC?

参数

[编辑]

有些命令需要额外的参数。参数一般跟在命令的后面,以空格隔开。例如,将某个仪器的触发模式设为normal的命令可写为:TRIGer:MODe NORMal。上述命令里NORMal即为参数。

串联命令

[编辑]

多个命令可用一条语句发送至仪器,只需在每条命令后使用分号;隔开即可。同时,除了第一条命令,随后的每条命令前必须加一个分号的前缀(除非其以星号开头)。例如,测量直流电压和交流电流可以写成一条语句:MEASure:VOLTage:DC?;:MEASure:CURRent:AC?

缩略命令

[编辑]

可以只发送命令名中的大写字母部分。例如,命令SYSTem:COMMunicate:SERial:BAUD 2400将会设置RS-232通讯端口的比特率为2400。这个命令可以简写为SYST:COMM:SER:BAUD 2400

历史

[编辑]

首次发布于1990年[1],SCPI的起源是IEEE-488的另外一个层。 IEEE-488.1指定了物理和电气总线,IEEE488.2指定了协议和数据格式,但是都没有指定仪器的指令。不同的制造商,甚至不同的型号、相同类型的仪器都需要使用不同的命令集。 SCPI创建了一个标准,可以在所有的制造商和所有型号中通用。它需要使用的IEEE488.2数据格式,但不必非得是-488.1总线[2] 在2002-2003年,SCPI协会投票成为IVI基金会的一部分(可互换虚拟仪器)[2].

参见

[编辑]

参考资料

[编辑]
  1. ^ History of GPIB. National Instruments. [2010-02-06]. (原始内容存档于2012-04-17). In 1990, the IEEE 488.2 specification included the Standard Commands for Programmable Instrumentation (SCPI) document. 
  2. ^ 2.0 2.1 SCPI. IVI Foundation. [2010-06-02]. (原始内容存档于2011-02-06). 

外部链接

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
SCPI
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?