
long
numChannels,
long
*channels,
long
*gains,
float
*scanRate,
long
disableCal,
long
reserved1,
long
reserved2
)
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.
•
*stateIOin –
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.
•
*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.
•
reserved2 –
Reserved for future use. Send 0.
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,