beautypg.com

4 scpi command completion – B&K Precision MDL Series - Programming Manual User Manual

Page 25

background image

25

that contains four single item query commands:

0; 1; 1; 0

Response Message Terminator (RMT)

Each response is terminated with an LF (line feed) and EOI (end or identify). The following example

shows how a multiple response message is terminated:

0; 1; 1; 0;

Message Exchange Protocol

Two rules summarize the message exchange protocol:

Rule 1. You must always tell the electronic load what to send to the computer.

The following two steps must always be performed to send information from the

computer to the instrument:

1)

Send the appropriate query command(s) in a program message.

2)

Address the electronic load to talk.

Rule 2. The complete response message must be received by the computer before another

program message can be sent to the electronic load.

2.4 SCPI Command Completion

SCPI commands sent to the electronic load are processed either sequentially or in parallel. Sequential

commands finish execution before a subsequent command begins. Parallel commands allow other

commands to begin executing while the parallel command is still executing. Commands that affect

trigger actions are among the parallel commands.

The *WAI, *OPC, and *OPC? common commands provide different ways of indicating when all

transmitted commands, including any parallel ones, have completed their operations. The syntax and

parameters for these commands are described in Chapter 4. Some practical considerations for using

these commands are as follows:

*WAI This prevents the electronic load from processing subsequent commands until all pending

operations are completed.

*OPC? This places a 1 in the Output Queue when all pending operations have completed. Since it

requires your program to read the returned value before executing the next program

statement, *OPC? can be used to cause the controller to wait for commands to complete

before proceeding with its program.