52 #define MODBUS_RESPONCE_CODE_ILLEGAL_FUNCTION ( (U8)0x01 )
53 #define MODBUS_RESPONCE_CODE_ILLEGAL_DATA_ADDRESS ( (U8)0x02 )
54 #define MODBUS_RESPONCE_CODE_ILLEGAL_DATA_VALUE ( (U8)0x03 )
55 #define MODBUS_RESPONCE_CODE_SERVER_DEVICE_FAILURE ( (U8)0x04 )
56 #define MODBUS_RESPONCE_CODE_ACKNOWLEDGE ( (U8)0x05 )
57 #define MODBUS_RESPONCE_CODE_SERVER_DEVICE_BUSY ( (U8)0x06 )
58 #define MODBUS_RESPONCE_CODE_MEMORY_PARITY_ERROR ( (U8)0x07 )
59 #define MODBUS_RESPONCE_CODE_GATEWAY_PATH_UNAVAILABLE ( (U8)0x0A )
60 #define MODBUS_RESPONCE_CODE_GATAWAY_TARGET_DEVICE_FAILED_TO_RESPOND ( (U8)0x0B )
66 #define MODBUS_FC_0x01_READ_COILS ( (U8)0x01 )
67 #define MODBUS_FC_0x02_READ_DISCRETE_INPUTS ( (U8)0x02 )
68 #define MODBUS_FC_0x03_READ_HOLDING_REGISTERS ( (U8)0x03 )
69 #define MODBUS_FC_0x04_READ_INPUT_REGISTER ( (U8)0x04 )
70 #define MODBUS_FC_0x05_WRITE_SINGLE_COIL ( (U8)0x05 )
71 #define MODBUS_FC_0x06_WRITE_SINGLE_REGISTER ( (U8)0x06 )
72 #define MODBUS_FC_0x07_READ_EXCEPTION_STATUS ( (U8)0x07 )
73 #define MODBUS_FC_0x08_DIAGNOSTIC ( (U8)0x08 )
74 #define MODBUS_FC_0x0B_GET_COMMUNICATION_EVENT_COUNTER ( (U8)0x0B )
75 #define MODBUS_FC_0x0C_GET_COMMUNICATION_EVENT_LOG ( (U8)0x0C )
76 #define MODBUS_FC_0x0F_WRITE_MULTIPLE_COILS ( (U8)0x0F )
77 #define MODBUS_FC_0x10_WRITE_MULTIPLE_REGISTERS ( (U8)0x10 )
78 #define MODBUS_FC_0x11_REPORT_SERVER_ID ( (U8)0x11 )
79 #define MODBUS_FC_0x14_READ_FILE_RECORD ( (U8)0x14 )
80 #define MODBUS_FC_0x15_WRITE_FILE_RECORD ( (U8)0x15 )
81 #define MODBUS_FC_0x16_MASK_WRITE_REGISTER ( (U8)0x16 )
82 #define MODBUS_FC_0x17_READ_WRITE_MULTIPLE_REGISTERS ( (U8)0x17 )
83 #define MODBUS_FC_0x18_READ_FIFO_QUEUE ( (U8)0x18 )
84 #define MODBUS_FC_0x2B_ENCAPSULATED_INTERFACE_TRANSPORT ( (U8)0x2B )
86 #define MODBUS_MEI_0x0D_CANOPEN_GENERAL_REFERENCE ( (U8)0x0D )
87 #define MODBUS_MEI_0x0E_READ_DEVICE_IDENTEFICATION ( (U8)0x0E )
92 #define MODBUS_PDU_BUFFER_SIZE (0x100)
ConOpSys data type definitions header file.
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
float F32
IEEE-754 32-Bit single presession floating point numbers datatype defenition.
Definition: Defines.h:324
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
#define MODBUS_PDU_BUFFER_SIZE
MODBUS PDU buffer side definition.
Definition: MODBUS_PDU.h:92
MODBUS generic PDU base class.
Definition: MODBUS_PDU.h:100
TMODBUS_PDU_Base()
Class constructor method.
Definition: MODBUS_PDU.cpp:68
VOID Set_Index(U32 u32_New_Index)
Set PDU buffer index.
Definition: MODBUS_PDU.cpp:120
BOOL Is_Empty()
Returns PDU buffer empty status.
Definition: MODBUS_PDU.cpp:84
U32 Get_Index()
Returns actual PDU buffer index.
Definition: MODBUS_PDU.cpp:108
U8 * Get_Buffer_Pointer()
Returns pointer to PDU buffer.
Definition: MODBUS_PDU.cpp:228
BOOL Is_Size_Valid()
Return PDU size valid status method.
Definition: MODBUS_PDU.cpp:769
VOID Append_U8_Value(U8 u8_Value)
Append U8 value at the buffer end method.
Definition: MODBUS_PDU.cpp:276
U8 Read_U8_Value()
Read U8 value at actual address method.
Definition: MODBUS_PDU.cpp:240
virtual BOOL Done()=0
PDU finalization method.
U32 Get_Size()
Returns PDU buffer size.
Definition: MODBUS_PDU.cpp:96
U16 u16_PDU_CRC
PDU buffer CRC.
Definition: MODBUS_PDU.h:467
U32 u32_PDU_Index
PDU buffer index.
Definition: MODBUS_PDU.h:464
VOID Append_U16_Value(U16 u16_Value)
Append U16 value at the buffer end method.
Definition: MODBUS_PDU.cpp:356
U16 Get_CRC()
Get cyclic redundancy check method.
Definition: MODBUS_PDU.cpp:745
U16 Read_U16_Value()
Read U16 value at specifird address method.
Definition: MODBUS_PDU.cpp:309
U32 Read_U32_Value()
Read U32 value at specifird address method.
Definition: MODBUS_PDU.cpp:413
U32 u32_PDU_Size
PDU buffer size in byte.
Definition: MODBUS_PDU.h:461
VOID Set_Slave_Address(U8 u8_Slave_Address)
Set slave address.
Definition: MODBUS_PDU.cpp:179
VOID Append_F32_Value(F32 f32_Value)
Append F32 value at the buffer end method.
Definition: MODBUS_PDU.cpp:640
U8 Get_Slave_Address()
Returns actual slave address.
Definition: MODBUS_PDU.cpp:192
U16 u16_Received_CRC
PDU received CRC.
Definition: MODBUS_PDU.h:445
VOID Append_U32_Value(U32 u32_Value)
Append U32 value at the buffer end method.
Definition: MODBUS_PDU.cpp:474
VOID Init()
PDU initialisation method.
Definition: MODBUS_PDU.cpp:134
F32 Read_F32_Value()
Read F32 value at specifird address method.
Definition: MODBUS_PDU.cpp:579
U8 Get_Function_Code()
Get function code method.
Definition: MODBUS_PDU.cpp:216
U8 u8_Buffer[MODBUS_PDU_BUFFER_SIZE]
PDU buffer data field.
Definition: MODBUS_PDU.h:458
virtual ~TMODBUS_PDU_Base()
Class destructor method.
Definition: MODBUS_PDU.cpp:76
BOOL Is_Overrun()
Return PDU overrun status method.
Definition: MODBUS_PDU.cpp:757
VOID Set_Function_Code(U8 u8_Function_Code)
Set function code method.
Definition: MODBUS_PDU.cpp:204