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

An implementation of ControlInterface for can bus CanBusInterface is an interface class to connect OpcUa Address Space to CANOpen hardware. More...

#include <CanBusInterface.h>

Inherits UserDevice::ControlInterface.

Classes

struct  InitSet
 
class  predCanBus
 

Public Member Functions

 CanBusInterface ()
 
virtual ~CanBusInterface ()
 
virtual void closeInterface ()
 
virtual UaStatus initialize ()
 This function should be used to initialize hardware dependent part. More...
 
virtual UaStatus CreateXmlParser (UaString &sXmlFileName)
 Load the configuration from the configure file and generate node managers. More...
 
virtual pUserDeviceStructcreateInterfaceEntry (pUserDeviceStruct *parent, int code, ::xml_schema::type *conf, UaNode *pAS)
 Create interface class based on configuration information and type ID. More...
 
virtual IOManager * getIOManager (UaNode *pUaNode, OpcUa_Int32 attributeId)
 This function returns IOManager for mode and attribute
More...
 
virtual VariableHandle * getVariableHandler (Session *session, VariableHandle::ServiceType serviceType, OpcUa_NodeId *nodeid, OpcUa_Int32 attributeId)
 
virtual bool isTraceVariable (UaNodeId uaTraceId)
 
virtual void putTraceFunctions (OpcUa_DataValue *mvar)
 
virtual bool isDeviceVariable (UaNodeId uaDevVar)
 
virtual UaStatus CreateAddressSpace (AddressSpace::NmBuildingAutomation *nManager, NodeManagerNodeSetXml *pXmlNodeManager, NodeManagerConfig *pDefaultNodeManager)
 Create Address Space. More...
 
virtual UaStatus getCanTraceSettings (OpcUa_UInt32 &uMaxTraceEntries, OpcUa_UInt32 &uMaxBackupFiles, UaString &sTraceFile)
 Get UA Server can trace settings. More...
 
UaNodeId getCanNodeNodeId (UaNode *pNode)
 
UaStatus createNodeTypes ()
 
UaStatus createCanbuses ()
 create of cannode types More...
 
UaStatus createNodes (CANBUS::NODE_sequence &nd, UaControlDeviceGeneric *pcanbus)
 create of canbuses More...
 
- Public Member Functions inherited from UserDevice::ControlInterface
 ControlInterface ()
 Dummy Constructor. More...
 
virtual ~ControlInterface ()
 Destructor. More...
 
UaNodeId getTypeNodeId (OpcUa_UInt32 numericIdentifier)
 
AddressSpace::NmBuildingAutomationgetNodeManager () const
 
NodeManagerNodeSetXml * getNodeTypeManager () const
 
virtual pUserDeviceStructcreateInterfaceEntry (pUserDeviceStruct *parent, int code, ::xsd::cxx::tree::type *conf, UaNode *node)=0
 Create interface class based on configuration information and type ID. More...
 

Static Public Member Functions

static void initCalculation ()
 
static void addCalcCompilerItem (AddressSpace::UaCalcItem *ucci)
 
static UaStatus CompileItems (OpcUa::BaseObjectType *pParent, CanOpenOpcServerConfig::ITEM_sequence &itnd, CanOpenOpcServerConfig::REGEXPR_sequence &regex, NmBuildingAutomation *nManager)
 
static UaStatus createListInitmethod (CanOpenOpcServerConfig::atStartup_sequence &ex, UaControlDeviceGeneric *parent, NmBuildingAutomation *nManager)
 
static UaStatus createListInitSet (CanOpenOpcServerConfig::SET_sequence &ex, UaControlDeviceGeneric *parent, NmBuildingAutomation *nManager)
 
static UaStatus executeInitMethod ()
 
static UaStatus variableInitSet ()
 
static UaStatus createRegVariable (ITEM &itemvar, CanOpenOpcServerConfig::REGEXPR_sequence &regex, mapDataVariable &pvariables, OpcUa::BaseObjectType *pcn, OpcUa_Int32 &minVar, NmBuildingAutomation *nManager)
 

Public Attributes

UaCanTracem_Trace
 set of formulas More...
 

Static Public Attributes

static unique_ptr< CanBusAccessg_pCanaccess
 set of formulas More...
 
