EasyManua.ls Logo

LabJack U12 - 4.3 - ECount; 4.4 - EDigitalln

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...
Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0]
>>> d.eAnalogOut(2, 2)
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x66, 0x66]
Received: [0x0, 0x0, 0x0, 0x50, 0xbb, 0x10, 0x0, 0xef]
{'idnum': 12}
4.3 - ECount
Easy function. This is a simplified version of Counter. Reads & resets the counter (CNT). Calling this function disables STB (which
is the default anyway).
Execution time for this function is 20 milliseconds or less (typically 16 milliseconds in Windows).
Declaration:
long ECount ( long *idnum,
long demo,
long resetCounter,
double *count,
double *ms )
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
*idnum – Local ID, serial number, or -1 for first found.
demoSend 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack.
resetCounter If >0, the counter is reset to zero after being read.
Outputs:
*idnum – Returns the local ID or 1 if no LabJack is found.
*count Current count, before reset.
*ms – Value of Window’s millisecond timer at the time of the counter read (within a few ms). Note that the millisecond timer
rolls over about every 50 days. In general, the millisecond timer starts counting from zero whenever the computer reboots.
LabJackPython Example
>>> import u12
>>> d = u12.U12()
open called
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0]
Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0]
>>> d.eCount()
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0x0, 0x0]
Received: [0x52, 0x0, 0x0, 0x50, 0xbb, 0x10, 0x0, 0xef]
{'count': 3138388207, 'idnum': 12, 'ms': 1273175001372.4438}
4.4 - EDigitalIn
Easy function. This is a simplified version of DigitalIO that reads the state of one digital input. Also configures the requested pin to
input and leaves it that way.
Execution time for this function is 20 milliseconds or less (typically 16 milliseconds in Windows).
Note that this is a simplified version of the lower level function DigitalIO, which operates on all 20 digital lines. The DLL (ljackuw)
attempts to keep track of the current direction and output state of all lines, so that this easy function can operate on a single line
without changing the others. When the DLL is first loaded, though, it does not know the direction and state of the lines and
assumes all directions are input and output states are low.
Declaration:
long EDigitalIn ( long *idnum,
long demo,
long channel,
long readD,
19

Other manuals for LabJack U12