ConOpSys V2970  P004.07
ANVILEX control operating system
Public Member Functions | List of all members
TMODBUS_Response_PDU Class Reference

MODBUS responce PDU class. More...

#include <MODBUS_Response_PDU.h>

Inheritance diagram for TMODBUS_Response_PDU:
Inheritance graph
Collaboration diagram for TMODBUS_Response_PDU:
Collaboration graph

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...
 
U8Get_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...
 

Detailed Description

MODBUS responce PDU class.

Constructor & Destructor Documentation

◆ TMODBUS_Response_PDU()

TMODBUS_Response_PDU::TMODBUS_Response_PDU ( )

Class constructor method.


Note
None
Override
Not allowed
Attention
Don't call this method directly.

◆ ~TMODBUS_Response_PDU()

TMODBUS_Response_PDU::~TMODBUS_Response_PDU ( )
virtual

Class destructor method.


Note
None
Override
Not allowed
Attention
Don't call this method directly.

Member Function Documentation

◆ Done()

BOOL TMODBUS_Response_PDU::Done ( )
virtual

Finalise responce composition.


Note
This method finalised responce composition by adding CRC to the PDU buffer.
Override
Not allowed
Attention
None

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [1/2]

VOID TMODBUS_Response_PDU::Init ( U8  u8_Slave_Address,
U8  u8_Function_Code 
)

◆ Init() [2/2]

VOID TMODBUS_Response_PDU::Init ( U8  u8_Slave_Address,
U8  u8_Function_Code,
U8  u8_Response_Code 
)

Initialisation PDU with specified slave address abd function code.


Note
None
Parameters
[in]u8_Slave_Address- Slave address
[in]u8_Function_Code- Function code
[in]u8_Response_Code- Response code
Override
Not allowed
Attention
None

References TMODBUS_PDU_Base::Init(), TMODBUS_PDU_Base::u32_PDU_Index, TMODBUS_PDU_Base::u32_PDU_Size, and TMODBUS_PDU_Base::u8_Buffer.

Here is the call graph for this function:

◆ Write_F32_Value()

VOID TMODBUS_Response_PDU::Write_F32_Value ( U32  u32_Address,
F32  f32_Value 
)

Write F32 value into responce PDU buffer at specified address.


Note
None
Parameters
[in]u32_Address- PDU buffer address
[in]f32_Value- F32 value to write
Override
Not allowed
Attention
None

References Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, TMODBUS_PDU_Base::u32_PDU_Index, and TMODBUS_PDU_Base::u32_PDU_Size.

Here is the call graph for this function:

◆ Write_U16_Value()

VOID TMODBUS_Response_PDU::Write_U16_Value ( U32  u32_Address,
U16  u16_Value 
)

Write U16 value into responce PDU buffer at specified address.


Note
None
Parameters
[in]u32_Address- PDU buffer address
[in]u16_Value- U16 value to write
Override
Not allowed
Attention
None

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.

Here is the call graph for this function:

◆ Write_U32_Value()

VOID TMODBUS_Response_PDU::Write_U32_Value ( U32  u32_Address,
U32  u32_Value 
)

Write U32 value into responce PDU buffer at specified address.


Note
None
Parameters
[in]u32_Address- PDU buffer address
[in]u32_Value- U32 value to write
Override
Not allowed
Attention
None

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.

Here is the call graph for this function:

◆ Write_U8_Value()

VOID TMODBUS_Response_PDU::Write_U8_Value ( U32  u32_Address,
U8  u8_Value 
)

Write U8 value into responce PDU buffer at specified address.


Note
None
Parameters
[in]u32_Address- PDU buffer address
[in]u8_Value- U8 value to write
Override
Not allowed
Attention
None

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().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: