Computers communicate with the P4120 - 4165 series generator by sending and
receiving commands over USB or RS232 interface. Command is sent and identified in the
form of ASCII character strings for users to easily control the generator and do
user-defined development. Operations that you can do with a computer and a generator
include: Set the generator and output waveforms from the generator.
Connection: Please connect the USB Device port at the rear panel of the generator with
the corresponding USB interface on the computer using an USB cable, or connect the
RS232 port at the rear panel of the generator with the corresponding RS232 interface on
the computer using an RS232 cable.
1.2. Command Syntax
The command systems of this series present a hierarchy structure (tree system) and each
command consists of a “Root” keyword and one or multiple sub-keywords. The keywords
are separated by ":" and are followed by the parameter settings available, "?" is added at
the end of the command string to indicate query and the command and parameter are
separated by "space".
For example,
:FUNCtion:SQUare:DTYCycle {<percent> }
:FUNCtion:SQUare:DTYCycle?
FUNCtion is the root keyword of the command, SQUare and DTYCycle are the
second-level and third-level keywords respectively, all the keywords are separated by “:”.
<percent> denotes the parameter that users can set, the default unit of the numerical
parameters are listed in Appendix
FUNCtion:SQUare:DTYCycle and parameter are separated by “space”. All the command
strings begin with ":" or "*" and have no terminator ("\n" or "\r \n" can be recognized as
terminator also). The commands can be sent continuously (have command execution
queue), the program will be executed in sequence. If the command is correct, "->\n" will
be returned; if wrong, "=?\n" will be returned. If the parameter is invalid or the command
Ⅰ
; “?” denotes query; the command
1
does not work, "NULL\n" will be returned.
After one of the complete commands, if the following command has the same first-level
keyword or the same first-level and second-level keywords (keywords have 3 levels most),
the same keywords in the following command can be omit, the command can be written
as the rest parts.
E.g.
:func:sine:freq 1000 //Complete command
:ampl 2 //Omit first-level func and second-level sine
:squ:offset 1 //Omit first-level func
1.3. Symbol Description
Following symbols are usually used to assist to explain the parameters contained in a
command.
a) Braces { }
The options enclosed in a { } are parameters available in the command. Only one
option could be selected every time, and all the options are separated by “|”. For
example, {ON|OFF} indicateds that ON or OFF can be selected.
b) Triangle Brackets < >
The parameter enclosed in < > must be replaced by an effective value.
For example,
:FUNCtion:SINE:FREQuency <value>
wherein, <value> must be a numerical value, such as:
:FUNCtion:SINE:FREQuency 1000
1.4. Programmed Parameter Type
The commands contain 5 kinds of parameters, different parameters have different setting
methods.
2
a) Boolean Parameters
The parameters could be “OFF” or “ON” (“0” or “1”), for example,
:CHANnel:CH1 {OFF|ON}
“OFF” denotes disabling the output of CH1. “On” denotes enabling the output of CH1.
b) Consecutive Integer Parameters
The parameters could be a consecutive integer, for example,
:FUNCtion:ARB:BUILtinwform <value>
<value> could be any integer between 0 and 25(including 0 and 25).
c) Consecutive Real Number Parameters
The parameters could be any value within the effective range and with the required
precision, for example,
FREQuency {<frequency>}
For sine wave, <frequency> could be any real number between 1uHz and 25MHz.
d) ASCII Character String
The parameters should be the combinations of ASCII characters, for example,
:AM:SOURce <modulation signal source>
<modulation signal source> is a character string defined inside.
1.5. Command Abbreviation
All the commands are case-insensitive, so you can use any kind of them. But if
abbreviation is used, all the capital letters specified in commands must be written
completely. For example,
FUNCtion:SQUare:AMPLitude? also can be:
FUNC:SQU:AMPL? or func:squ:ampl? or fUnC:sQu:AmPL?
3
1.6. Available Command for Different Model
Note: Not every model of this series has the same functions, as for example some
entry-level devices do not have any modulation modes. So all SCPI command for these
(not integrated) functions will not work and are invalid. For models without frequency
counter, all command for the counter are invalid.
4
1. *IDN
Syntax
*IDN?
Function
Query ID character string of instrument.
Explanations
The query returns 4 character segments separated by commas “,”:
manufacturer, model, serial number and the edition number.
Query/set the waveform function for current channel.
Explanations
This command work on the current selected channel by default. If you
want to set the other channel, you need switch channel first (refer to the
command of channel control, such as CHANnel CH2).
Query/set the frequency of output function for current channel.
Explanations
<frequency> is the frequency set by user, the default unit is Hz. NOISE does
not have frequency parameter. The query returns the frequency set in scientific
notation, such as: 1.000000E+04。