You are here

GPIO_GET_SN (0x0C)

Each single GPIO-24 adapter has its unique serial number (SN). It is assigned during manufacturing and identifies the adapter. The SN of the GPIO-24 adapter is a 4-byte number. The GPIO_GET_SN command retrieves the serial number of the GPIO-24 adapter.

GPIO_GET_SN Command

Go to Response

Byte 0 GPIO_GET_SN Command ID (0x0C).
Byte 1 ECHO Echo to associate a command with the response.
Bytes 2..7 Reserved Reserved (must be 0).

Command is an 8-byte array of the following format:

Byte 0: GPIO_GET_SN (0x0C)

This byte contains command ID (command type). It should be set to 0x0C.

Byte 1: ECHO

This byte is 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.

Bytes 2..7: Reserved

These bytes are reserved for future usage and must be set to 0.

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

GPIO-24 adapter sends GPIO_GET_SN response after command execution. Device serial number is specified inside the response.

GPIO_GET_SN Response

Go to Command

Byte 0 GPIO_GET_CFG Response ID (0x0C).
Byte 1 ECHO Echo to associate a command with the response.
Byte 2 ST Command execution status.
Byte 3 UPPER_SN UPPER_SN byte.
Byte 4 HI_SN HI_SN byte.
Byte 5 LOW_SN LOW_SN byte.
Byte 6 LOWEST SN LOWEST_SN byte.
Byte 7 Reserved Reserved

Response is an 8-byte array of the following format:

Byte 0: GPIO_GET_SN (0x0C)

Response ID (response type). This byte will contain 0x0C.

Byte 1: ECHO

Echo byte copied from the corresponding command. It is used to associate the response with the specific command.

Byte 2: ST

Status of the command execution:

  • GPIO_ST_SUCCESS (0x00) – The I/O pins output values were successfully configured.

  • GPIO_ST_INVALID_PORT (0x03) – Invalid port number has been specified.

Byte 3..6: Serial Number bytes:

SN of the GPIO-24 adapter is a 4-byte number. GPIO_GET_SN response serial number consists of following bytes:

  • UPPER_SN

  • HI_SN

  • LOW_SN

  • LOWEST_SN

Byte 7: Reserved

This byte is reserved for future usage.

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