Setting range with eAIN function | LabJack
 

Setting range with eAIN function

4 posts / 0 new
Last post
Gyuji
Gyuji's picture
Setting range with eAIN function

I'm still new to Labview but I thought I was muddling my way through half decently until I hit a bit of a roadblock.  I'm trying to incorporate the eAIN function into a simple oscilloscope design and I'm confused on how to set the range.  The description of eAIN in section 4.2.17 says to "pass a range constant".  The linked section 4.3.3 with more info lists the range constants (LJ_rgBIP10V, LJ_rgBIP1V, etc).  But the eAIN vi is looking for an integer as the range value.  What am I missing here?

LabJack Support
labjack support's picture
Most languages have a way to

Most languages have a way to import the constants. The "U6 Single AIN Example.vi" uses a drop down box. You can also look up the constant in LabJackUD.h found in your installation folder (something like "C:\Program Files (x86)\LabJack\Drivers"). 

Gyuji
Gyuji's picture
Ahhh thank you!  I found the

Ahhh thank you!  I found the values in the .h file so I'll just use a radio box to feed them to eAIN.

LabJack Support
labjack support's picture
The recommended way to do

The recommended way to do this is to use the string constants, found in Section 4.3:

https://labjack.com/support/datasheets/u6/high-level-driver/example-pseu...

... and then use the StringToConstant function to convert these to their numeric constant value.  You will see this demonstrated in many examples including "U6 eAIN Example.vi".

https://labjack.com/support/datasheets/u6/high-level-driver/function-ref...