Skip to main content

SCPI Communication

Description​

Communication with the smartCORE application is enabled via SCPI protocol using the built-in SCPI server.

Interfaces & protocols used​

  • SCPI

SCPI command set​

The supported SCPI command set is shown below. IMPORTANT: If, for example, telnet is used for communication, the input/output is restricted to the maximum line length limit (generally 4096 characters). It is then advisable to switch to other clients.

*IDN?​

Identification of the measuring device

Parameters​

NONE

Return​

(comma-separated) SCPI List of SCPI values in the following order

ParametersData type
ManufacturerSTRING
ProductSTRING
ApplicationSTRING
Protocol versionINT
Device serial numberSTRING
Hostname of the (communicating) SCPI interfaceSTRING
Port of the (communicating) SCPI interfaceINT
Application versionSTRING
Date of manufacture of the deviceSTRING
Device nameSTRING
CommentSTRING

Example​

< *IDN?
> "optiMEAS GmbH", "smartCORE", "smartcore", 0, "10000012345", "::ffff:127.0.0.1", 5024, "0.174", "19700101", "", "",

CONFIG:GET?​

Query the contents of the configuration files

Parameters​

Opt.ParameterData typeValue rangeMeaning
Configuration typeSTRING"STAT", "DYN"Selection of static/dynamic configuration

Return​

BASE64 encoded JSON configuration

Example​

< config:get? stat
> <BASE64 configuration>

CONFIG:SCHEMA?​

Query the JSON schema of the configuration files

Parameters​

Opt.ParameterData typeValue rangeMeaning
Configuration typeSTRING"STAT", "DYN"Selection of static/dynamic configuration schema

Return​

BASE64 encoded JSON configuration schema

Example​

< config:schema? stat
> <BASE64 configuration schema>

CONFIG:SET​

Replacement of the configuration files

Parameters​

Opt.ParameterData typeValue rangeMeaning
Source typeSTRING"BASE64", "FILE", "URL"Selection of configuration source
Configuration typeSTRING"STAT", "DYN"Selection of the static/dynamic configuration to be replaced
ConfigurationSTRINGsee belowDescription of the configuration

Return​

OK or ERR

Examples​

< config:set base64,stat,<BASE64 configuration>
> OK

< config:set file,dyn,/sde/smartcore_dynamic.json.new
> OK

< config:set url,dyn,http://myserver/smartcore_dynamic.json.new
> OK

DATA:COUNT?​

Query the number of configured channels

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRINGRegular expression for channel selection

Return​

INT

Examples​

< data:count?
> 42

< data:count? ^gps.*$
> 6

DATA:INFOS?​

Query the channel descriptions

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRING[]List of channel names

Return​

BASE64 coded description of the channels

Examples​

< data:infos?
> <BASE64 coded description of the channels>

< data:infos? channel name 1,channel name 2
<BASE64 coded description of the channels>

DATA:INFOS:REGEX?​

Query the channel descriptions

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRING[]List of channel names (as RegEx)

Return​

BASE64 coded description of the channels

Examples​

< data:infos:regex?
> <BASE64 coded description of the channels>

< data:infos:regex? ^can.*$,^modbus.*$
> <BASE64 coded description of the channels>

DATA:NAMES?​

Query the channel names

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRING[]List of channel names

Return​

STRING[] existing channel name

Examples​

< data:names?
> "temperature 1", "canbus 2", "modbus 3"

< data:names? canbus 2,modbus 3
> "canbus 2", "modbus 3"

DATA:NAMES:REGEX?​

Query the channel names

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRING[]List of channel names (as RegEx)

Return​

STRING[] existing channel name

Examples​

< data:names:regex?
> "temperature 1", "canbus 2", "modbus 3"

< data:names:regex? ^can.*$,^modbus.*$
> "canbus 2", "modbus 3"

DATA:VALUES?​

Query current channel values

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRING[]List of channel names

Return​

BASE64 encoded JSON array of JSON objects containing timestamp "t" and value "v" for all channel values.

Examples​

< data:values?
> <BASE64 encoded JSON array>

< data:values? channel name 1,channel name 2
<BASE64 encoded JSON array>

DATA:VALUES:REGEX?​

Query current channel values and timestamp of last update

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESChannel selectionSTRING[]List of channel names (as RegEx)

Return​

BASE64 encoded JSON array of JSON objects containing timestamp "t" and value "v" for all channel values.

Examples​

< data:values:regex?
> <BASE64 encoded JSON array>

< data:values:regex? ^can.*$,^modbus.*$
<BASE64 encoded JSON array>

DATA:VALUES:SET​

Production of a channel value (e.g. setting a process variable)

Parameters​

