Download Compiled SCPI Functions
Transcript
Compiled SCPI Command Reference
INST_QUERY
cmd_string
Format
Specifiers
(continued)
The %f format indicates that a float is used as the numeric expression for
the [c_expr] parameter. For example,
%f
float numb1;
INST_QUERY (vm,"MEAS:RES? %f","%f",numb1,&result);
If a comma is present in the format specifier, the [c_expr] is a pointer to an
array of floats instead of a numeric expression. The comma operator is
immediately followed by a number indicating the size of the array. The
comma can be useful when you have a list of channels to query. For
example,
float list[5] ={101,102,103,104,105};
INST_QUERY(sw,"CLOSE? (@%,5f)","%,5d",list,&result);
NOTE: C-SCPI requires that the comma operator’s corresponding array
contain the complete channel list. In the C-SCPI command above, for
example, you cannot add another comma operator to specify more
channels to query.
The %s format indicates that a string expression without quotations is
used in [c_expr]. For example,
%s
char count[5] = "MAX";
.
INST_QUERY (vm,"SAMP:COUNT? %s","%d",count,&result);
%S
The %S format indicates a string expression with quotations is used for
[c_expr]. See INST_SEND for example.
%r
The %r format indicates an expression is used for [c_expr]. See
INST_SEND for example.
The %b format indicates that an array is used for [c_expr]. <width> is
either a number or an asterisk (*). The number indicates the
number of elements to be sent, and the * indicates that the number
is taken from the next parameter (for example, %1024b or %*b).
See INST_SEND for an example. [size] determines the size of each
element in the array. [size] can be one of the following:
%<width>
[size]b
%b
%lb
%wb
%zb
%Zb
104
pointer to an array of char (8 bits)
pointer to an array of long int (32 bit words)
pointer to an array of short (16 bit words)
pointer to an array of float (32 bit floating point numbers)
pointer to an array of double (64 bit floating point numbers)
Chapter 5