Getting Started with Interactive Control

NI-488.2

Getting Started with Interactive Control

To get started with Interactive Control, complete the following steps:

  1. Within Measurement & Automation Explorer, select Tools»NI-488.2»Interactive Control or click on the following button.
     Start Interactive Control.
    For help on any Interactive Control command, type help followed by the command. For example, type help ibdev or help devclear.
  2. Open either a board handle or device handle to use for further NI-488.2 calls. Use ibdev to open a device handle, ibfind to open a board handle, or the set 488.2 command to switch to a 488.2 prompt.
    The following example uses ibdev to open a device, assigns it to access board gpib0, chooses a primary address of 6 with no secondary address, sets a timeout of 10 seconds, enables the END message, and disables the EOS mode.
    
    :ibdev
       enter board index: 0
       enter primary address: 6
       enter secondary address: 0
       enter timeout: 13
       enter 'EOI on last byte' flag: 1
       enter end-of-string mode/byte: 0
    
    ud0:
    
    

    Note If you type a command and no parameters, Interactive Control prompts you for the necessary arguments. If you already know the required arguments, you can type them at the command prompt, as follows:
    :ibdev 0 6 0 13 1 0
    ud0:
    
    Note If you do not know the primary and secondary address of your GPIB instrument, right-click on your GPIB interface in Measurement & Automation Explorer and select Scan for Instruments. After Measurement & Automation Explorer scans your interface, it displays your instrument address in the right window pane.
  3. After you successfully complete ibdev, you have a ud prompt. The new prompt, ud0, represents a device-level handle that you can use for further NI-488.2 calls. To clear the device, use ibclr, as follows:
    
    ud0: ibclr
    [0100] (cmpl)
    
    
  4. To write data to the device, use ibwrt. Make sure that you refer to the instrument user manual that came with your GPIB instrument for recognized command messages.
    
    ud0: ibwrt
       enter string: "*IDN?"
    [0100] (cmpl)
    count: 5
    
    

    or, equivalently:
    
    ud0: ibwrt "*IDN?"
    [0100] (cmpl)
    count: 5
    
    
  5. To read data from your device, use ibrd. The data that is read from the instrument is displayed. For example, to read 29 bytes, enter the following:
    
    ud0: ibrd
       enter byte count: 29
    [0100] (cmpl)
    count: 29
    46 4C 55 4B 45 2C 20 34      FLUKE, 4
    35 2C 20 34 37 39 30 31      5, 47901
    37 33 2C 20 31 2E 36 20      73, 1.6 
    44 31 2E 30 0A               D.10.
    
    

    or, equivalently:
    
    ud0: ibrd 29
    [0100] (cmpl)
    count: 29
    46 4C 55 4B 45 2C 20 34      FLUKE, 4
    35 2C 20 34 37 39 30 31      5, 47901
    37 33 2C 20 31 2E 36 20      73, 1.6 
    44 31 2E 30 0A               D.10.
    
    
  6. When you finish communicating with the device, make sure you put it offline using the ibonl command, as follows:
    
    ud0: ibonl 0
    [0100] (cmpl)
    
    :
    
    

    The ibonl command properly closes the device handle and the ud0 prompt is no longer available.
  7. To exit Interactive control, type q.

Related Topics:

Auxiliary Functions in Interactive Control

Count Return in Interactive Control

Error Information in Interactive Control

Interactive Control Overview

Status Reporting in Interactive Control

Syntax Rules in Interactive Control.

Using Interactive Control.