Communicating with the Device
Communication with the test and measurement device is mostly done using setValue, query, and perform commands and functions. They provide basic SCPI communication to the device using a more readable and usable style than raw SCPI commands. In the case of setValue and query, they also simplify the use of channels and identifiers when the defaultChannel or defaultIdentifier is set.
In SenseTalk, you can call most of the functions as either commands or functions. If you call query or queryData as a command, the returned value is stored in the variable it.
SCPI Commands and Functions
Command Parameters
SetValue, query, queryData, and perform all take a string parameter that contains the SCPI command. You can either write the command name portion of this string as:
- A raw SCPI command conforming to SCPI syntax.
- An English-like form that is converted to SCPI when it is sent to the device.
Command Strings
All the SCPI command strings allow you to use spaces between the words of the command rather than colons :, for greater readability. For example, you can write the SCPI command to measure voltage as "Measure voltage" instead of "MEAS:VOLT". The capitalization doesn’t matter.
Special Phrases
Your commands can also include these special phrases, which can appear in any order within the command string:
-
on channel <channel>: Sets the channel for the command to<channel>. This overrides thedefaultChannelif one is set.Example:
"measure voltage on channel 3" -
for <identifier>: Sets the identifier for the command to<identifier>. This overrides thedefaultIdentifierif one is set.Example:
"power state for M1.DataOut1" -
to <value>: Provides a parameter value, which is used before, and in addition to, any parameters that are given outside of the command string.Example:
"frequency center to 50mHz" -
no overlap: Makes sure that the device completes the operation before the script proceeds. This overrides theAllowOverlappedCommandssetting on the device.Example:
"Radio ARB trigger external delay state No overlap" -
allow overlap: Allows the device to begin the operation, without necessarily completing it, before the script proceeds. This overrides theAllowOverlappedCommandssetting on the device.Example:
"memory data PRAM allow overlap"
You can only use special phrases with the following commands:
performqueryDatasetValuequery.
Examples:
setValue "output state for M1.DataOut1 to On" --> SCPI command generated: "OUTPUT:STATE 'M1.DataOut1', ON".
query "Measure Voltage on channel 2" --> SCPI command generated: "MEASURE:VOLTAGE? (@2)".
perform "initiate no overlap" --> SCPI command generated: "INITIATE;*OPC?".
Special phrases do not apply to ExecuteSCPI, which sends the command to the device exactly as given.