hprologix

This help was written for HPKit v0.2.1

hprologix is a simple CLI tool to configure the Prologix GPIB-USB Controller, to read the current settings and to send a signal. It is in some way inspired to John Miles GPIB configurator, and offers more or less the same functions.

Once installed, you can run hprologix from a terminal, simply writing:

 $ hprologix 

If you just execute it, this tool will set the adapter to default values specified in its source code.

Options

The available options for the command are:

  • -d | –device=DEVICE_NAME: This option sets which serial interface will hprologix communicate with; by default it is set to ‘/dev/ttyUSB0’ ;
  • -g | –get-config: This option tells hprologix to read the current settings and print them out to stdout;
  • -m | –mode=MODE: This options sets the adapter’s mode, MODE can be 0 for device mode, 1 for controller mode;
  • -r | –address=PAD,[SAD]: This option sets the adapter’s address, PAD is the primary address and, for the Prologix adapter, is between 0 and 30, SAD is the secondary address, which is between 96 and 126, and isn’t necessary;
  • -a | –autoread=BOOL: This option tells the adapter whether to read automatically the instrument answer after sending a command. It can be 0 (enabled) or 1 (disabled);
  • -e | –eoi=BOOL: This option tells the adapter whether to assert a EOI signal with the last character of any command sent over GPIB port. It can be 0 (enabled) or 1 (disabled);
  • -t | –eot=CHAR: If CHAR is -1 this option tells the adapter not to send a EOT character to USB output whenever EOI is detected while reading a character from the GPIB port; if it is a number between 0 and 255, it tells the adapter to enable the sending of EOT, and that the EOT character is the CHAR character in the ASCII table;
  • -s | –eos=EOS: sets the GPIB termination characters, which are appended to the data received from USB before being sent to the instrument; EOS possible values are: 0 for CR+LF, 1 for CR, 2 for LF, 3 for NONE;
  • -n | –signal=SIG: sends to the adapter the signal SIG; the available signals are:
    • IFC: that asserts the GPIB IFC signal for 150 microseconds;
    • CLR: that sends the SDC (Selected Device Clear) to the currently addressed instrument;
    • LOC: that enables front panel operations of the currently addressed instrument;
    • SRQ: that returns the current state of the SRQ signal: 0 for ‘not asserted’, 1 for ‘asserted’
    • SPOLL: that performs a serial poll of the currently addressed instrument;
    • RST: that performs a controller reset (it takes about 5 seconds);
  • -h | –help: shows the help;
  • -v | –version: shows the version and license information;

Examples

Here we list some examples that may be useful:

Setting the adapter to the default values

 $ hprologix
Configuring the Prologix adapter with default values
$ 

Getting the current configuration

 $ hprologix -g
Mode: Controller
Address: 20 (PAD)
EOI: Disabled
EOT: Disabled
EOS: CR+LF
$ 

Resetting the controller

 $ hprologix -n RST
Sending signal RST
$ 

Apply some settings

 $ ./hprologix --mode=1 --address=20,100 \
> --autoread=1 --eoi=0 --eot=32 --eos=0
$ 

Tells the adapter to go on controller mode, to communicate on address 20, secondary address 100, to read immediately the instrument’s answer after sending a command, to disable the EOI assertion, to set the EOT character to 32 (space) and to append CR+LF to data before sending it to the instrument.

Links

Reply