The Hydra Data Acquisition Unit (DAU) - Setting Up For Computer Controlled Measurements

Setting The Hydra For Computer Control

Communication Settings
GPIB Commands For A DC Voltage Measurement
Other Commands


Setting The Hydra For Computer Control

         Here is the Hydra DAU.  It has two data input terminals at the left on the front panel, and another twenty sets of input and output terminals that have been wired to a connector on the top of the unit.  It has an LED message panel on the right (the large black space), and measurements are displayed there normally - but not when you take a reading using a computer program.

Turn the Hydra on.  That's not a facetious statement.  Depress the green button at the lower right of the instrument's front pane.  And be sure it's plugged in.  The Hydra will go through a start-up sequence (green LEDs will flash on the front panel) and it will come up in the mode it was last in before being turned off.

The Hydra may come up in a monitor mode.  That means it takes repetitive measurements - which might be voltage, temperature, etc. on a particular channel - and it will start that operation.  If it comes up in monitor mode - and you will know that by it's efforts to take measurements repetitively - depress the white MON key in the lower right corner of the front control panel.  That toggles the Hydra out of the monitor mode.



Setting The Computer To Communicate With The Hydra

       If you want to use the Hydra from within a program - in C, Visual Basic, or any other programming environment - there are several items to take care of before the Hydra can communicate with the computer.  There are two things to address.

The Hydra must be set to communicate with the computer.  To set the Hydra, do the following:

Turn the Hydra on.
If it comes up in Monitor mode, turn the monitor mode off.
Select COMM by pressing Shift and List sequentially - not simultaneously!
Cycle through the communication settings (baud rate) to get IEEE.  Press Enter.
Next, you need to set the address to 3 by cycling through possible addresses using the arrow keys.  (We have arbitrarily chosen to set all of the Hydras in the department to an address of 3.)
Then press Enter.

The computer must be set to communicate with the Hydra.To set the computer, do the following.

Open the "computer" icon - the one that says "My Computer" out of the box.
Open the Control Panel.
Double click on the System icon.
Click the Device Manager tab.
Double click the National Instruments GPIB Interface.
Click the Properties tab.
Click the Device Templates tab.
Make sure the 3rd device down says Hydra, and has a Primary address of 3.  Rename it if necessary by right-clicking the mouse
Make sure no other device has a Primary address of 3.

        When you are all done, you have set the system so that the alias "Hydra" can be used for the Hydra DAU from within a C program or a Visual Basic program.  There is one last thing to take care of.
Be sure that the Hydra and the computer are connected using a standard GPIB cable.

GPIB Commands For A Single Voltage Measurement

        To use the Hydra from within a program  - C,Visual Basic, LabView, or any programming environment coming down the pike - you need to do the following.

Determine the IEEE-488 address for the device with the alias Hydra.  Normally, the value of that address is an integer a little over 32000.  Normally, with the NI system you will use an ibfind function that returns that  address - an integer.  The ibfind function will often take the alias "Hydra" - set in the name table in the section on Communication Settings above.

Clear the Hydra.  In C or Visual Basic, you need to pass the address to ibclr. Alternatively, you can write a *RST command using the ibwrt command.

Write a command to take a reading.  There's a lot of different commands. Use ibwrt to pass the command string to the instrument.

Read the results of the measurement from the instrument.  Use ibrd to read the
 measurement string to the computer.  You may need to convert the string to
 a float - whatever - if you want to do computations with the result.

        Those are the steps.  You have to go through those steps sequentially in any programming environment you use in order to take any measurement.  Many programming environments use the ib-functions (ibfind, ibclr, ibwrt, ibrd and many others), but different programming environments have different ways of getting access to those functions from within the program.

        If you are programming in C, for example, you will need the code for the ib-functions.  You will not get the source code for those functions, but you will have available the object code (so that you can link those functions to programs you write in C.  You will need to add the proper object file to your C or C++ project.  Similarly, in Visual Basic you will need a set of .BAS files that you will need to add to your Visual Basic project.



GPIB Commands For A Single Voltage Measurement

        In any environment, you should issue the following commands (using ibwrt) to take a single DC voltage measurement.

*RST
FUNC 0,VDC,AUTO
*TRG
LAST?,0
What these commands do is the following:
*RST - Resets the Hydra, and clears any previous measurements from the Hydra's memory.

FUNC 0,VDC,AUTO - Sets the Hydra to take a DC voltage measurement (VDC) on Channel 0 (the front panel terminals) and to autoscale (i.e. set the scale of the meter to an appropriate value.  A voltage of 2.5v will be measured on the 0-3v scale, for example.).

*TRG - Triggers a measurement as specified in the previous command.  This command is the one that actually causes a measurement to be taken.

LAST?,0 - Prepares the last measurement taken on Channel 0 so that it can be transmitted to the computer.

At this point the Hydra is holding a measurement, but it has not transmitted it to the computer.  The last step is to use ibrd to read the voltage measurement that has been prepared.  Calling ibrd will cause a string of characters - the DC voltage reading - to be transmitted to the computer.

        Having the characters for the voltage may not be helpful.  The characters for the reading can be stored in a string, but those characters or string must be converted to a numerical representation before any computations can be done using the measurement result.  (You might want to average measurements, for example.)  You will see that conversion in any programs you examine.



Other Commands For Other Measurements.
VDC Measure DC Volts-/-Autorange
VAC Measure AC Volts-/-Autorange
C Measure Temperature (oC)
F Measure Temperature (oF)
    NOTE:  With C and F you must specify the type of thermcouple (K, T, etc.).
OHMS Measure Resistance-/-Two wire method
HZ Measure Frequency

Links To Other Notes On The Hydra