You can program the Hydra in Visual Basic. The Visual Basic program here takes a single DC voltage measurement.
Links to other Hydra notes.
Introduction to the Hydra
Manual Operation
Setting The Hydra And The Computer To Communicate
General Computer Operation
Commands For A Single DC Voltage Measurement
Programming The Hydra in C (Console Applications)
Programming The Hydra In C++ (GUI/Visual Applications)
Programming The Hydra in LabView
Given a Hydra and a Wintel computer,
Be able to write Visual Basic programs to measure Temperature.
The Hydra should be turned on.
The Hydra and the computer should be set so that they can communcate.
If you have taken care of all of the above, then you need to do the following.
Establish a directory on your computer for your work.
Copy four files into that directory. Those files are available in E. J. Mastascusa's public space on the network. Here is the complete path:
Network Neighborhood
Entire Network
Academic_depts
mastascu
public
Labs
VB
Hydra
The files you need are:Once you have the files where you need them you are ready to use Visual Basic to take a measurement. Here are the steps.Lesson2.vbp
GPIB.bas
NIGlobal.bas
VBIB32.bas
Start Visual Basic on your computer.
Open Lesson2.vbp.
Examine the diagram by selecting Window - Show Diagram from the menu. You should have the diagram shown below.
Double click the button to view the code, shown below.
Private Sub Command1_Click()
Measure_Temperature
Temp.Text = Temperature
End SubThe problem responds to a button click, and calls a function Measure_Temperature. That function is stored in the file GPIB.bas. Add GPIB.bas to your project by selecting Project - Add Module from the menu.
Similarly, add VBIV32.bas and NIGLobal.bas to your project. You need those files so you can use the ib-functions. Click here for a short review of the ib-functions and commands to use.
GPIB.bas contains a number of functions for different instruments. Here is the one that is used in the button above.
Public Sub Measure_Temperature()
Dim CommandString$
Dim TemString$CommandString$ = "FUNC 1,TEMP,K" + Chr(&HA)
Call ibwrt(Hydra%, CommandString$) 'Channel 0, Auto Range
CommandString$ = "*TRG" + Chr(&HA)
Call ibwrt(Hydra%, CommandString$) 'Trigger voltage meas.
CommandString$ = "LAST? 1" + Chr(&HA)
Call ibwrt(Hydra%, CommandString$) 'Prompt for last measurement
TemString$ = Space$(17)
Call ibrd(Hydra%, TemString$) 'Hydra% is global
Temperature = Val(TemString$)End Sub
This function measures TEMPerature using a type K thermocouple connected to Channel 1 on the connector strip cemented to the top of the Hydra DAU (See below.). You cannot measure temperature using a thermocouple and the front panel connectors.
