EasyManua.ls Logo

LabJack U12 - 4 - Programming Reference; 4.1 - EAnalogin

LabJack U12
61 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Figure 3-16. LJSHTmulti
Figure 3-16 shows the LJSHTmulti window:
Enable Line: Choose the LabJack U12 output used to control the enable line on each EI-1050 probe.
Force Software Communication: Forces software based SHT1X communication, even if the LabJack U12 firmware is
V1.10 or higher.
Enable Delay: Adds a delay between each reading for testing purposes.
4 - Programming Reference
The LabJack U12 CD installs high-level drivers (ljackuw.dll), an ActiveX interface to the high-level drivers (ljackuwx.ocx), and
LabVIEW6 (or higher) VIs which call all the DLL functions. The DLL and OCX are installed in the Windows System directory. If the
installation program can determine the LabVIEW directory, it copies the LabVIEW VIs into that directory (\vi.lib\addons\) so they
show up on the function palette. Otherwise, the LabVIEW drivers are copied into the LabJack installation directory (c:\Program
Files\LabJack)\drivers\labview, and can manually be transferred to the LabVIEW directory. LabVIEW5 VIs are also installed and
can be found in the \LabJack\examples directory.
There are 38 functions exported by the LabJack DLL, and matching functions in the OCX and LabVIEW VIs. There are two
additional support functions in the OCX, provided due to the limitations of ActiveX. All functions are command/response except for
AIBurst and AIStreamStart/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 no LabJacks were found. Use the
functionGetErrorString” to get a description of the error, or see the list in Section 4.24 of this document.
idnum – Functions with this input take either a local ID, serial number, or -1. A local ID or 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 and 255 that can be changed by the user. The serial number is a value between 256 and 2,147,483,647 that is
unique among all LabJacks and cannot be changed by the user. When using multiple U12s, each should be assigned a
unique local ID.
To maintain compatibility with as many languages as possible, the every attempt has been made to keep the parameter types very
basic. The declarations that follow, are written in C. If there are any differences in the ActiveX version of a function, they are
described.
When a parameter name is preceded by a “*”, it means that it is a pointer. In most cases, this means that the parameter is an input
and/or output, whereas a non-pointer parameter is input only. In some cases a pointer points to an array of values rather than a
single value, and this will be noted in the parameter description.
Some of the digital I/O parameters contain the information for each bit of I/O in one value, where each bit of I/O corresponds to the
same bit in the parameter (i.e. the direction of D0 is set in bit 0 of parameter trisD). For instance, in the function DigitalIO, the
parameter *trisD is a pointer to a single memory location that sets/reads the direction of each of the 16 D lines:
if *trisD points to 0, all D lines are input,
if *trisD points to 1 (2
0
), D0 is output, D1-D15 are input,
if *trisD points to 5 (2
0
+ 2
2
), D0 and D2 are output, all other D lines are input,
if *trisD points to 65535 (2
0
++ 2
15
), D0-D15 are output.
The range of the value pointed to by *trisD is 0 to 65535. When calling DigitalIO, if updateDigital is >1, the D lines will be set to
input or output based on the value pointed to by *trisD. When DigitalIO returns, the value pointed to by *trisD will have been set to
reflect the status of the direction register in the LabJack U12.
4.1 - EAnalogIn
Easy function. This is a simplified version of AISample. Reads the voltage from 1 analog input. Calling this function turns/leaves the
status LED on.
Execution time for this function is 20 milliseconds or less (typically 16 milliseconds in Windows).
Declaration:
long EAnalogIn ( long *idnum,
long demo,
long channel,
long gain,
17

Other manuals for LabJack U12