resolution and voltage range


Graphic

Recommended Posts

hi, i'm trying to change the input voltage range of an AIN input

i tried to do it the same way as azeotech had in his "thermocouples and ue9" sample. but it keeps giving me an error, i'm Using an UE9

error

D0004_1005 Labjack U12; invalid parameter specified: voltage_range line 1. uncaugt error in sequence voltage_range

sequence

Device.LabJack.AddRequest(0,"LJ_ioPUT_AIN_RANGE",Var.Channel_Number,Var.Voltage_Range,0,0)
Device.LabJack.GoOne(0)

same goes for the resolution, same error

sequence

Device.LabJack.AddRequest(0,"LJ_ioPUT_CONFIG","LJ_chAIN_RESOLUTION",Var.Resolution,0,0)
Device.LabJack.GoOne(0)

also could somebody break up the line for me so i can understand what it all means

TIA

Link to comment
Share on other sites

The problem is that your variables are initialized to invalid values for the call.

The functions follow the functions described in the LabJack UD manual almost exactly, except that strings are provided instead of the declared constants (i.e. "LJ_ioPUT_AIN_RANGE" instead of just LJ_ioPUT_AIN_RANGE in other languages).

Device.LabJack.AddRequest(0,"LJ_ioPUT_AIN_RANGE",Var.Channel_Number,Var.Voltage_Range,0,0)

In general, the first parameter (0) is the device number, or 0 for first found.

The second parameter is a particular command, in this case setting the Analog range.

The third parameter varies depending on the command. In this case it is the channel number to set the range of.

The forth parameter also varies, in this case it is the range value to set to. You have to look up the range in the UD header file.

The other parameters are mostly not used except for certain rather special commands.

With the latest DAQFactory driver, you should be able to specify range and resolution using the device configuration among many other parameters, and avoid programming altogether. If you are using DF-Express, go to www.daqexpress.com to update to the latest. Simply install that over top of your existing installation. You must have Express already installed for the updater to work. If you are using a regular version of DAQFactory, go to www.azeotech.com/dfbeta.php and get the latest beta of 5.30 which includes the latest DAQFactory LabJack driver.

Link to comment
Share on other sites

wel i update daqfactory and as you said i could change the resolution and voltage range without programming. but now i have a different problem

first i had a value from a temperature sensor which didn't quite match the tempeature in the room. so i made a variable value add a value to it so that i could calibrate the displayed value. but now it doesn't work anymore. everytime i try to add a number it gives an error or if i add a variable it stops displaying the value.

do you know how this is possible or some way i could make somehing like that

TIA

Link to comment
Share on other sites

Depends on how you have it wired. It should read 0 when pulled to ground, and 1 when at 3.3 or 5V. Note that with an open switch, the input technically is floating and could read either 0 or 1 (or any valid value for analogs). You'll need to put a pull up or pull down resistor, or use a double pole switch to avoid the float. The digital ins may already have the pull up. I'll let the LabJack guys address that.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.