4.3 - ECount [U12 Datasheet]
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.
- demo – Send 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
- python
import u12
d = u12.U12()
d.eCount(resetCounter=0)
#{'count': 3138388207, 'idnum': 12, 'ms': 1273175001372.4438}