ConOpSys V2970  P004.07
ANVILEX control operating system
Public Member Functions | Public Attributes | Protected Attributes | List of all members
TMODBUS_PDU_Base Class Referenceabstract

MODBUS generic PDU base class. More...

#include <MODBUS_PDU.h>

Inheritance diagram for TMODBUS_PDU_Base:
Inheritance graph
Collaboration diagram for TMODBUS_PDU_Base:
Collaboration graph

Public Member Functions

 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...
 
virtual BOOL Done ()=0
 PDU finalization method. 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...
 

Public Attributes

U16 u16_Received_CRC = (U16)0x0000
 PDU received CRC. More...
 

Protected Attributes

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 generic PDU base class.

Constructor & Destructor Documentation

◆ TMODBUS_PDU_Base()

TMODBUS_PDU_Base::TMODBUS_PDU_Base ( )

Class constructor method.


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

◆ ~TMODBUS_PDU_Base()

TMODBUS_PDU_Base::~TMODBUS_PDU_Base ( )
virtual

Class destructor method.


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

Member Function Documentation

◆ Append_F32_Value()

VOID TMODBUS_PDU_Base::Append_F32_Value ( F32  f32_Value)

Append F32 value at the buffer end method.


Note
None
Parameters
[in]f32_Value- Append velue
Override
Not allowed
Attention
None

