User Manual
• 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). If
readCount is >0, numChannels should be 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.
• *scanRate – Scans acquired per second. A scan is a reading from every
channel (1,2, or 4). The sample rate (scanRate * numChannels) must be
between 200 and 1200.
• disableCal – If >0, voltages returned will be raw readings that are not corrected
using calibration constants.
• reserved1 – Reserved for future use. Send 0.
• readCount – If >0, the current count (CNT) is returned instead of the 2
nd
, 3
rd
, and
4
th
analog input channels. 2
nd
channel is bits 0-11. 3
rd
channel is bits 12-23. 4
th
channel is bits 24-31. This feature was added to the LabJack U12 starting with
firmware version 1.03, and this input has no effect with earlier firmware versions.
Outputs:
• *idnum – Returns the local ID or –1 if no LabJack is found.
• *scanRate – Returns the actual scan rate, which due to clock resolution is not
always exactly the same as the desired scan rate.
ActiveX Function Differences:
The “channels” and “gains” arrays are replaced with “channelsPacked” and “gainsPacked”. The
OCX has a function “FourPack” (4.23) which will convert 4 elements to a packed value. The
packed value is determined as: element[0] + (element[1] * 2^8) + (element[2] * 2^16) +
(element[3] * 2^24).
The parameters “demo”, “ledOn”, “disableCal”, “updateIO”, and “stateIOin”, are replaced by an
“optionBits” parameter. Call the OCX function “BuildOptionBits” (4.22) to determine this
parameter.
Declaration (ActiveX):
long AIStreamStartX ( long FAR* idnum,
long numChannels,
long channelsPacked,
long gainsPacked,
float FAR* scanRate,
long optionBits,
long readCount)
4.9 AIStreamRead
Waits for a specified number of scans to be available and reads them. AIStreamStart should be
called before this function and AIStreamClear should be called when finished with the stream.
Declaration:
long AIStreamRead ( long localID,
long numScans,










