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

The Class represents the properties and operations of canopen messages. More...

#include <CanPDOObject.h>

Inherits CanOpen::CanOpenObject.

Public Member Functions

 CanPDOObject (pUserDeviceStruct *par, PDO *conf, UaNode *blink, OpcUa_UInt32 code)
 CanPDOObject Constructor. More...
 
virtual ~CanPDOObject (void)
 
virtual void pass (const CanMsgStruct *)
 Pass data to item objects. More...
 
void setItem (OpcUa_Byte ch, CanPDOItem *pdoi)
 Include Item to PDO object. More...
 
virtual UaStatus getDeviceMessage (OpcUa_UInt32 commandCode)
 read data defined of function code from device Abstract function to take can messages based on type id (buldingAutomationTypeIds.h) More...
 
virtual UaStatus sendDeviceMessage (OpcUa_UInt32 code, UaDataValue *value=0)
 Send data to CAN bus. More...
 
OpcUa_UInt32 getNumberChennal ()
 
UaByteArray & getBuffer (OpcUa_Byte ch)
 
void setBuffer (UaByteArray &buf, OpcUa_Byte ch)
 
virtual void getInitRTRData ()
 
virtual UaStatus connectCode (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf, UaNode *blink)
 connect function code to ua node to pass data More...
 
virtual UaVariant getPropertyValue (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf)
 
virtual void sendRTR ()
 Send rtr message. More...
 
void addNodeId (bool type)
 add node id to base cobid of pdo More...
 
virtual void waitRTRData ()
 
- Public Member Functions inherited from CanOpen::CanOpenObject
 CanOpenObject (pUserDeviceStruct *parent,::xml_schema::type *conf, UaNode *blink, int code)
 This class defines operations for canopen protocol. More...
 
virtual ~CanOpenObject (void)
 Destructor. More...
 
CCanAccessgetCanBus ()
 
const char * getBusName ()
 
OpcUa_UInt16 getCobId ()
 
virtual bool isMsgForObject (const CanMsgStruct *)
 check if message for this object (cobId) More...
 
DirectionType getDirectionType ()
 
UaStatus waitOperation (OpcUa_UInt timeout)
 
UaStatus waitOperation ()
 
virtual void messageCame ()
 
virtual UaStatus releaseOperation ()
 
virtual UaStatus signalOperation ()
 
- Public Member Functions inherited from UserDevice::InterfaceUserDataBase
 InterfaceUserDataBase (pUserDeviceStruct *parent,::xsd::cxx::tree::type *conf, UaNode *pAS, OpcUa_UInt code)
 Constructor Also create the shared mutex which can be used to synchronize operation on device using lock/unlock function. More...
 
virtual ~InterfaceUserDataBase (void)
 Destructor. More...
 
- Public Member Functions inherited from UserDevice::UserDeviceStruct
 UserDeviceStruct (pUserDeviceStruct *parent, ::xsd::cxx::tree::type *conf, UaNode *pAS, OpcUa_UInt code)
 constructor More...
 
void lock ()
 lock shared mutex to protect More...
 
void unlock ()
 unlock shared mutex More...
 
::UaMutexRefCounted * getShareMutex ()
 get mutex More...
 
void releaseMutex ()
 
OpcUa_Int32 countMutex ()
 
virtual ~UserDeviceStruct (void)
 
OpcUa_UInt getCodeFunction ()
 
UserDeviceStructgetParentDevice ()
 
pUserDeviceStructgetTopInterface ()
 
pUserDeviceStructgetParent ()
 
virtual void setInvalid ()
 
UaNode * getAddressSpaceEntry ()
 

Protected Attributes

OpcUa_Boolean m_bInitRTR
 Send or not in start up time rtr message. More...
 
OpcUa::BaseVariableType * m_pRTRCommand
 RTR Command item. More...
 
vector< UaByteArray > m_pdoBuffer
 pdo buffer also can save the date from ELMB channels More...
 
multimap< OpcUa_Byte, CanPDOItem * > m_cPDOs
 set of items coming with this pdo More...
 
- Protected Attributes inherited from CanOpen::CanOpenObject
OpcUa_UInt32 m_iTimeout
 
UaSemaphore m_waitMessage
 
OpcUa_UInt16 m_cobId
 
DirectionType m_direction
 
OpcUa_UInt32 m_iMaxCount
 
OpcUa_UInt32 m_iCount
 
- Protected Attributes inherited from UserDevice::UserDeviceStruct
UaMutexRefCounted * m_pSharedMutex
 

Additional Inherited Members

- Public Attributes inherited from CanOpen::CanOpenObject
UaByteArray m_buffer
 
UaDateTime m_udt
 

Detailed Description

The Class represents the properties and operations of canopen messages.


