You're reading the documentation for an older, but still supported version (GL013300).
For information on the latest version, please have a look at GL013301.

MODBUS_DATA

This is a structure information to store Modbus data, and consists of the following fields.

BYTE#

Field Name

Data Type

Value

Remarks

0

_iType

unsigned char

0: TCP, 1: RTU

1

_tData

Union of WRITE_MODBUS_TCP_DATA / WRITE_MODBUS_RTU_DATA

Contains one of the following members based on _iType

  • _tcp: Modbus communication via Ethernet (TCP/IP) Includes IP address, port, slave ID, and register information.

  • _rtu: Modbus communication via serial interface (RS-485/RS-232) Includes TTY port, baud rate, parity, stop bits, and register data.

  • _szBuffer[70] : unsigned char 70-byte raw memory buffer used for serialization, byte-level access, or network data packing.

Total size: 112 bytes

Defined in: DRFS.h

typedef struct _MODBUS_DATA
{
    /* 0: TCP, 1: RTU */
    unsigned char _iType;

    union {
        /* Modbus TCP (see WRITE_MODBUS_DATA) */
        WRITE_MODBUS_DATA     _tcp;   /* a.k.a. WRITE_MODBUS_TCP_DATA in some codebases */
        /* Modbus RTU (see WRITE_MODBUS_RTU_DATA) */
        WRITE_MODBUS_RTU_DATA _rtu;
        /* raw buffer for packing */
        unsigned char         _szBuffer[70];
    } _tData;

} MODBUS_DATA, *LPMODBUS_DATA;