Linux-GPIB 4.3.7 Documentation
Prev |  | Next

# ibterm

## Name

ibterm -- Interactive GPIB terminal

## Synopsis

ibterm {-d `primary_address`} [-m `minor`] [-s `secondary_address`] [-i `eoi`] [-e `eos`] [-r `reos`] [-b `bin`] [-x `xeos`] [-t `timeout`] [-p `prompt`] [-f `history_file`] [-N] [-X] [-h]

## Description

An interactive terminal program for sending commands to a device over an IEEE-488 general purpose instrument bus and printing the responses.

## Options

`-d` `address`

  Sets the device's primary address (pad). The `address` must be between `0` and `30`.

`-m` `number`

  Specify the minor number of the device file this interface board will use. A `number` of `0` corresponds to `/dev/gpib0`, `1` is `/dev/gpib1`, etc. Defaults to `0`.

`-s` `address`

  Sets the device's secondary address (sad). The `address` must be `0` (disabled) or between `96` and `126` (0x60 and 0x7e hexadecimal). Defaults to `0`.

`-i` `0|1`

  Assert EIO with last byte sent. Defaults to `1` (true).

`-e` `code`

  ASCII code of end-of-string (eos) character. The `code` must be between `0` and `255`. Defaults to `0` (no code).

`-r` `0|1`

  Terminate read on eos character (reos) flag. Defaults to `0` (false).

`-b` `0|1`

  Binary eos character match mode (bin) flag. Defaults to `0` (false).

`-x` `0|1`

  Assert EOI when transmitting eos (xeos) flag. Defaults to `0` (false).

`-t` `timeout`

  Sets the IO timeout for the device. The `timeout` must be a value from the below table. The default value is `10`, corresponding to 300 milliseconds.

  `timeout` | Length
  --- | ---
  `0` | Never timeout
  `1` | 10 microseconds
  `2` | 30 microseconds
  `3` | 100 microseconds
  `4` | 300 microseconds
  `5` | 1 millisecond
  `6` | 3 milliseconds
  `7` | 10 milliseconds
  `8` | 30 milliseconds
  `9` | 100 milliseconds
  `10` | 300 milliseconds
  `11` | 1 second
  `12` | 3 seconds
  `13` | 10 seconds
  `14` | 30 seconds
  `15` | 100 seconds
  `16` | 300 seconds
  `17` | 1000 seconds

`-p` `string`

  Sets the prompt. Defaults to "`ibterm>`"

`-u` `string`

  Send Untalk/Unlisten after each read and write

`-f` `file`

  Command history file. Defaults to "`.ibterm_hist_<`primary_address`>`"

`-N`

  No automatic read on device, enter return at prompt to read.

`-X`

  Force hexadecimal output.

`-h`

  Print help and exit.

## Notes

To quit the program enter the EOF character (Ctrl-D) at the prompt.

For interactivity, `timeout` should not be greater than `13` i.e. 10 secs.

A device read can always be triggered by hitting enter at the prompt. Interrupting the program while reading from the device may cause hangs.

### Implementation details

The program is implemented as follows:

    loop:
    	Print prompt to stdout
    	Read a line of text from stdin
    	Write the text (if any) to the device at pad
    	If -N is not set, or no text was entered:
            Attempt to read response from the device
            If no response is received before timeout:
            go to loop
            else:
            print the response on stdout
    	Go back to loop.

## See also

See the readline(3) man page for editing input and searching history.

Prev | Home | Next
GPIB utility programme | Up | Linux-GPIB Reference