beautypg.com

1 scpi programming, 2 scpi messages, 3 common commands/queries – KEPCO KLR Series Developers Guide User Manual

Page 77: 4 scpi subsystem command/query structure, 1 display subsystem, 2 trigger subsystem, Scpi messages -1, Common commands/queries -1, Scpi subsystem command/query structure -1, Display subsystem -1

background image

KLR-DEV 060713

6-1

SECTION 6 - PROGRAMMING THE KLR USING SCPI COMMANDS

6.1

SCPI PROGRAMMING

SCPI (Standard Commands for Programmable Instruments) is a programming language con-
forming to the protocols and standards established by IEEE 488.2 (reference document ANSI/
IEEE Std 488.2, IEEE Standard Codes, Formats, Protocols, and Common Commands
). SCPI com-
mands are sent to the KLR Power Supply as ASCII output strings within the selected program-
ming language (PASCAL, C, BASIC, etc.) in accordance with the manufacturer’s requirements
for the particular GPIB controller card used.

Different programming languages (e.g., BASIC, C, PASCAL, etc.) have different ways of repre-
senting data that is to be put on the control bus. It is up to the programmer to determine how to
output the character sequence required for the programming language used. If the IEEE 488.2
(GPIB) control bus is used, address information (GPIB address) must be included before the
command sequence. (See PAR.7.2.1 to establish the KLR Power Supply GPIB address.)

6.2

SCPI MESSAGES

There are two kinds of SCPI messages: program messages from controller to power supply,
and response messages from the power supply to the controller. Program messages consist of
one or more properly formatted commands/queries and instruct the power supply to perform an
action; the controller may send a program message at any time. Response messages consist of
formatted data; the data can contain information regarding operating parameters, power supply
state, status, or error conditions.

6.3

COMMON COMMANDS/QUERIES

Common commands and queries are defined by the IEEE 488.2 standard to perform overall
power supply functions (such as identification, status, or synchronization) unrelated to specific
power supply operation (such as setting voltage/current). Common commands and queries are
preceded by an asterisk (*) and are defined and explained in Appendix A. Refer also to syntax
considerations (PARs 6.5 through 6.7).

6.4

SCPI SUBSYSTEM COMMAND/QUERY STRUCTURE

Subsystem commands/queries are related to specific power supply functions (such as setting
output voltage, current limit, etc.) Figure 6-2 is a tree diagram illustrating the structure of SCPI
subsystem commands used in the KLR Power Supply with the “root” at the left side, and specific
commands forming the branches. The following paragraphs introduce the subsystems; subsys-
tem commands are defined and explained in Appendix B.

6.4.1

DISPLAY SUBSYSTEM

This subsystem returns the character string displayed in the Status display.

6.4.2

TRIGGER SUBSYSTEM

This subsystem enables the trigger system. When an internal trigger is enabled, the triggering
action will occur upon receipt of a GPIB , *TRG or TRIGger command. When an external
trigger is enabled, the triggering action occurs when a ground is applied to J2, pin 14. If a trigger
circuit is not enabled, all trigger commands are ignored. Abort sets the trigger subsystem to the
ready-to-arm state.