- Home / EEZ Studio / Create an instrument ext. / EEZ project items /
- EEZ project – Subsystems
EEZ project – Subsystems
The Subsystems section is used to define SCPI commands (organized into subsystems), searchable help section and SCPI commands and queries syntax used by ESW to assemble a valid SCPI command ready for execution. This chapter is organized in the following sections:
- Adding SCPI commands and queries from HTML help file
- Adding SCPI commands and queries manually
- Parameters types and enumerations
Adding SCPI commands and queries from HTML help file
SCPI commands (and queries) that can be used with instrument can be added in two ways: from specially formatted HTML help files or manually.
The first and preferred method require more preparations (i.e. creating HTML files) but offers more structured SCPI subsystems and simplify keeping track of changes. SCPI subsystems section has Refresh with content from HTML help folder option (Fig. 1.) that will compare HTML files stored in SCPI documentation folder (see Settings) with SCPI subsystems that already exists in the project.
This method presume that each HTML file include only one SCPI subsystems. Therefore one can create as many HTML files as instrument has SCPI subsystems. That give us freedom to add support for SCPI subsystems one by one or all at once.
For example, we can start with only one HTML file that has to be located in SCPI documentation folder (Fig. 2).
The Refresh action in this example detected and reported 16 new SCPI commands as shown in Fig. 3. where we can decide what to do with reported commands: we can select one or more of them to include them into project or reject this action if reported commands and their number is not as we expected (i.e. not in accordance with created HTML files).
The result of adding newly detected SCPI commands and queries is shown in Fig. 4. The subsystem name as defined in HTML file is listed in Subsystems section and commands and queries in Commands section.
The selected SCPI command or query details are displayed on the right as follows:
Parameter |
Explanation |
Name |
SCPI command or query name (has to be defined in accordance with SCPI specification). |
Description |
SCPI command or query name description. |
Help link |
Hyperlink to description related to SCPI command or query that could be within HTML help file (added automatically and displayed down below) or somewhere else. |
Used in |
Define build configurations that will include this SCPI command or query. All build configurations option is selected by default. |
Parameters |
List of mandatory and optional SCPI command parameters |
Response |
Expected SCPI query response |
If HTML help file is structured properly as e.g. for the Generic SCPI instrument that is available on the GitHub repository, the ESP will also include command parameters into the project. Still, the SCPI query will require some attention, since its response type cannot be directly parsed. Therefore ESP will report some errors (seven in our case as shown in Fig. 4.).
Adding SCPI commands and queries manually
The second method for adding SCPI commands and queries is by adding it manually. A new SCPI subsystem can be created by choosing Add item option (+ sign) from Subsystems section as shown in Fig. 5.
A new command can be added into selected subsystem using Add item option (+ sign) from Commands section (Fig. 6.).
Properties of the newly added command is displayed on the right side and can be modified as shown on Fig. 7.
In our example command will require three parameters, that can be added sequentially one by one using the Add button. The third parameter is marked as optional (Fig. 8).
The question mark (?) at the end of the name make difference between SCPI query and command. Therefore if we’d like to add a SCPI query instead of command, the name has to end with question mark. For example, APPLy? is a query form of the APPLy command. When SCPI query is defined a new section will appear as shown on Fig. 9.
Finally, a word of caution when project contains SCPI commands and queries that were manually added. Every time when Refresh with content from HTML help folder option (Fig. 1.) is selected it will report that “deleted” commands are found. Such commands does not exists in any of HTML help files, hence they are proclaimed as deleted (the ESP presume that they were once existed and imported into project but afterward removed from the latest HTML files version). In this case, commands listed under Deleted tab can be simply ignored (not checked).
Parameters types and enumerations
The SCPI parameters could be of one or more types. The SCPI command parameter type can be specified using the selection shown on Fig. 11.
Parameter |
Explanation |
Numeric |
Numeric values that can be Signed integer (NR1), Decimal, i.e. float with no exponent (NR2) or Real, i.e. float always with exponent (NR3). |
Boolean |
Logical “True” (1) or “false” (0). |
String |
One or more characters. |
Data block |
Block of data that is started with # symbol used to transfer huge amount of data, e.g. screenshot capture, measured data from the internal memory buffer, program or profile file upload/download, etc. |
Channel list |
List of one or more instrument “channels” that started with @ symbol, e.g. (@1,3) specify first and third instrument channels/modules . |
Discrete |
Enumerations of one or more values (see below). |
Any |
Denote usage of any of the above mentioned parameter types. |
Supported SCPI query parameter types are similar to command parameter types as shown in Fig. 12. With few exceptions listed in the following table.
Parameter |
Explanation |
Arbitrary ascii |
Similar to String type but without quotation marks, e.g. as it is the case of response to *IDN? Query. |
List of quoted string |
List of two or more quoted strings separated by comma. |
Non standard data block |
Special case of Data block that doesn’t follow SCPI standard that specify usage of # symbol at the beginning (e.g. require to properly handle data block generated by some Siglent instruments). |
Special attention require Discrete parameter types. Many SCPI commands and queries works with predefined values that can be used to address instrument resources (e.g. channels, modules), pre-installed functionalities or that which has to be additionally obtained and activated, etc. For example, discrete values can be channel names like CH1, CH2, CH3 or wave shapes like SINusoid, SQUare, RAMP, PULSe, NOISe, etc. and they don’t necessarily have numeric equivalents. Therefore we cannot use Numeric type, and from other side String type could offer too much freedom and in that case IEXT cannot provide “hints” i.e. list of values that instrument only can accept with accompanied command.
List of allowed (discrete) values can be defined using the enumerations (Fig. 13). Project can contain unlimited number of enumerations with possibility that one or more discrete values is repeated in two or more enumerations.
A new enumeration can be created by choosing the Add item option (+ sign) when enumeration can be specified (Fig. 14.). Enumeration data (members) can be added using the Add button and entering the name as shown in Fig. 15. and Fig. 16. Please note that Member’s Value field is not used and can be left empty.
Once defined, the enumeration will become available in the list of Discrete types can be used with multiple SCPI commands and queried. For example, we can use it to specify allowed values for channel parameter of previously created APPLy? query or APPLy command (Fig. 17).
When IEXT is successfully built and installed we can see how above mentioned channel parameter of Discrete type looks in SCPI command selection (Fig. 18). It will offer a list of discrete values that can be used to accurately select one of the existing channel.