AISample | LabJack
 

AISample

2 posts / 0 new
Last post
hnasr2001
hnasr2001's picture
AISample

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:

https://labjack.com/support/datasheets/u12/programming-reference/aisample

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

https://labjack.com/support/software/installers/u12/u12-mac-and-linux-lj...