Opt.ParameterData typeValue rangeMeaning
SampleSTRINGsee belowDescription of the sample to be produced

The sample is defined in the form of a JSON object with the keys "channelName" and "value". This must then be BASE64 encoded. The channel specified using "channelName" must already exist.

Return​

OK or ERR

Example​

< data:values:set <BASE64 encoded JSON object with sample description>
> OK

ERROR?​

Query the last SCPI error

Parameters​

NONE

Return​

(comma-separated) list of INT,STRING consisting of error code (not equal to 0 in case of error) and an error description

Example​

< err?
> 0, "No Error!"

GPS:DATETIME?​

Returns the GPS time of the first configured GPS module.

Parameters​

NONE

Return​

ZULU Time

Example​

< gps:datetime?
> 0000-00-00T00:00:00.000Z

GPS:LOCATION?​

Returns the GPS position of the first configured GPS module.

Parameters​

NONE

Return​

FLOAT[] consisting of latitude, longitude and altitude above sea level.

Example​

< gps:location?
> 0.00000000, 0.00000000, 0

MODULES:CALL:FACTORY?​

Calling a (static) call-interace function from the factory (~"class") of a module

Parameters​

(comma-separated) list of the following arguments:

Opt.ParameterData typeValue rangeMeaning
FactorySTRING
FunctionSTRING
YESParameterSTRING[]see below

The parameters designated as "Parameters" are optional. Key-value pairs are specified in each case.

Return​

BASE64 encoded JSON object that represents the return of the call interface function

Example​

< modules:call:factory? factory,function
<BASE64 encoded JSON object>

< modules:call:factory? factory,function,Parameter 1 Key,Parameter 1 Value,Parameter 2 Key,Parameter 2 Value
<BASE64 encoded JSON object>

MODULES:CALL:FACTORY:JSON?​

Calling a (static) call-interace function from the factory (~"class") of a module

Parameters​

(comma-separated) list of the following arguments:

Opt.ParameterData typeValue rangeMeaning
FactorySTRING
FunctionSTRING
ParameterSTRING

A BASE64-encoded JSON object in the form of a STRING must be passed as a "parameter". This (normally) consists of key-value pairs of the function parameters. Hierarchical structures can be mapped.

Return​

BASE64 encoded JSON object that represents the return of the call interface function

Example​

< modules:call:factory:json? factory,function,<BASE64 encoded JSON object with parameters>
<BASE64 encoded JSON object>

MODULES:CALL:INSTANCE?​

Call a call-interace function from the instantiated module.

Parameters​

(comma-separated) list of the following arguments:

Opt.ParameterData typeValue rangeMeaning
Configuration typeSTRING"STAT", "DYN"Type of configuration that instantiates the module
Module nameSTRING
FunctionSTRING
YESParameterSTRING[]see below

The parameters designated as "Parameters" are optional. Key-value pairs are specified in each case.

Return​

BASE64 encoded JSON object that represents the return of the call interface function

Example​

< modules:call:instance? stat,instance,function
<BASE64 encoded JSON object>

< modules:call:instance? dyn,instance,function,Parameter 1 Key,Parameter 1 Value,Parameter 2 Key,Parameter 2 Value
<BASE64 encoded JSON object>

MODULES:CALL:INSTANCE:JSON?​

Call a call interface function from the instantiated module.

Parameters​

(comma-separated) list of the following arguments:

Opt.ParameterData typeValue rangeMeaning
Configuration typeSTRING"STAT", "DYN"Type of configuration that instantiates the module
FactorySTRING
FunctionSTRING
ParameterSTRING

A BASE64-encoded JSON object in the form of a STRING must be passed as a "parameter". This (normally) consists of key-value pairs of the function parameters. Hierarchical structures can be mapped.

Return​

BASE64 encoded JSON object that represents the return of the call interface function

Example​

< modules:call:instance:json? dyn,instance,function,<BASE64 encoded JSON object with parameters>
<BASE64 encoded JSON object>

MODULES:FACTORIES:CALLSCHEMA:GET?​

Query the call scheme of the module("instance")-related call interface functions of a module factory ("class")

Parameters​

Opt.ParameterData typeValue rangeMeaning
FactorySTRING

Return​

BASE64 encoded JSON schema

Example​

< modules:factories:callschema:get? factory
> <BASE64 encoded JSON object>

MODULES:FACTORIES:CONFIGSCHEMA:GET?​

Query the configuration schema of a module factory (~"class")

Parameters​

Opt.ParameterData typeValue rangeMeaning
FactorySTRING

Return​

BASE64 encoded JSON schema

Example​

< modules:factories:configschema:get? factory
> <BASE64 encoded JSON object>

MODULES:FACTORIES:COUNT?​

Query the number of all module factories (~"classes")

Parameters​

NONE

Return​

INT

Example​

< modules:factories:count?
> 42

MODULES:FACTORIES:DOC?​

Query the enclosed module documentation

Parameters​

Opt.ParameterData typeValue rangeMeaning
FactorySTRINGModule-Factory (~"Class")
YESTypeSTRING"base64", "text"Encoding of the returned documentation
YESLanguageSTRING"de", "en"Language version of the returned documentation

Return​

STRING or BASE64 Documentation

Example​

< modules:factories:doc? factory
<documentation>

MODULES:FACTORIES:DOC:CHANGELOG?​

Query the enclosed change logs of the modules

Parameters​

Opt.ParameterData typeValue rangeMeaning
FactorySTRINGModule-Factory (~"Class")
YESTypeSTRING"base64", "text"Encoding of the returned documentation

Return​

STRING or BASE64 Change Log

Example​

< modules:factories:doc:changelog? factory
> <ChangeLog>

MODULES:FACTORIES:GET?​

Query the description of all module factories (~"classes")

Parameters​

NONE

Return​

BASE64 encoded JSON array of JSON objects with the following keys

KeyMeaning
descriptionabstract description of the module
fileNameFile name of the loaded shared object in which the module is located
nameName of the module factory
versionversion

Example​

< modules:factories:get?
> <BASE64 encoded JSON array>

MODULES:FACTORIES:STATICCALLSCHEMA:GET?​

Query the call schema of the module-factory("classes")-related call interface functions of a module factory ("class")

Parameters​

Opt.ParameterData typeValue rangeMeaning
FactorySTRING

Return​

BASE64 encoded JSON schema

Example​

< modules:factories:staticcallschema:get? factory
> <BASE64 encoded JSON object>

MODULES:GET?​

Parameters​

NONE

Return​

BASE64 encoded JSON object that represents an assignment of all modules ("instances") to their respective module factories ("classes") in the form of a map.

Example​

< modules:get?
> <BASE64 encoded JSON object>

SYSTEM:CHANGELOG?​

Query the enclosed system change log.

Parameters​

Opt.ParameterData typeValue rangeMeaning
YESTypeSTRING"base64", "text"Encoding of the returned documentation

Return​

STRING or BASE64 System Change Log

Example​

< system:changelog?
> <ChangeLog>

SYSTEM:ERROR?​

Query the last system error

Parameters​

NONE

Return​

(comma-separated) list of INT,STRING consisting of error code (not equal to 0 in the event of an error) and an error description

Example​

< system:error?
> 0, "No Error!"

SYSTEM:RESTART​

Restart the smartCORE application. If the SCPI module is in the restarted configuration file, it is unloaded and the connection is disconnected.

Parameters​

Opt.ParameterData typeValue rangeMeaning
Type of restartSTRING"ALL", "DYN"

Return​

OK

Example​

< system:restart all
> OK

SYSTEM:START​

Start the stopped smartCORE application. If the SCPI module is in the restarted configuration file, the connection is terminated.

Parameters​

Opt.ParameterData typeValue rangeMeaning
Type of startSTRING"ALL", "DYN"

Return​

OK

Example​

< system:stop
> OK
[...]
< system:start all
> OK

SYSTEM:STATE?​

Query the smartCORE operating status.

Parameters​

NONE

Return​

STRING Description of the operating status. Possible values are "Running" (active measurement mode), "Ready" (configuration mode, measurement mode stopped) and, less frequently, "Error" (error occurred) or other operating states.

Example​

< system:state?
> Running

SYSTEM:STOP​

Stop the smartCORE application. The SCPI connection is NOT disconnected.

Parameters​

NONE

Return​

OK

Example​

< system:stop
> OK

SYSTEM:VERSION?​

Query the smartCORE version

Parameters​

NONE

Return​

STRING

Example​

< system:version?
> 42.0

SYSTEM:VERSION:MAJOR?​

Query the smartCORE major version

Parameters​

NONE

Return​

STRING

Example​

< system:version:major?
> 42

SYSTEM:VERSION:MINOR?​

Query the smartCORE Minor version

Parameters​

NONE

Return​

STRING

Example​

< system:version:minor?
> 0

TIMEOUT?​

Query of the maximum waiting time for an action/query that blocks the interface.

Parameters​

NONE

Return​

STRING

Example​

< timeout?
> 60000

TIMEOUT​

Set the maximum waiting time for an action/query that blocks the interface.

Parameters​

Opt.ParameterData typeValue rangeMeaning
TimeoutINT1 -Maximum waiting time

Return​

OK, ERR

Example​

< timeout 60000
> OK