AISample | LabJack
LabJack is closed November 26 and 27 for the Thanksgiving holiday.


2 posts / 0 new
Last post
hnasr2001's picture

I have a simple code using AISample function and I want to know if someone can have a look to see what the problem is?

I am not getting any meaningful value out of this code.

Any help would be appreciated.

File Attachment: 
LabJack Support
LabJack Support's picture
The channels, gains and

The channels, gains and voltages parameters require arrays, and should be the size of at least numChannels. You are trying to read 4 channels, but are only passing a variable (non-array) by reference for each of these parameters which is incorrect. Make these parameters an array of size 4, and configure channels and gains appropriately. Then display the voltages array elements after the AISample call.

Refer to the AISample documentation:

Refer to the analog.c example from this download for example usage: