12 examples of using the scpi commands, Examples of using the scpi commands -30, 12 e – AMETEK M130 User Manual
Page 80: Scpi

IEEE 488.2 and SCPI Command Operation
Sorensen Ethernet Option
3-30
M130/131 Programming Manual
3.12 E
XAMPLES OF
U
SING THE
SCPI
C
OMMANDS
The following examples demonstrate programming a power supply to control and to
readback the output using the SCPI commands. The maximum voltage and current output
is dependent on the particular model. The examples list only the SCPI commands; the
code required to send the commands is dependent on the type of language you are using
(e.g., C or BASIC) and GPIB or Ethernet hardware (e.g., National Instruments).
EXAMPLE: Program a unit with no load at the output to 5 VDC @ 1A, and verify the
output.
// Use SYST:ERR? after each command to verify no programming errors.
// turn on the unit.
*CLS
// clear the unit to its power-on default settings.
*RST
// reset the unit.
SOUR:CURR 1.0
// program output current to 1.0 A.
SOUR:CURR?
// confirm the output current setting (response: 1.0).
SOUR:VOLT 5.0
// program output voltage to 5.0 VDC.
SOUR:VOLT?
// confirm the output voltage setting (response: 5.0).
MEAS:CURR?
// measure the actual output current (response: ~ 0.0 with no
load on output).
MEAS:VOLT?
// measure the actual output voltage (response: ~ 5.0).
EXAMPLE: Program a unit with no load at the output to generate a GPIB service request
or Ethernet OVP Fault upon an overvoltage protection trip condition (must use GPIB or
Ethernet, not RS-232).
// Use SYST:ERR? after each command to verify no programming errors.
// Turn on the unit.
*CLS
// clear the unit to its power-on default settings.
*RST
// reset the unit.
SOUR:VOLT:PROT 4.0
// program the OVP trip point to 4.0 VDC.
SOUR:VOLT:PROT?
// confirm the OVP trip point setting (response: 4.0).
SOUR:CURR 1.0
// program output current to 1.0 A.
SOUR:VOLT 3.0
// program output voltage to 3.0 VDC.
STAT:PROT:ENABLE 8
// program the unit to report OVP trip.
STAT:PROT:ENABLE?
// confirm that OVP fault is enabled (response: 8).
STAT:PROT:EVENT?
// confirm no faults occurred (response: 0).
// confirm that the OVP LED is not active.
SOUR:VOLT 7.0
// program output voltage to 7.0 VDC - cause OVP trip!
// confirm that OVP LED is active.