References Extract_U8_From_F32(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, u32_PDU_Index, u32_PDU_Size, and u8_Buffer.

Referenced by TProtocol_MODBUS_Over_UART::Read_Holding_Registers(), and TProtocol_MODBUS_Over_UART::Read_Input_Register().

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

◆ Append_U16_Value()

VOID TMODBUS_PDU_Base::Append_U16_Value ( U16  u16_Value)

◆ Append_U32_Value()

VOID TMODBUS_PDU_Base::Append_U32_Value ( U32  u32_Value)

Append U32 value at the buffer end method.


Note
None
Parameters
[in]u32_Value- Append velue
Override
Not allowed
Attention
None

References Extract_U8_From_U32(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, u32_PDU_Index, u32_PDU_Size, and u8_Buffer.

Referenced by TProtocol_MODBUS_Over_UART::Read_Holding_Registers(), and TProtocol_MODBUS_Over_UART::Read_Input_Register().

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

◆ Append_U8_Value()

VOID TMODBUS_PDU_Base::Append_U8_Value ( U8  u8_Value)

◆ Done()

virtual BOOL TMODBUS_PDU_Base::Done ( )
pure virtual

PDU finalization method.


Note
None
Returns
None
Override
Not allowed
Attention
None

Implemented in TMODBUS_Response_PDU, and TMODBUS_Request_PDU.

◆ Get_Buffer_Pointer()

U8 * TMODBUS_PDU_Base::Get_Buffer_Pointer ( )

Returns pointer to PDU buffer.


Note
None
Returns
U8* - Pointer to PDU buffer
Override
Not allowed
Attention
None

References u8_Buffer.

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

Here is the caller graph for this function:

◆ Get_CRC()

U16 TMODBUS_PDU_Base::Get_CRC ( )

Get cyclic redundancy check method.


Note
None
Returns
U16 - Read value
Override
Not allowed
Attention
None

References u16_PDU_CRC.

Referenced by TProtocol_MODBUS_Over_UART::Send_Information().

Here is the caller graph for this function:

◆ Get_Function_Code()

U8 TMODBUS_PDU_Base::Get_Function_Code ( )

Get function code method.


Note
None
Returns
U8 - Function code
Override
Not allowed
Attention
None

References u8_Buffer.

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

Here is the caller graph for this function:

◆ Get_Index()

U32 TMODBUS_PDU_Base::Get_Index ( )

Returns actual PDU buffer index.


Note
None
Returns
U32 - Actual PDU buffer index
Override
Not allowed
Attention
None

References u32_PDU_Index.

◆ Get_Size()

U32 TMODBUS_PDU_Base::Get_Size ( )

Returns PDU buffer size.


Note
None
Returns
U32 - PDU buffer size
Override
Not allowed
Attention
None

References u32_PDU_Size.

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

Here is the caller graph for this function:

◆ Get_Slave_Address()

U8 TMODBUS_PDU_Base::Get_Slave_Address ( )

Returns actual slave address.


Note
None
Returns
U8 - Actual slave address
Override
Not allowed
Attention
None

References u8_Buffer.

Referenced by TProtocol_MODBUS_Over_UART::Send_Information().

Here is the caller graph for this function:

◆ Init() [1/2]

VOID TMODBUS_PDU_Base::Init ( )

PDU initialisation method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References MODBUS_PDU_BUFFER_SIZE, u32_PDU_Index, u32_PDU_Size, and u8_Buffer.

Referenced by TProtocol_MODBUS_Over_UART::Execute(), TProtocol_MODBUS_Over_UART::Execute_1ms(), Init(), and TMODBUS_Response_PDU::Init().

Here is the caller graph for this function:

◆ Init() [2/2]

VOID TMODBUS_PDU_Base::Init ( U8  u8_Slave_Address)

PDU initialisation with specifird slave address.


Note
None
Parameters
[in]u8_Slave_Address- New slave address
Returns
None
Override
Not allowed
Attention
None

References Init(), Set_Slave_Address(), u32_PDU_Index, and u32_PDU_Size.

Here is the call graph for this function:

◆ Is_Empty()

BOOL TMODBUS_PDU_Base::Is_Empty ( )

Returns PDU buffer empty status.


Note
This function is not implemented
Returns
BOOL - PDU buffer status
Return values
false- PDU buffer is not empty
true- PDU buffer is empty
Override
Not allowed
Attention
None

References u32_PDU_Size.

Referenced by TProtocol_MODBUS_Over_UART::Execute_1ms().

Here is the caller graph for this function:

◆ Is_Overrun()

BOOL TMODBUS_PDU_Base::Is_Overrun ( )

Return PDU overrun status method.


Note
None
Returns
BOOL - PDU overrun status
Return values
false- PDU is not overrun
true- PDU is overrun
Override
Not allowed
Attention
None

References MODBUS_PDU_BUFFER_SIZE, and u32_PDU_Size.

Referenced by TProtocol_MODBUS_Over_UART::Execute_1ms().

Here is the caller graph for this function:

◆ Is_Size_Valid()

BOOL TMODBUS_PDU_Base::Is_Size_Valid ( )

Return PDU size valid status method.


Note
None
Returns
BOOL - PDU size valid status
Return values
false- PDU size invalid
true- PDU size valid
Override
Not allowed
Attention
None

References u32_PDU_Size.

Referenced by TProtocol_MODBUS_Over_UART::Execute().

Here is the caller graph for this function:

◆ Read_F32_Value() [1/2]

F32 TMODBUS_PDU_Base::Read_F32_Value ( )

Read F32 value at specifird address method.


Note
None
Returns
F32 - Read value
Override
Not allowed
Attention
None

References Compose_F32(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, u32_PDU_Index, and u8_Buffer.

Referenced by Read_F32_Value().

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

◆ Read_F32_Value() [2/2]

F32 TMODBUS_PDU_Base::Read_F32_Value ( U32  u32_Address)

Read F32 value at specifird address method.


Note
None
Parameters
[in]u32_Address- Address for reading
Returns
F32 - Read value
Override
Not allowed
Attention
None

References Read_F32_Value(), and u32_PDU_Index.

Here is the call graph for this function:

◆ Read_U16_Value() [1/2]

U16 TMODBUS_PDU_Base::Read_U16_Value ( )

◆ Read_U16_Value() [2/2]

U16 TMODBUS_PDU_Base::Read_U16_Value ( U32  u32_Address)

Read U16 value at specifird address method.


Note
None
Parameters
[in]u32_Address- Address for reading
Returns
U16 - Read value
Override
Not allowed
Attention
None

References Read_U16_Value(), and u32_PDU_Index.

Here is the call graph for this function:

◆ Read_U32_Value() [1/2]

U32 TMODBUS_PDU_Base::Read_U32_Value ( )

Read U32 value at specifird address method.


Note
None
Returns
U32 - Read value
Override
Not allowed
Attention
None

References Compose_U32(), Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, u32_PDU_Index, and u8_Buffer.

Referenced by Read_U32_Value(), and TProtocol_MODBUS_Over_UART::Write_Multiple_Registers().

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

◆ Read_U32_Value() [2/2]

U32 TMODBUS_PDU_Base::Read_U32_Value ( U32  u32_Address)

Read U32 value at specifird address method.


Note
None
Parameters
[in]u32_Address- Address for reading
Returns
U32 - Read value
Override
Not allowed
Attention
None

References Read_U32_Value(), and u32_PDU_Index.

Here is the call graph for this function:

◆ Read_U8_Value() [1/2]

U8 TMODBUS_PDU_Base::Read_U8_Value ( )

Read U8 value at actual address method.


Note
None
Returns
U8 - Read value
Override
Not allowed
Attention
None

References Increment_Saturated(), MODBUS_PDU_BUFFER_SIZE, u32_PDU_Index, and u8_Buffer.

Referenced by TProtocol_MODBUS_Over_UART::Encapsulated_Interface_Transport(), Read_U8_Value(), TProtocol_MODBUS_Over_UART::Read_Write_Multiple_Registers(), TProtocol_MODBUS_Over_UART::Write_Multiple_Coils(), and TProtocol_MODBUS_Over_UART::Write_Multiple_Registers().

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

◆ Read_U8_Value() [2/2]

U8 TMODBUS_PDU_Base::Read_U8_Value ( U32  u32_Address)

Read U8 value at specifird address method.


Note
None
Parameters
[in]u32_Address- Address for reading
Returns
U8 - Read value
Override
Not allowed
Attention
None

References Read_U8_Value(), and u32_PDU_Index.

Here is the call graph for this function:

◆ Set_Function_Code()

VOID TMODBUS_PDU_Base::Set_Function_Code ( U8  u8_Function_Code)

Set function code method.


Note
None
Parameters
[in]u8_Function_Code- Function code
Override
Not allowed
Attention
None

References u8_Buffer.

◆ Set_Index()

VOID TMODBUS_PDU_Base::Set_Index ( U32  u32_New_Index)

Set PDU buffer index.


Note
None
Parameters
[in]u32_New_Index- New PDU buffer index
Override
Not allowed
Attention
None

References u32_PDU_Index.

Referenced by TProtocol_MODBUS_Over_UART::Execute().

Here is the caller graph for this function:

◆ Set_Slave_Address()

VOID TMODBUS_PDU_Base::Set_Slave_Address ( U8  u8_Slave_Address)

Set slave address.


Note
None
Parameters
[in]u8_Slave_Address- New slave address
Override
Not allowed
Attention
None

References u8_Buffer.

Referenced by Init().

Here is the caller graph for this function:

Member Data Documentation

◆ u16_PDU_CRC

U16 TMODBUS_PDU_Base::u16_PDU_CRC = (U32)0x0000
protected

◆ u16_Received_CRC

U16 TMODBUS_PDU_Base::u16_Received_CRC = (U16)0x0000

◆ u32_PDU_Index

U32 TMODBUS_PDU_Base::u32_PDU_Index = (U32)0
protected

◆ u32_PDU_Size

U32 TMODBUS_PDU_Base::u32_PDU_Size = (U32)0
protected

◆ u8_Buffer

U8 TMODBUS_PDU_Base::u8_Buffer[MODBUS_PDU_BUFFER_SIZE] = { (U8)0x00 }
protected

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