GPIO-24 adapter can send GPIO_EV_PLS_CNT event to your application.
You can configure event generation conditions with GPIO_SET_PLS_CNT_CFG command. For more detailed information see Section 11.2, “Pulse Counter Event”.
||Event ID (0x86)
||Cause of the event
||ID number of the pulse counter, which has generated the event
||Current number of detected pulses or elapsed time
||Type of returned value (current number of detected pulses or elapsed time)
Event is an 8-byte array of the following format:
- Byte 0: GPIO_EV_PLS_CNT (0x86)
Event ID (event type). This byte will contain 0x86.
- Byte 1: CNT
Events counter value.
USB-I/O adapter increments event counter with every event.
- Byte 2: EVENT_TYPE
This byte may contain one of three possible values:
GPIO_PLS_CNT_EV_OVERFLOW (1) – maximum number of pulses (16,777,215) is reached.
GPIO_PLS_CNT_EV_REPEAT (2) – the event is sent periodically.
GPIO_PLS_CNT_EV_MATCH (3) – user-defined measurement limits are reached: time period is exceeded (Time Based Mode:) or threshold number of pulses is detected (Pulse Based Mode:).
- Byte 3: PLS_CNT_NUMBER
The ID number of the pulse counter, which has generated the event:
- Bytes 4..6: VALUE
If Byte 7: VALUE_TYPE equals to GPIO_PLS_CNT_VAL_TIME (1), Bytes 4..6: VALUE contain the time period in units of 10 ms, that have passed since last reset of the pulse counter.
If Byte 7: VALUE_TYPE equals to GPIO_PLS_CNT_VAL_PULSES (0), Bytes 4..6: VALUE contain current number of pulses counted since last reset of the pulse counter.
Byte 6: VALUE – most significant byte (high byte).
Byte 5: VALUE – middle byte.
Byte 4: VALUE – least significant byte (low byte).
- Byte 7: VALUE_TYPE
The type of value specified in Bytes 4..6: VALUE:
For convenience GPIO_EV_PLS_CNT structure is declared in reports.h file.