User Manual

state – If >0, the line is set, otherwise the line is cleared.
Outputs:
*idnum – Returns the local ID or –1 if no LabJack is found.
4.6 AISample
Reads the voltages from 1,2, or 4 analog inputs. Also controls/reads the 4 IO ports. Execution
time for this function is 20 milliseconds or less.
Declaration:
long AISample ( long *idnum,
long demo,
long *stateIO,
long updateIO,
long ledOn,
long numChannels,
long *channels,
long *gains,
long disableCal,
long *overVoltage,
float *voltages )
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
*idnum – Local ID, serial number, or -1 for first found.
demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows
this function to be called without a LabJack.
*stateIO – Output states for IO0-IO3.
updateIO – If >0, state values will be written. Otherwise, just a read is
performed.
ledOn – If >0, the LabJack LED is turned on.
numChannels – Number of analog input channels to read (1,2, or 4).
*channels – Pointer to an array of channel commands with at least
numChannels elements. Each channel command is 0-7 for single-ended, or 8-11
for differential.
*gains – Pointer to an array of gain commands with at least numChannels
elements. Gain commands are 0=1, 1=2, …, 7=20. This amplification is only
available for differential channels.
disableCal – If >0, voltages returned will be raw readings that are not corrected
using calibration constants.
*voltages – Pointer to an array where voltage readings are returned. Send a 4-
element array of zeros.
Outputs:
*idnum – Returns the local ID or –1 if no LabJack is found.
*stateIO – Returns input states of IO0-IO3.
*overVoltage – If >0, an overvoltage has been detected on one of the selected
analog inputs.
*voltages – Pointer to an array where numChannels voltage readings are
returned.
ActiveX Function Differences: