Lakeshore Learning Materials 642 User Manual

Page 66

Advertising
background image

Lake Shore Model 642 Electromagnet Power Supply User’s Manual

5-14

Computer Interface Operation

5.1.4.4.6

Using Operation Complete (*OPC) and Operation Complete Query (*OPC?)

The Operation Complete (*OPC) and Operation Complete Query (*OPC?) are both used to indicate when pending
device operations complete. However, the commands operate with two distinct methods.

The *OPC command is used in conjunction with bit 0 (OPC) of the Standard Event Status Register. If *OPC is sent as
the last command in a command sequence, bit 0 will be set when the instrument completes the operation that was
initiated by the command sequence. Additional commands may be sent between the instrument and the bus controller
while waiting for the initial pending operation to complete. A typical use of this function would be to enable the OPC bit
to generate an SRQ and include the *OPC command when programming the instrument. The bus controller could then
be instructed to look for an SRQ allowing additional communication with the instrument while the initial process
executes.

The *OPC? query has no interaction with bit 0 (OPC) of the Standard Event Status Register. If the *OPC? query is sent
at the end of a command sequence, the bus will be held until the instrument completes the operation that was initiated by
the command sequence. Additional commands (except *RST) should not be sent until the operation is complete as erratic
operation will occur. Once the sequence is complete a 1 will be placed in the output buffer. This function is typically
used to signal a completed operation without monitoring the SRQ. It is also used when it is important to prevent any
additional communication on the bus during a pending operation.

5.1.5

IEEE-488 Interface Example Programs

A Visual Basic program is included to illustrate the IEEE-488 communication functions of the instrument. Instructions
for setting up the IEEE-488 Board is included in Section 5.1.5.1. Refer to Section 5.1.5.2 for instructions on how to setup
the program. The Visual Basic code is provided in Table 5-5. A description of program operation is provided in
Section 5.1.5.3. While the hardware and software required to produce and implement these programs not included with
the instrument, the concepts illustrated apply to most applications.

5.1.5.1

IEEE-488 Interface Board Installation for Visual Basic Program

This procedure works for Plug and Play GPIB Hardware and Software for Windows 98/95. This example uses the
AT-GPIB/TNT GPIB card.

1. Install the GPIB Plug and Play Software and Hardware using National Instruments instructions.
2. Verify that the following files have been installed to the Windows System folder:

a. gpib-32.dll
b. gpib.dll
c. gpib32ft.dll
Files b and c support any 16-bit Windows GPIB applications being used.

3. Locate the following files and make note of their location. These files will be used during the development process

of a Visual Basic program.
a. Niglobal.bas
b. Vbib-32.bas

NOTE: If the files in Steps 2 and 3 are not installed on your computer, they may be copied from your National

Instruments setup disks or they may be downloaded from www.ni.com.

4. Configure the GPIB by selecting the System icon in the Windows Control Panel located under Settings on the Start

Menu. Configure the GPIB Settings as shown in Figure 5-7. Configure the DEV12 Device Template as shown in
Figure 5-8. Be sure to check the Readdress box.

Advertising