xMBAnalyzerFrame Struct Reference
[MODBUS Common]


Detailed Description

This data structure is used by the protocol analyzer.


Public Types

enum  { MB_FRAME_SEND, MB_FRAME_RECEIVE }
enum  {
  MB_FRAME_RTU, MB_FRAME_ASCII, MB_FRAME_TCP, MB_FRAME_UDP,
  MB_FRAME_DAMAGED
}

Data Fields

enum xMBAnalyzerFrame:: { ... }  eFrameDir
enum xMBAnalyzerFrame:: { ... }  eFrameType
union {
   struct {
      UBYTE   ubSlaveAddress
      USHORT   usCRC16
   }   xRTUHeader
   struct {
      UBYTE   ubSlaveAddress
      UBYTE   ubLRC
   }   xASCIIHeader
   struct {
      USHORT   usMBAPTransactionId
      USHORT   usMBAPProtocolId
      USHORT   usMBAPLength
      UBYTE   ubUnitIdentifier
   }   xTCPHeader
   struct {
      USHORT   usMBAPTransactionId
      USHORT   usMBAPProtocolId
      USHORT   usMBAPLength
      UBYTE   ubUnitIdentifier
   }   xUDPHeader
x
const UBYTEubDataPayload
USHORT usDataPayloadLength


Member Enumeration Documentation

anonymous enum
 

Direction of the frame.

Enumeration values:
MB_FRAME_SEND  Frame has been sent.
MB_FRAME_RECEIVE  Frame has been received.

anonymous enum
 

Depending on the instance of the MODBUS stack different protocols can be analyzed. The implementation selects the approriate protocol and initializes the member eFrameType to this type.

Enumeration values:
MB_FRAME_RTU  Frame is a valid MODBUS RTU frame.
MB_FRAME_ASCII  Frame is a valid MODBUS ASCII frame.
MB_FRAME_TCP  Frame is a valid MODBUS TCP frame.
MB_FRAME_UDP  Frame is a valid MODbUS UDP frame.
MB_FRAME_DAMAGED  Only raw data because of invalid frame.


Field Documentation

enum { ... } xMBAnalyzerFrame::eFrameDir
 

Direction of the frame.

enum { ... } xMBAnalyzerFrame::eFrameType
 

Depending on the instance of the MODBUS stack different protocols can be analyzed. The implementation selects the approriate protocol and initializes the member eFrameType to this type.

const UBYTE* xMBAnalyzerFrame::ubDataPayload
 

In case of MB_FRAME_RTU, MB_FRAME_ASCII or MB_FRAME_TCP contains the MODBUS PDU. In case of MB_FRAME_DAMAGED contains the raw frame including the header.

USHORT xMBAnalyzerFrame::usDataPayloadLength
 

Number of bytes in ubDataPayload which can be accessed.

union { ... } xMBAnalyzerFrame::x
 

Shared structure for protocol headers. You are only allowed to access the element specified by eFrameType.


(C) 2007 Embedded Solutions. Last updated on 14 Jun 2015.