Skip to main content
Skip table of contents

4.16 - Counter [U12 Datasheet]

Controls and reads the counter. The counter is disabled if the watchdog timer is enabled.

Execution time for this function is 20 milliseconds or less (typically 16 milliseconds in Windows).

Declaration:

long Counter ( long *idnum,
long demo,
long *stateD,
long *stateIO,
long resetCounter,
long enableSTB,
unsigned long *count )

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.
  • enableSTB – If >0, STB is enabled. Used for testing and calibration. (This input has no effect with firmware V1.02 or earlier, in which case STB is always enabled)

Outputs:

  • *idnum – Returns the local ID or –1 if no LabJack is found.
  • *stateD – States of D0-D15.
  • *stateIO – States of IO0-IO3.
  • *count – Current value of the 32-bit counter (CNT). This value is read before the counter is reset.

ActiveX Function Differences:
The counter read is returned as a double precision float, instead of an unsigned long.

Declaration (ActiveX):

long CounterX ( long FAR* idnum,
long demo,
long FAR* stateD,
long FAR* stateIO,
long resetCounter,
long enableSTB,
double FAR* count )

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.