static list< UaDeviceMethod< UaControlDeviceGeneric > * > m_listInitMethod
 pointer to CAN interface More...
 
static list< struct InitSetm_listInitSet
 
static vector< AddressSpace::UaCalcItem * > m_vCCI
 

Private Attributes

list< CanBusObject * > m_CanBusList
 
map< OpcUa_UInt32, UserDevice::AbstractHardware * > factory
 
CanOpenOpcServerConfig::NODETYPE_sequence m_nodetypes
 XML configuration structure. More...
 
CanOpenOpcServerConfig::CANBUS_sequence m_canbuses
 list of nodes More...
 
CanOpenOpcServerConfig::ITEM_sequence m_items
 list of can-buses More...
 
CanOpenOpcServerConfig::REGEXPR_sequence m_regexprisson
 list of calculated items More...
 
CanOpenOpcServerConfig::SETTINGS_optional m_settings
 list of regular expression More...
 
CanOpenOpcServerConfig::atStartup_sequence m_execute
 server settings More...
 
CanOpenOpcServerConfig::SET_sequence m_setvalue
 server set tings More...
 
UaString m_sLocale
 server set tings More...
 
UaString m_sLogFileName
 
OpcUa_UInt32 m_uCanMaxTraceEntries
 
OpcUa_UInt32 m_uCanMaxBackupFiles
 

Additional Inherited Members

- Protected Attributes inherited from UserDevice::ControlInterface
UaString m_sXmlFileName
 
AddressSpace::NmBuildingAutomationm_pNodeManager
 
NodeManagerConfig * m_pDefaultNodeManager
 
NodeManagerNodeSetXml * m_pTypeNodeManager
 

Detailed Description

An implementation of ControlInterface for can bus CanBusInterface is an interface class to connect OpcUa Address Space to CANOpen hardware.

Definition at line 123 of file CanBusInterface.h.

Constructor & Destructor Documentation

◆ CanBusInterface()

CanOpen::CanBusInterface::CanBusInterface ( )

Definition at line 104 of file CanBusInterface.cpp.

◆ ~CanBusInterface()

CanOpen::CanBusInterface::~CanBusInterface ( )
virtual

Definition at line 118 of file CanBusInterface.cpp.

Member Function Documentation

◆ addCalcCompilerItem()

void CanOpen::CanBusInterface::addCalcCompilerItem ( AddressSpace::UaCalcItem ucci)
static

Definition at line 865 of file CanBusInterface.cpp.

◆ closeInterface()

void CanOpen::CanBusInterface::closeInterface ( )
virtual

Implements UserDevice::ControlInterface.

Definition at line 142 of file CanBusInterface.cpp.

◆ CompileItems()

UaStatus CanOpen::CanBusInterface::CompileItems ( OpcUa::BaseObjectType *  pParent,
CanOpenOpcServerConfig::ITEM_sequence itnd,
CanOpenOpcServerConfig::REGEXPR_sequence regex,
NmBuildingAutomation nManager 
)
static

temporary set of pointer to variables created

Definition at line 678 of file CanBusInterface.cpp.

◆ CreateAddressSpace()

UaStatus CanOpen::CanBusInterface::CreateAddressSpace ( AddressSpace::NmBuildingAutomation nManager,
NodeManagerNodeSetXml *  pXmlNodeManager,
NodeManagerConfig *  pDefaultNodeManager 
)
virtual

Create Address Space.

Parameters
nManager- pointer to node manager

create the can node type describing in NODETYPE section of XML file

Create Trace level variable

create the can-bus structure CANBUS section of XML file

Implements UserDevice::ControlInterface.

Definition at line 220 of file CanBusInterface.cpp.

◆ createCanbuses()

UaStatus CanOpen::CanBusInterface::createCanbuses ( )

create of cannode types

CAN bus ua node connects to top level node

Definition at line 366 of file CanBusInterface.cpp.

◆ createInterfaceEntry()

pUserDeviceStruct * CanOpen::CanBusInterface::createInterfaceEntry ( pUserDeviceStruct parent,
int  code,
::xml_schema::type conf,
UaNode *  pAS 
)
virtual

Create interface class based on configuration information and type ID.

Parameters
parent- the interface object which is a parent of creating one
code- operation code
conf- xml configuration of creating object
pAS- UaNode which take date from hardware or send commands

Definition at line 152 of file CanBusInterface.cpp.

◆ createListInitmethod()

UaStatus CanOpen::CanBusInterface::createListInitmethod ( CanOpenOpcServerConfig::atStartup_sequence ex,
UaControlDeviceGeneric parent,
NmBuildingAutomation nManager 
)
static

Definition at line 591 of file CanBusInterface.cpp.

◆ createListInitSet()

UaStatus CanOpen::CanBusInterface::createListInitSet ( CanOpenOpcServerConfig::SET_sequence ex,
UaControlDeviceGeneric parent,
NmBuildingAutomation nManager 
)
static

Definition at line 612 of file CanBusInterface.cpp.

◆ createNodes()

UaStatus CanOpen::CanBusInterface::createNodes ( CANBUS::NODE_sequence nd,
UaControlDeviceGeneric pcanbus 
)

create of canbuses

Definition at line 427 of file CanBusInterface.cpp.

◆ createNodeTypes()

UaStatus CanOpen::CanBusInterface::createNodeTypes ( )

Definition at line 332 of file CanBusInterface.cpp.

◆ createRegVariable()

UaStatus CanOpen::CanBusInterface::createRegVariable ( ITEM itemvar,
CanOpenOpcServerConfig::REGEXPR_sequence regex,
mapDataVariable pvariables,
OpcUa::BaseObjectType *  pcn,
OpcUa_Int32 &  minVar,
NmBuildingAutomation nManager 
)
static

Definition at line 784 of file CanBusInterface.cpp.

◆ CreateXmlParser()

UaStatus CanOpen::CanBusInterface::CreateXmlParser ( UaString &  sXmlFileName)
virtual

Load the configuration from the configure file and generate node managers.

First method called after creation of ServerConfig. Must create all NodeManagers before method startUp is called.

Returns
Error code.

Implements UserDevice::ControlInterface.

Definition at line 188 of file CanBusInterface.cpp.

◆ executeInitMethod()

UaStatus CanOpen::CanBusInterface::executeInitMethod ( )
static

Definition at line 636 of file CanBusInterface.cpp.

◆ getCanNodeNodeId()

UaNodeId CanOpen::CanBusInterface::getCanNodeNodeId ( UaNode *  pNode)

Definition at line 532 of file CanBusInterface.cpp.

◆ getCanTraceSettings()

virtual UaStatus CanOpen::CanBusInterface::getCanTraceSettings ( OpcUa_UInt32 &  uMaxTraceEntries,
OpcUa_UInt32 &  uMaxBackupFiles,
UaString &  sTraceFile 
)
inlinevirtual

Get UA Server can trace settings.

Returns
Error code.

Definition at line 209 of file CanBusInterface.h.

◆ getIOManager()

IOManager * CanOpen::CanBusInterface::getIOManager ( UaNode *  pUaNode,
OpcUa_Int32  attributeId 
)
virtual

This function returns IOManager for mode and attribute

Parameters
pUaNodepointer to UaN asking the IO manager
attributeIdid of attribute of node

Implements UserDevice::ControlInterface.

Definition at line 555 of file CanBusInterface.cpp.

◆ getVariableHandler()

VariableHandle * CanOpen::CanBusInterface::getVariableHandler ( Session *  session,
VariableHandle::ServiceType  serviceType,
OpcUa_NodeId *  nodeid,
OpcUa_Int32  attributeId 
)
virtual

Reimplemented from UserDevice::ControlInterface.

Definition at line 481 of file CanBusInterface.cpp.

◆ initCalculation()

void CanOpen::CanBusInterface::initCalculation ( )
static

Definition at line 850 of file CanBusInterface.cpp.

◆ initialize()

UaStatus CanOpen::CanBusInterface::initialize ( )
virtual

This function should be used to initialize hardware dependent part.

create Canbus interface

Implements UserDevice::ControlInterface.

Definition at line 48 of file CanBusInterface.cpp.

◆ isDeviceVariable()

virtual bool CanOpen::CanBusInterface::isDeviceVariable ( UaNodeId  uaDevVar)
inlinevirtual

Implements UserDevice::ControlInterface.