Definition at line 22 of file CanPDOObject.h.

Constructor & Destructor Documentation

◆ CanPDOObject()

CanOpen::CanPDOObject::CanPDOObject ( pUserDeviceStruct par,
PDO conf,
UaNode *  blink,
OpcUa_UInt32  code 
)

CanPDOObject Constructor.

Parameters
para parent CanNode Object
confXML configuration information for this object
blinkUaNode which represent the PDO in Address space
code- function code of operation
para parent CanNode Object
confXML configuration information for this object
blinkUaNode which represent the PDO in Address space

Definition at line 20 of file CanPDOObject.cpp.

◆ ~CanPDOObject()

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

Definition at line 36 of file CanPDOObject.h.

Member Function Documentation

◆ addNodeId()

void CanOpen::CanPDOObject::addNodeId ( bool  type)

add node id to base cobid of pdo

This function used for standard ELMB distribution pdo TPDO and RPDO. In configuration file written only base number.

Definition at line 133 of file CanPDOObject.cpp.

◆ connectCode()

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

connect function code to ua node to pass data

Parameters
codefunction code defines the operation
confXML object containing the configuration information for this object
blinkua node to pass data

Implements UserDevice::InterfaceUserDataBase.

Definition at line 142 of file CanPDOObject.cpp.

◆ getBuffer()

UaByteArray& CanOpen::CanPDOObject::getBuffer ( OpcUa_Byte  ch)
inline

Definition at line 52 of file CanPDOObject.h.

◆ getDeviceMessage()

virtual UaStatus CanOpen::CanPDOObject::getDeviceMessage ( OpcUa_UInt32  code)
inlinevirtual

read data defined of function code from device Abstract function to take can messages based on type id (buldingAutomationTypeIds.h)

Parameters
codefunction code defining of operation (send command ,data or read data)

Implements UserDevice::InterfaceUserDataBase.

Definition at line 45 of file CanPDOObject.h.

◆ getInitRTRData()

void CanOpen::CanPDOObject::getInitRTRData ( )
virtual

Definition at line 93 of file CanPDOObject.cpp.

◆ getNumberChennal()

OpcUa_UInt32 CanOpen::CanPDOObject::getNumberChennal ( )
inline

Definition at line 51 of file CanPDOObject.h.

◆ getPropertyValue()

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

Implements UserDevice::InterfaceUserDataBase.

Definition at line 163 of file CanPDOObject.cpp.

◆ pass()

void CanOpen::CanPDOObject::pass ( const CanMsgStruct cms)
virtual

Pass data to item objects.

Parameters
cmsCAN message from driver

Implements CanOpen::CanOpenObject.

Definition at line 58 of file CanPDOObject.cpp.

◆ sendDeviceMessage()

UaStatus CanOpen::CanPDOObject::sendDeviceMessage ( OpcUa_UInt32  code,
UaDataValue *  value = 0 
)
virtual

Send data to CAN bus.

Implements UserDevice::InterfaceUserDataBase.

Definition at line 106 of file CanPDOObject.cpp.

◆ sendRTR()

virtual void CanOpen::CanPDOObject::sendRTR ( )
inlinevirtual

Send rtr message.

Definition at line 65 of file CanPDOObject.h.

◆ setBuffer()

void CanOpen::CanPDOObject::setBuffer ( UaByteArray &  buf,
OpcUa_Byte  ch 
)
inline

Definition at line 53 of file CanPDOObject.h.

◆ setItem()

void CanOpen::CanPDOObject::setItem ( OpcUa_Byte  ch,
CanPDOItem pdoi 
)

Include Item to PDO object.

Parameters
chindex for channel
pdoiPDO item

Definition at line 48 of file CanPDOObject.cpp.

◆ waitRTRData()

virtual void CanOpen::CanPDOObject::waitRTRData ( )
inlinevirtual

Definition at line 78 of file CanPDOObject.h.

Member Data Documentation

◆ m_bInitRTR

OpcUa_Boolean CanOpen::CanPDOObject::m_bInitRTR
protected

Send or not in start up time rtr message.

Definition at line 86 of file CanPDOObject.h.

◆ m_cPDOs

multimap<OpcUa_Byte,CanPDOItem *> CanOpen::CanPDOObject::m_cPDOs
protected

set of items coming with this pdo

Definition at line 91 of file CanPDOObject.h.

◆ m_pdoBuffer

vector<UaByteArray> CanOpen::CanPDOObject::m_pdoBuffer
protected

pdo buffer also can save the date from ELMB channels

Definition at line 90 of file CanPDOObject.h.

◆ m_pRTRCommand

OpcUa::BaseVariableType* CanOpen::CanPDOObject::m_pRTRCommand
protected

RTR Command item.

Definition at line 87 of file CanPDOObject.h.


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