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

MODBUS request PDU class. More...

#include <MODBUS_Request_PDU.h>

Inheritance diagram for TMODBUS_Request_PDU:
Inheritance graph
Collaboration diagram for TMODBUS_Request_PDU:
Collaboration graph

Public Member Functions

 TMODBUS_Request_PDU ()
 Class constructor method. More...
 
virtual ~TMODBUS_Request_PDU ()
 Class destructor method. More...
 
virtual BOOL Done ()
 Finalise request. More...
 
TRIL Is_Slave_Address_Valid (U8 u8_Slave_Address)
 Test for PDU has a valid slave address. More...
 
TRIL Is_Broadcast ()
 Test for broadcast PDU. More...
 
TRIL Is_CRC_Valid ()
 Test for PDU has a valid CRC. More...
 
VOID Test_Data ()
 Fills buffer with test data. 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 request PDU class.

Constructor & Destructor Documentation

◆ TMODBUS_Request_PDU()

TMODBUS_Request_PDU::TMODBUS_Request_PDU ( )

Class constructor method.


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

◆ ~TMODBUS_Request_PDU()

TMODBUS_Request_PDU::~TMODBUS_Request_PDU ( )
virtual

Class destructor method.


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

Member Function Documentation

◆ Done()

BOOL TMODBUS_Request_PDU::Done ( )
virtual

Finalise request.


Note
This method finalised request by checking CRC of the PDU buffer.
Returns
BOOL - Status of operation
Return values
false- Operation failed
true- Operation successed
Override
Not allowed
Attention
None

Implements TMODBUS_PDU_Base.

References Is_CRC_Valid().

Referenced by TProtocol_MODBUS_Over_UART::Execute_1ms().

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

◆ Is_Broadcast()

TRIL TMODBUS_Request_PDU::Is_Broadcast ( )

Test for broadcast PDU.


Note
None
Returns
TRIL - Broadcast PDU flag status
Return values
unset- Bad PDU format
false- Non broadcast PDU
true- Broadcast PDU
Override
Not allowed
Attention
None

References TMODBUS_PDU_Base::u32_PDU_Size, TMODBUS_PDU_Base::u8_Buffer, and unset.

Referenced by TProtocol_MODBUS_Over_UART::Execute().

Here is the caller graph for this function:

◆ Is_CRC_Valid()

TRIL TMODBUS_Request_PDU::Is_CRC_Valid ( )

Test for PDU has a valid CRC.


Note
None
Returns
TRIL - PDU CRC status
Return values
unset- Bad PDU format
false- CRC of PDU invalid
true- CRC of PDU valid
Override
Not allowed
Attention
None

References TCRC_16_Base::Calculate(), Compose_U16(), TMODBUS_PDU_Base::u16_PDU_CRC, TMODBUS_PDU_Base::u16_Received_CRC, TMODBUS_PDU_Base::u32_PDU_Size, TMODBUS_PDU_Base::u8_Buffer, and unset.

Referenced by Done(), and TProtocol_MODBUS_Over_UART::Execute().

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

◆ Is_Slave_Address_Valid()

TRIL TMODBUS_Request_PDU::Is_Slave_Address_Valid ( U8  u8_Slave_Address)

Test for PDU has a valid slave address.


Note
None
Parameters
[in]u8_Slave_Address- Expected slave address
Returns
TRIL - Address validation result
Return values
unset- Bad PDU format
false- Specified and PDU slave adresses are not equal
true- Specified and PDU slave adresses are equal
Override
Not allowed
Attention
None

References TMODBUS_PDU_Base::u32_PDU_Size, TMODBUS_PDU_Base::u8_Buffer, and unset.

Referenced by TProtocol_MODBUS_Over_UART::Execute().

Here is the caller graph for this function:

◆ Test_Data()

VOID TMODBUS_Request_PDU::Test_Data ( )

Fills buffer with test data.


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

References TMODBUS_PDU_Base::u8_Buffer.


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