Definition at line 186 of file CanBusInterface.h.

◆ isTraceVariable()

virtual bool CanOpen::CanBusInterface::isTraceVariable ( UaNodeId  uaTraceId)
inlinevirtual

Reimplemented from UserDevice::ControlInterface.

Definition at line 175 of file CanBusInterface.h.

◆ putTraceFunctions()

virtual void CanOpen::CanBusInterface::putTraceFunctions ( OpcUa_DataValue *  mvar)
inlinevirtual

Implements UserDevice::ControlInterface.

Definition at line 179 of file CanBusInterface.h.

◆ variableInitSet()

UaStatus CanOpen::CanBusInterface::variableInitSet ( )
static

Definition at line 650 of file CanBusInterface.cpp.

Member Data Documentation

◆ factory

map<OpcUa_UInt32,UserDevice::AbstractHardware *> CanOpen::CanBusInterface::factory
private

Definition at line 253 of file CanBusInterface.h.

◆ g_pCanaccess

unique_ptr< CanBusAccess > CanOpen::CanBusInterface::g_pCanaccess
static

set of formulas

Definition at line 240 of file CanBusInterface.h.

◆ m_canbuses

CanOpenOpcServerConfig::CANBUS_sequence CanOpen::CanBusInterface::m_canbuses
private

list of nodes

Definition at line 261 of file CanBusInterface.h.

◆ m_CanBusList

list<CanBusObject *> CanOpen::CanBusInterface::m_CanBusList
private

Definition at line 252 of file CanBusInterface.h.

◆ m_execute

CanOpenOpcServerConfig::atStartup_sequence CanOpen::CanBusInterface::m_execute
private

server settings

Definition at line 265 of file CanBusInterface.h.

◆ m_items

CanOpenOpcServerConfig::ITEM_sequence CanOpen::CanBusInterface::m_items
private

list of can-buses

Definition at line 262 of file CanBusInterface.h.

◆ m_listInitMethod

list< UaDeviceMethod< UaControlDeviceGeneric > * > CanOpen::CanBusInterface::m_listInitMethod
static

pointer to CAN interface

Definition at line 242 of file CanBusInterface.h.

◆ m_listInitSet

list< struct CanBusInterface::InitSet > CanOpen::CanBusInterface::m_listInitSet
static

Definition at line 247 of file CanBusInterface.h.

◆ m_nodetypes

CanOpenOpcServerConfig::NODETYPE_sequence CanOpen::CanBusInterface::m_nodetypes
private

XML configuration structure.

Definition at line 260 of file CanBusInterface.h.

◆ m_regexprisson

CanOpenOpcServerConfig::REGEXPR_sequence CanOpen::CanBusInterface::m_regexprisson
private

list of calculated items

Definition at line 263 of file CanBusInterface.h.

◆ m_settings

CanOpenOpcServerConfig::SETTINGS_optional CanOpen::CanBusInterface::m_settings
private

list of regular expression

Definition at line 264 of file CanBusInterface.h.

◆ m_setvalue

CanOpenOpcServerConfig::SET_sequence CanOpen::CanBusInterface::m_setvalue
private

server set tings

Definition at line 266 of file CanBusInterface.h.

◆ m_sLocale

UaString CanOpen::CanBusInterface::m_sLocale
private

server set tings

Definition at line 268 of file CanBusInterface.h.

◆ m_sLogFileName

UaString CanOpen::CanBusInterface::m_sLogFileName
private

Definition at line 269 of file CanBusInterface.h.

◆ m_Trace

UaCanTrace* CanOpen::CanBusInterface::m_Trace

set of formulas

Definition at line 249 of file CanBusInterface.h.

◆ m_uCanMaxBackupFiles

OpcUa_UInt32 CanOpen::CanBusInterface::m_uCanMaxBackupFiles
private

Definition at line 271 of file CanBusInterface.h.

◆ m_uCanMaxTraceEntries

OpcUa_UInt32 CanOpen::CanBusInterface::m_uCanMaxTraceEntries
private

Definition at line 270 of file CanBusInterface.h.

◆ m_vCCI

vector< AddressSpace::UaCalcItem * > CanOpen::CanBusInterface::m_vCCI
static

Definition at line 248 of file CanBusInterface.h.


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