4. Programming ReferenceThe LabJack U12 CD installs high-level drivers (ljackuw.dll), an ActiveX interface to the high-level drivers (ljackuwx.ocx), and LabVIEW6 VIs which call all the DLL functions. The DLL andOCX are installed in the Windows System directory. If the installation program can determinethe LabVIEW6 directory, it copies the LabVIEW VIs into that directory (\vi.lib\addons\) so theyshow up on the function palette. Otherwise, the LabVIEW drivers are copied into the LabJackinstallation directory (c:\Program Files\LabJack)\drivers\labview, and can manually betransferred to the LabVIEW directory.There are 21 functions exported by the LabJack DLL., and matching functions in the OCX andLabVIEW VIs. There are two additional support functions in the OCX, required due to thelimitations of ActiveX. All functions are command/response except for AIBurst andAIStreamStart/Read/Clear.There are 2 parameters that are used by most functions:• errorcode – A LabJack specific numeric error code. 0 means no error and 2 means noLabJacks were found. Use the function “GetErrorString” to get a description of the error.• idnum – Functions with this input take either a local ID, serial number, or -1. A local IDor serial number will specify a specific LabJack, while –1 means the first found LabJack.Every LabJack has a local ID and serial number. The local ID is a value between 0 and255 that can be changed by the user. The serial number is a value between 256 and2,147,483,647 that is unique among all LabJacks and cannot be changed by the user.4.1 AISampleReads the voltages from 1,2, or 4 analog inputs. Also controls/reads the 4 IO ports. Executiontime for this function is 20 milliseconds or less.Declaration:long __cdecl 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 allowsthis 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 isperformed.• ledOn – If >0, the LabJack LED is turned on.• numChannels – Number of analog input channels to read (1,2, or 4).