You are here

GPIO_EV_PLS_CNT

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”.

Byte 0 GPIO_EV_PLS_CNT Event ID (0x86)
Byte 1 CNT Events counter
Byte 2 EVENT_TYPE Cause of the event
Byte 3 PLS_CNT_NUMBER ID number of the pulse counter, which has generated the event
Byte 4 VALUE[0] Current number of detected pulses or elapsed time
Byte 5 VALUE[1]
Byte 6 VALUE[2]
Byte 7 VALUE_TYPE 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:

  • 0 – pulse counter on A.3 pin;

  • 1 – pulse counter on A.4 pin.

 

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[0] – most significant byte (high byte).

Byte 5: VALUE[1] – middle byte.

Byte 4: VALUE[2] – least significant byte (low byte).

Byte 7: VALUE_TYPE

The type of value specified in Bytes 4..6: VALUE:

  • GPIO_PLS_CNT_VAL_PULSES (0) – Bytes 4..6: VALUE contain the number of detected pulses.

  • GPIO_PLS_CNT_VAL_TIME (1) – Bytes 4..6: VALUE contain the elapsed time in units of 10 ms.

 

For convenience GPIO_EV_PLS_CNT structure is declared in reports.h file.