u3 Analog Channels | LabJack
 

u3 Analog Channels

3 posts / 0 new
Last post
john_day
john_day's picture
u3 Analog Channels

I am using default code provided by labjack in VB.  Channel 4 (as in 0,1,2,3,4) analog returns a code of not configured for analog.  I open control panel, first 7 channels set to analog, save, reboot labjack, and the same.  When I test with Control Panel, only AIN0,1,2,3 are shown as analog.  I need that 5th channel!

LabJack Support
labjack support's picture
You can configure which lines

You can configure which lines are analog with a call using LJ_ioPUT_ANALOG_ENABLE_PORT. Examples using analog inputs should demonstrate this. Here is a quick demonstration:

    'Configure FIO0 to FIO4 as analog, all else as digital.  That means we
    'will start from channel 0 and update all 16 flexible bits.  We will
    'pass a value of b0000000000011111 or d31.
    lngError = ePut(lngHandle, LJ_ioPUT_ANALOG_ENABLE_PORT, 0, 31, 16)
    If lngError <> 0 Then Err.Raise lngError

    'Perform analog input readings

If you need further code help let us know if you are using VBA/VB6 or VB .NET. The above is VBA/VB6 code.

If using LJControlPanel you can configure the power up defaults and set lines to analog or digital I/O. Settings take effect after a power cycle. Note in LJControlPanel's test panel it does not use the power up defaults and changes the current settings to FIO0-3 as analog and the rest digital I/O.

john_day
john_day's picture
Got it!  Changed binary to

Got it!  Changed binary to 11111, worked like a charm.