OpcUaCanOpen
CANopen OPC-UA server
CanOpen::CanPDOItem Class Reference

The Class defines the basic operation of any item which takes data from CAN pdo message and put date into CAN pdo message. More...

#include <CanPDOItem.h>

Inherits CanOpen::CanOpenItem.

Public Member Functions

 CanPDOItem (pUserDeviceStruct *parent, PDOITEM *conf, UaNode *pAS, OpcUa_UInt32 code)
 Constructor. More...
 
 CanPDOItem ()=default
 
virtual UaVariant UnPack ()
 retrieve value from can pdo message More...
 
virtual UaStatus pack (const OpcUa_Variant *)
 put value to can pdo message More...
 
virtual ~CanPDOItem (void)
 Destructor. More...
 
virtual void setItemValue ()
 Write value to UaVariable. More...
 
void setIndex (OpcUa_Byte i)
 set channel number More...
 
OpcUa_Byte getIndex ()
 
OpcUa_Byte getStartByte ()
 
OpcUa_Byte getBit ()
 
CanPDOObjectgetCanPDOObject ()
 
virtual UaStatus connectCode (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf, UaNode *blink)
 
virtual UaVariant getPropertyValue (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf)
 
virtual UaStatus write (UaDataValue &udv)
 Send value to can bus. More...
 
virtual UaStatus read ()
 function does not use More...
 
- Public Member Functions inherited from CanOpen::CanOpenItem
 CanOpenItem (pUserDeviceStruct *parent,::xml_schema::type *conf, UaNode *pAS, OpcUa_UInt code)
 
 CanOpenItem ()=default
 
virtual ~CanOpenItem (void)
 
virtual UaStatus getDeviceMessage (OpcUa_UInt32 commandCode)
 
virtual UaStatus sendDeviceMessage (OpcUa_UInt32 code, UaDataValue *value=0)
 
- Public Member Functions inherited from CanOpen::UserDeviceItem
 UserDeviceItem (UserDataBase *parrent,::xml_schema::type *conf, UaNode *pAS, OpcUa_UInt code)
 
virtual ~UserDeviceItem (void)
 

Protected Attributes

OpcUa_Byte m_Index
 Channel number for ELMB for normal PDO = 0. More...
 
OpcUa_Byte m_startByte
 initial byte of date More...
 
OpcUa_Byte m_numBit
 fir bit type bit number in byte More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CanOpen::CanOpenItem
static UaStatus convertOpcUaType (const OpcUa_Variant *sData, OpcUa_Variant *oData, OpcUa_BuiltInType bType)
 

Detailed Description

The Class defines the basic operation of any item which takes data from CAN pdo message and put date into CAN pdo message.

Definition at line 19 of file CanPDOItem.h.

Constructor & Destructor Documentation

◆ CanPDOItem() [1/2]

CanOpen::CanPDOItem::CanPDOItem ( pUserDeviceStruct parent,
PDOITEM conf,
UaNode *  pAS,
OpcUa_UInt32  code 
)

Constructor.

Parameters
parent- pointer on parent CanPdoObject
conf- XML configuration entry for this item
pAS- pointer to UaNode to pass data
code- function code of operation

start byte in can message

bit position in byte

Definition at line 8 of file CanPDOItem.cpp.

◆ CanPDOItem() [2/2]

CanOpen::CanPDOItem::CanPDOItem ( )
default

◆ ~CanPDOItem()

virtual CanOpen::CanPDOItem::~CanPDOItem ( void  )
inlinevirtual

Destructor.

Definition at line 35 of file CanPDOItem.h.

Member Function Documentation

◆ connectCode()

UaStatus CanOpen::CanPDOItem::connectCode ( OpcUa_UInt32  code,
::xsd::cxx::tree::type *  conf,
UaNode *  blink 
)
virtual

Reimplemented from CanOpen::CanOpenItem.

Definition at line 321 of file CanPDOItem.cpp.

◆ getBit()

OpcUa_Byte CanOpen::CanPDOItem::getBit ( )
inline
Returns
initial bit in byte for this item

Definition at line 47 of file CanPDOItem.h.

◆ getCanPDOObject()

CanPDOObject * CanOpen::CanPDOItem::getCanPDOObject ( )
Returns
pointer to CanPDOObject

Definition at line 69 of file CanPDOItem.cpp.

◆ getIndex()

OpcUa_Byte CanOpen::CanPDOItem::getIndex ( )
inline
Returns
channel number

Definition at line 43 of file CanPDOItem.h.

◆ getPropertyValue()

UaVariant CanOpen::CanPDOItem::getPropertyValue ( OpcUa_UInt32  code,
::xsd::cxx::tree::type *  conf 
)
virtual

Reimplemented from CanOpen::CanOpenItem.

Definition at line 351 of file CanPDOItem.cpp.

◆ getStartByte()

OpcUa_Byte CanOpen::CanPDOItem::getStartByte ( )
inline
Returns
initial byte of can message for this item

Definition at line 45 of file CanPDOItem.h.

◆ pack()

UaStatus CanOpen::CanPDOItem::pack ( const OpcUa_Variant *  sData)
virtual

put value to can pdo message

Pack data from item to can message.

Parameters
sDatadata to pack

Reimplemented from CanOpen::CanOpenItem.

Definition at line 84 of file CanPDOItem.cpp.

◆ read()

virtual UaStatus CanOpen::CanPDOItem::read ( )
inlinevirtual

function does not use

Reimplemented from CanOpen::CanOpenItem.

Definition at line 59 of file CanPDOItem.h.

◆ setIndex()

void CanOpen::CanPDOItem::setIndex ( OpcUa_Byte  i)
inline

set channel number

Definition at line 41 of file CanPDOItem.h.

◆ setItemValue()

void CanOpen::CanPDOItem::setItemValue ( )
virtual

Write value to UaVariable.

Definition at line 305 of file CanPDOItem.cpp.

◆ UnPack()

UaVariant CanOpen::CanPDOItem::UnPack ( )
virtual

retrieve value from can pdo message

Reimplemented from CanOpen::CanOpenItem.

Definition at line 218 of file CanPDOItem.cpp.

◆ write()

UaStatus CanOpen::CanPDOItem::write ( UaDataValue &  udv)
virtual

Send value to can bus.

Parameters
udvvalue to send
Returns
error code

Reimplemented from CanOpen::CanOpenItem.

Definition at line 74 of file CanPDOItem.cpp.

Member Data Documentation

◆ m_Index

OpcUa_Byte CanOpen::CanPDOItem::m_Index
protected

Channel number for ELMB for normal PDO = 0.

Definition at line 62 of file CanPDOItem.h.

◆ m_numBit

OpcUa_Byte CanOpen::CanPDOItem::m_numBit
protected

fir bit type bit number in byte

Definition at line 64 of file CanPDOItem.h.

◆ m_startByte

OpcUa_Byte CanOpen::CanPDOItem::m_startByte
protected

initial byte of date

Definition at line 63 of file CanPDOItem.h.


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