The GPIO_GET_PLS_CNT_LIMIT command retrieves pulse counter limits – time period or threshold number of pulses – for Time Based Mode and Pulse Based Mode, correspondingly.
| Byte 0 | GPIO_GET_PLS_CNT_LIMIT | Command ID |
| Byte 1 | ECHO | Echo to associate command with the response |
| Byte 2 | PLS_CNT_NUMBER | ID number of the counter, which limit will be retrieved. |
| Byte 3 | LIMIT_TYPE | Type of the counter limit (time period or threshold number of pulses) |
| Bytes 4..7 | Reserved | Reserved |
Command is an 8-byte array of the following format:
This byte contains command ID (command type). It must be set to 0x29.
This byte can be used to associate a response received from GPIO-24 adapter with a specific command. Response will contain exactly the same value in its echo byte.
The ID number of the pulse counter:
0 – pulse counter on A.3 pin;
1 – pulse counter on A.4 pin.
The type of value to be retrieved:
GPIO_PLS_CNT_VAL_PULSES (0) – the command retrieves the threshold number of pulses.
GPIO_PLS_CNT_VAL_TIME (1) – the command retrieves the time period in units of 10 ms.
These bytes are reserved for future usage and must be set to 0.
For convenience GPIO_GET_PLS_CNT_LIMIT_CMD structure is declared in reports.h file.
GPIO-24 adapter sends GPIO_GET_PLS_CNT_LIMIT response after command execution. Pulse counter limit is specified inside the response.
| Byte 0 | GPIO_GET_PLS_CNT_LIMIT | Response ID |
| Byte 1 | ECHO | Echo to associate command with the response |
| Byte 2 | ST | Command execution status |
| Byte 3 | PLS_CNT_NUMBER | The number of pulse counter |
| Byte 4 | LIMIT_TYPE | The type of limit |
| Byte 5 | LIMIT[2] | Counter limit (time period or threshold number of pulses) |
| Byte 6 | LIMIT[1] | |
| Byte 7 | LIMIT[0] |
Response is an 8-byte array of the following format:
Response ID (response type). This byte will contain 0x29.
Echo byte copied from the corresponding command. It can be used to associate the response with the specific command.
Status of the command execution:
GPIO_ST_SUCCESS (0x00) – Pulse counter limit has succesfully been retrieved;
GPIO_ST_INVALID_PLS_CNT_NUMBER (0x0A) – Invalid ID of the pulse counter has been specified (only 0 and 1 values are valid);
GPIO_ST_INVALID_PARAMETER (0x0B) – Unsupported pulse counter limit type has been specified.
The ID number of the pulse counter:
0 – pulse counter on A.3 pin;
1 – pulse counter on A.4 pin.
The type of value specified in Bytes 5..7: LIMIT:
GPIO_PLS_CNT_VAL_PULSES (0) – Bytes 5..7: LIMIT contain the threshold number of pulses.
GPIO_PLS_CNT_VAL_TIME (1) – Bytes 5..7: LIMIT contain the time period in units of 10 ms.
These bytes contain pulse counter limits.
If Byte 4: LIMIT_TYPE = GPIO_PLS_CNT_VAL_TIME (1) – Bytes 4..6: LIMIT define the time period in units of 10 ms up to 16,777,215 (167,772,150 ms or 46.5 h).
If Byte 4: LIMIT_TYPE = GPIO_PLS_CNT_VAL_PULSES (0) – Bytes 4..6: LIMIT define the threshold number of pulses up to 16,777,215.
Byte 5: LIMIT[2] – least significant byte (low byte) of a pulse counter limit.
Byte 6: LIMIT[1] – middle byte of threshold a pulse counter limit.
Byte 7: LIMIT[0] – most significant byte (high byte) of a pulse counter limit.
For convenience GPIO_GET_PLS_CNT_LIMIT_RSP structure is declared in reports.h file.