ConOpSys V2970
P004.07
ANVILEX control operating system
|
MODBUS request PDU class. More...
#include <MODBUS_Request_PDU.h>
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... | |
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 request PDU class.
TMODBUS_Request_PDU::TMODBUS_Request_PDU | ( | ) |
Class constructor method.
|
virtual |
Class destructor method.
|
virtual |
Finalise request.
false | - Operation failed |
true | - Operation successed |
Implements TMODBUS_PDU_Base.
References Is_CRC_Valid().
Referenced by TProtocol_MODBUS_Over_UART::Execute_1ms().
TRIL TMODBUS_Request_PDU::Is_Broadcast | ( | ) |
Test for broadcast PDU.
unset | - Bad PDU format |
false | - Non broadcast PDU |
true | - Broadcast PDU |
References TMODBUS_PDU_Base::u32_PDU_Size, TMODBUS_PDU_Base::u8_Buffer, and unset.
Referenced by TProtocol_MODBUS_Over_UART::Execute().
TRIL TMODBUS_Request_PDU::Is_CRC_Valid | ( | ) |
Test for PDU has a valid CRC.
unset | - Bad PDU format |
false | - CRC of PDU invalid |
true | - CRC of PDU valid |
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().
Test for PDU has a valid slave address.
[in] | u8_Slave_Address | - Expected slave address |
unset | - Bad PDU format |
false | - Specified and PDU slave adresses are not equal |
true | - Specified and PDU slave adresses are equal |
References TMODBUS_PDU_Base::u32_PDU_Size, TMODBUS_PDU_Base::u8_Buffer, and unset.
Referenced by TProtocol_MODBUS_Over_UART::Execute().
VOID TMODBUS_Request_PDU::Test_Data | ( | ) |
Fills buffer with test data.
References TMODBUS_PDU_Base::u8_Buffer.