OpcUaCanOpen
CANopen OPC-UA server
|
This class ensure the communication with CanOpen node. More...
#include <CanNodeObject.h>
Inherits CanOpen::CanObject.
Public Member Functions | |
CanNodeObject (pUserDeviceStruct *interf, NODE *ca, UaNode *blink, OpcUa_UInt32 code) | |
Constructor. More... | |
virtual | ~CanNodeObject (void) |
Destructor. More... | |
virtual UaStatus | getDeviceMessage (OpcUa_UInt32 code) |
Read data From device There is no any date for this object. More... | |
virtual UaStatus | sendDeviceMessage (OpcUa_UInt32 code, UaDataValue *value=0) |
send data or command on device Abstract function to send data based on type id (buldingAutomationTypeIds.h) More... | |
void | passSDO (const CanMsgStruct *cms) |
virtual void | setState (const CanMsgStruct *cms) |
send SDO message More... | |
virtual void | setEmergencyEvent (const CanMsgStruct *cms) |
set value of nmt and bootup message More... | |
void | setRequestSDO (CanSDOObject *msdo) |
set Emergency event More... | |
void | freeRequestSDO () |
unlock SDo operation More... | |
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 | sendNG () |
send NG message for this node More... | |
void | NGComing (OpcUa_Byte st) |
Handle the ng message Set state or recover after bootup message. More... | |
void | setInitLive () |
void | decNGCounter () |
counter of missing NG message ( 0 means node disconnected ) More... | |
![]() | |
CanObject (pUserDeviceStruct *parent,::xsd::cxx::tree::type *conf, UaNode *pAS, OpcUa_UInt32 code) | |
Constructor. More... | |
virtual | ~CanObject (void) |
Destructor. More... | |
OpcUa_Byte | getCanNodeId () |
get Node Id More... | |
void | sendNMT (enum ::NMTcommand nmt) |
Send nmt message. More... | |
virtual void | setInitNmt (enum NMTcommand iNMT) |
Save initial nmt message which will send to initialize devices. More... | |
virtual void | setInitNmt (std::string sNmt) |
Save initial nmt message which will send to initialize devices. More... | |
virtual void | sendInitNmt () |
send initial nmt message More... | |
CCanAccess * | getCanBusInterface () |
get pointer to can bus interface More... | |
void | setCanBusInterface (CCanAccess *ccac) |
save pointer to can bus interface More... | |
IOManager * | getIOManager () |
![]() | |
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... | |
![]() | |
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 () |
UserDeviceStruct * | getParentDevice () |
pUserDeviceStruct * | getTopInterface () |
pUserDeviceStruct * | getParent () |
virtual void | setInvalid () |
UaNode * | getAddressSpaceEntry () |
Static Public Attributes | |
static OpcUa_Int16 | ngCounter |
static OpcUa_Boolean | DisconectRecovery |
Private Member Functions | |
void | setDisconnectedState () |
current sdo object executing sdo operation More... | |
void | setStateRecursevely (UaNode *p, bool state) |
set disconnection state 1 for node More... | |
void | setLastState () |
OpcUa_Boolean | isAlive () |
set the last state after disconnection More... | |
Private Attributes | |
UaMutex | m_mutexReqSDO |
CanSDOObject * | m_requestedSDO |
sdo mutex to protect sdo operation . should one on one moment More... | |
OpcUa_Byte | m_currentState |
OpcUa_Byte | m_lastState |
OpcUa_Int16 | m_repeatedCounter |
OpcUa::BaseVariableType * | m_state |
OpcUa::BaseVariableType * | m_iBootupCounter |
OpcUa::BaseVariableType * | m_EmergencyErrorCode |
OpcUa::BaseVariableType * | m_EmergencyCounter |
OpcUa::BaseVariableType * | m_Error |
OpcUa::BaseVariableType * | m_SpecificErrorCodeByte1 |
OpcUa::BaseVariableType * | m_SpecificErrorCodeByte2 |
OpcUa::BaseVariableType * | m_SpecificErrorCodeByte3 |
OpcUa::BaseVariableType * | m_SpecificErrorCodeByte4 |
OpcUa::BaseVariableType * | m_SpecificErrorCodeByte5 |
list< OpcUa::BaseVariableType * > | m_programList |
Additional Inherited Members | |
![]() | |
CCanAccess * | m_pCommIf |
Address of can interface. More... | |
OpcUa_Byte | m_CanNodeId |
Node Id for bus = 0. More... | |
enum NMTcommand | m_initNMTcommand |
initial NMT commands More... | |
IOManager * | m_pIOManager |
![]() | |
UaMutexRefCounted * | m_pSharedMutex |
This class ensure the communication with CanOpen node.
Can Node has unique node id.
CanOpen protocol defines several can message which cobid calculates based on nodeid.
These are emergency messages, nodeguarding and bootup messages
This object has links to UaVariable which the data are passed to
Also this object ensure the synchronization of sdo operation. Should be one operation in one moment.
Each can node has a state which is taken from NG or HB message.
Also CanNodeObject ensue to recover after rebooting or disconnection of node in proper state
Definition at line 27 of file CanNodeObject.h.
CanOpen::CanNodeObject::CanNodeObject | ( | pUserDeviceStruct * | interf, |
NODE * | ca, | ||
UaNode * | blink, | ||
OpcUa_UInt32 | code | ||
) |
Constructor.
interf | the parent interface in this case is a CanBUsObject |
ca | XML description of node properties |
blink | the UaNode which control this device |
code | function code of operation |
Definition at line 13 of file CanNodeObject.cpp.
|
virtual |
Destructor.
Definition at line 27 of file CanNodeObject.cpp.
|
virtual |
connect function code to ua node to pass data
code | function code defines the operation |
conf | configuration data to link node |
blink | ua node to pass data |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 210 of file CanNodeObject.cpp.
|
inline |
counter of missing NG message ( 0 means node disconnected )
Definition at line 105 of file CanNodeObject.h.
|
inline |
unlock SDo operation
Definition at line 63 of file CanNodeObject.h.
|
inlinevirtual |
Read data From device There is no any date for this object.
code | function code of operation |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 47 of file CanNodeObject.h.
|
virtual |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 282 of file CanNodeObject.cpp.
|
inlineprivate |
set the last state after disconnection
Definition at line 129 of file CanNodeObject.h.
|
inline |
Handle the ng message Set state or recover after bootup message.
st | state byte from ng or boot up message |
Definition at line 84 of file CanNodeObject.h.
void CanOpen::CanNodeObject::passSDO | ( | const CanMsgStruct * | cms | ) |
Definition at line 32 of file CanNodeObject.cpp.
|
virtual |
send data or command on device Abstract function to send data based on type id (buldingAutomationTypeIds.h)
code | function code |
value | data to send |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 42 of file CanNodeObject.cpp.
|
virtual |
send NG message for this node
Definition at line 200 of file CanNodeObject.cpp.
|
private |
current sdo object executing sdo operation
Definition at line 331 of file CanNodeObject.cpp.
|
virtual |
set value of nmt and bootup message
distribute emergency message can message to different items
Definition at line 147 of file CanNodeObject.cpp.
|
inline |
Definition at line 99 of file CanNodeObject.h.
|
private |
Definition at line 306 of file CanNodeObject.cpp.
|
inline |
|
virtual |
send SDO message
Definition at line 83 of file CanNodeObject.cpp.
|
private |
set disconnection state 1 for node
Definition at line 355 of file CanNodeObject.cpp.
|
static |
Definition at line 118 of file CanNodeObject.h.
|
private |
Definition at line 131 of file CanNodeObject.h.
|
private |
Definition at line 138 of file CanNodeObject.h.
|
private |
Definition at line 137 of file CanNodeObject.h.
|
private |
Definition at line 139 of file CanNodeObject.h.
|
private |
Definition at line 136 of file CanNodeObject.h.
|
private |
Definition at line 132 of file CanNodeObject.h.
|
private |
Definition at line 122 of file CanNodeObject.h.
|
private |
Definition at line 145 of file CanNodeObject.h.
|
private |
Definition at line 133 of file CanNodeObject.h.
|
private |
sdo mutex to protect sdo operation . should one on one moment
Definition at line 123 of file CanNodeObject.h.
|
private |
Definition at line 140 of file CanNodeObject.h.
|
private |
Definition at line 141 of file CanNodeObject.h.
|
private |
Definition at line 142 of file CanNodeObject.h.
|
private |
Definition at line 143 of file CanNodeObject.h.
|
private |
Definition at line 144 of file CanNodeObject.h.
|
private |
Definition at line 135 of file CanNodeObject.h.
|
static |
Definition at line 117 of file CanNodeObject.h.