Communicate with a GPIB Instrument
To establish basic or advanced communication with your instruments, refer to the following sections.
For more information about instrument communication and a list of the commands that your instrument understands, refer to the documentation that came with your GPIB instrument. Most instruments respond to the *IDN? command by returning an identification string.
Basic Communication (Query/Write/Read)
To establish basic communication with your instrument, use the NI-488.2 Communicator, as follows:
- If you have not already done so, scan for connected instruments.
-
> Start Measurement & Automation Explorer. - In Measurement & Automation Explorer, expand the Devices and Interfaces directory by clicking on the + next to the folder.
- Select your GPIB interface.
Measurement & Automation Explorer displays the connected instruments in the right window pane. - Right-click on your GPIB instrument and select Communicate with Instrument from the drop-down menu that appears.
The NI-488.2 Communicator dialog box appears. - Type a command in the Send String field and do one of the following:
- To write a command to the instrument then read a response back, click on the Query button.
- To write a command to the instrument, click on the Write button.
- To read a response from the instrument, click on the Read button.
- To configure special requirements for end of string (EOS) modes for your device, click on the Configure EOS button.
To view sample C/C++ code that performs a simple query of a GPIB instrument, click on the Show Sample button.
Advanced Communication
For advanced interactive communication with GPIB instruments, use the Interactive Control utility, as follows:
- In Measurement & Automation Explorer, select Tools»NI-488.2»Interactive Control from the menu.
- At the command prompt, type NI-488.2 API calls to communicate interactively with your instrument. For example, you might use ibdev, ibclr, ibwrt, ibrd, and ibonl.
To view the help for Interactive Control, type help at the Interactive Control command prompt.