Communicate with a GPIB Instrument

NI-488.2

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:

  1. If you have not already done so, scan for connected instruments.
  2. >  Start Measurement & Automation Explorer.
  3. In Measurement & Automation Explorer, expand the Devices and Interfaces directory by clicking on the + next to the folder.
  4. Select your GPIB interface.
    Measurement & Automation Explorer displays the connected instruments in the right window pane.
  5. 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.
  6. 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:

  1. In Measurement & Automation Explorer, select Tools»NI-488.2»Interactive Control from the menu.
  2. 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.