ConOpSys V2970
P004.07
ANVILEX control operating system
|
MODBUS responce PDU class. More...
#include <MODBUS_Response_PDU.h>
Public Member Functions | |
TMODBUS_Response_PDU () | |
Class constructor method. More... | |
virtual | ~TMODBUS_Response_PDU () |
Class destructor method. More... | |
VOID | Init (U8 u8_Slave_Address, U8 u8_Function_Code) |
Initialisation PDU with specified slave address abd function code. More... | |
VOID | Init (U8 u8_Slave_Address, U8 u8_Function_Code, U8 u8_Response_Code) |
Initialisation PDU with specified slave address abd function code. More... | |
virtual BOOL | Done () |
Finalise responce composition. More... | |
VOID | Write_U8_Value (U32 u32_Address, U8 u8_Value) |
Write U8 value into responce PDU buffer at specified address. More... | |
VOID | Write_U16_Value (U32 u32_Address, U16 u16_Value) |
Write U16 value into responce PDU buffer at specified address. More... | |
VOID | Write_U32_Value (U32 u32_Address, U32 u32_Value) |
Write U32 value into responce PDU buffer at specified address. More... | |
VOID | Write_F32_Value (U32 u32_Address, F32 f32_Value) |
Write F32 value into responce PDU buffer at specified address. More... | |
Public Member Functions inherited from TMODBUS_PDU_Base | |
TMODBUS_PDU_Base () | |
Class constructor method. More... | |
virtual | ~TMODBUS_PDU_Base () |
Class destructor method. More... | |
BOOL | Is_Empty () |
Returns PDU buffer empty status. More... | |
U32 | Get_Size () |
Returns PDU buffer size. More... | |
U32 | Get_Index () |
Returns actual PDU buffer index. More... | |
VOID | Set_Index (U32 u32_New_Index) |
Set PDU buffer index. More... | |
U8 * | Get_Buffer_Pointer () |
Returns pointer to PDU buffer. More... | |
VOID | Init () |
PDU initialisation method. More... | |
VOID | Init (U8 u8_Slave_Address) |
PDU initialisation with specifird slave address. More... | |
VOID | Set_Slave_Address (U8 u8_Slave_Address) |
Set slave address. More... | |
U8 | Get_Slave_Address () |
Returns actual slave address. More... | |
VOID | Set_Function_Code (U8 u8_Function_Code) |
Set function code method. More... | |
U8 | Get_Function_Code () |
Get function code method. More... | |
U8 | Read_U8_Value () |
Read U8 value at actual address method. More... | |
U8 | Read_U8_Value (U32 u32_Address) |
Read U8 value at specifird address method. More... | |
VOID | Append_U8_Value (U8 u8_Value) |
Append U8 value at the buffer end method. More... | |
U16 | Read_U16_Value () |
Read U16 value at specifird address method. More... | |
U16 | Read_U16_Value (U32 u32_Address) |
Read U16 value at specifird address method. More... | |
VOID | Append_U16_Value (U16 u16_Value) |
Append U16 value at the buffer end method. More... | |
U32 | Read_U32_Value () |
Read U32 value at specifird address method. More... | |
U32 | Read_U32_Value (U32 u32_Address) |
Read U32 value at specifird address method. More... | |
VOID | Append_U32_Value (U32 u32_Value) |
Append U32 value at the buffer end method. More... | |
F32 | Read_F32_Value () |
Read F32 value at specifird address method. More... | |
F32 | Read_F32_Value (U32 u32_Address) |
Read F32 value at specifird address method. More... | |
VOID | Append_F32_Value (F32 f32_Value) |
Append F32 value at the buffer end method. More... | |
U16 | Get_CRC () |
Get cyclic redundancy check method. More... | |
BOOL | Is_Overrun () |
Return PDU overrun status method. More... | |
BOOL | Is_Size_Valid () |
Return PDU size valid status method. More... | |
Additional Inherited Members | |
Public Attributes inherited from TMODBUS_PDU_Base | |
U16 | u16_Received_CRC = (U16)0x0000 |
PDU received CRC. More... | |
Protected Attributes inherited from TMODBUS_PDU_Base | |
U8 | u8_Buffer [MODBUS_PDU_BUFFER_SIZE] = { (U8)0x00 } |
PDU buffer data field. More... | |
U32 | u32_PDU_Size = (U32)0 |
PDU buffer size in byte. More... | |
U32 | u32_PDU_Index = (U32)0 |
PDU buffer index. More... | |
U16 | u16_PDU_CRC = (U32)0x0000 |
PDU buffer CRC. More... | |
MODBUS responce PDU class.
TMODBUS_Response_PDU::TMODBUS_Response_PDU | ( | ) |
Class constructor method.
|
virtual |
Class destructor method.
|
virtual |
Finalise responce composition.
Implements TMODBUS_PDU_Base.
References TCRC_16_Base::Calculate(), Extract_U8_From_U16(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, TMODBUS_PDU_Base::u16_PDU_CRC, TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.
Referenced by TProtocol_MODBUS_Over_UART::Execute().
Initialisation PDU with specified slave address abd function code.
[in] | u8_Slave_Address | - Slave address |
[in] | u8_Function_Code | - Function code |
References TMODBUS_PDU_Base::Init(), TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.
Referenced by TProtocol_MODBUS_Over_UART::CANopen_General_Reference(), TProtocol_MODBUS_Over_UART::Diagnostic(), TProtocol_MODBUS_Over_UART::Get_Communication_Event_Counter(), TProtocol_MODBUS_Over_UART::Get_Communication_Event_Log(), TProtocol_MODBUS_Over_UART::Mask_Write_Register(), TProtocol_MODBUS_Over_UART::Read_Coils(), TProtocol_MODBUS_Over_UART::Read_Device_Identefication(), TProtocol_MODBUS_Over_UART::Read_Discrete_Inputs(), TProtocol_MODBUS_Over_UART::Read_Exception_Status(), TProtocol_MODBUS_Over_UART::Read_FIFO_Queue(), TProtocol_MODBUS_Over_UART::Read_File_Record(), TProtocol_MODBUS_Over_UART::Read_Holding_Registers(), TProtocol_MODBUS_Over_UART::Read_Input_Register(), TProtocol_MODBUS_Over_UART::Read_Write_Multiple_Registers(), TProtocol_MODBUS_Over_UART::Report_Server_ID(), TProtocol_MODBUS_Over_UART::Write_File_Record(), TProtocol_MODBUS_Over_UART::Write_Multiple_Coils(), TProtocol_MODBUS_Over_UART::Write_Multiple_Registers(), TProtocol_MODBUS_Over_UART::Write_Single_Coil(), and TProtocol_MODBUS_Over_UART::Write_Single_Register().
Initialisation PDU with specified slave address abd function code.
[in] | u8_Slave_Address | - Slave address |
[in] | u8_Function_Code | - Function code |
[in] | u8_Response_Code | - Response code |
References TMODBUS_PDU_Base::Init(), TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.
Write F32 value into responce PDU buffer at specified address.
[in] | u32_Address | - PDU buffer address |
[in] | f32_Value | - F32 value to write |
References Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, TMODBUS_PDU_Base::u32_PDU_Index, and TMODBUS_PDU_Base::u32_PDU_Size.
Write U16 value into responce PDU buffer at specified address.
[in] | u32_Address | - PDU buffer address |
[in] | u16_Value | - U16 value to write |
References Extract_U8_From_U16(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.
Write U32 value into responce PDU buffer at specified address.
[in] | u32_Address | - PDU buffer address |
[in] | u32_Value | - U32 value to write |
References Extract_U8_From_U32(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.
Write U8 value into responce PDU buffer at specified address.
[in] | u32_Address | - PDU buffer address |
[in] | u8_Value | - U8 value to write |
References Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.
Referenced by TProtocol_MODBUS_Over_UART::Get_Communication_Event_Log().