OpcUaCanOpen
CANopen OPC-UA server
|
OpcUaCanOpenServer is a program interface between CanOpen devices and any SCADA system having OpcUa client.
The server has been developed by using Unified Automation (UA) C++ toolkit.
The server creates the address space and hardware connection objects based on XML configuration file.
XSD technology is used to check syntax of XML configuration file.
The installation rpm package is used to install all needed files
The general form to start server is
./OpcUaCanOpenServer "configuration file name".xml.
If the XML file name is omit the default configuration file name is used (OPCUACANopenServer.xml)
./OpcUaCanOpenServer -cs
This form is used to create the OPC server certificate. The post script of rpm uses this form.
Also during start up it is possible to point out the log file
./OpcUaCanOpenServer "configuration file name.xml" -l "log file name".log
the relative and absolute path can be used<br>
The OpcUaCanOpenServer address space have the "TraceLevel" item. This Item defines what kind of CANOpen message will be store.
In order to start store the following value can be written in this item:
This is bit code it mains that in case value = 3 the Pdo And Sdo message will be put in log file
The OpcUaCanOpen server is configured based on the XML file.
The description of this file can be found Config File . The parser of XML file has been prepared using the "Code Sythis" xsd utility. This utility can create the parser classes based on XSD file which can be easily used to create internal object structure to further processing.
The name of XSD file for this server is CANOpenServerConfig.xsd.
OpcUa toolkit proposes to create the address space by overwriting the function afterStartup of NodeManager class.
The Address space is a set of UaNode which must have unique node id. The creation was done in two steps:
There are two generic class:
There are two types of objects representing the the can bus system
All objects have a standard constructor with parameters:
Also any CanObject must have connectCode(OpcUa_UInt32 code,UaNode *blink). This function connects a function code with UaVariable if this object have to take care about it.
The class CanBusInterface is a broker class which has only on function createInterfaceEntry(UserDataBase* parent, int code, ::xml_schema::type* conf , UaNode* pAS).
This function based on function code create the proper canopen class.
if the broker has no information about which class has to be created it call cannectCode function of parent to take care about this link. The createInterfaceEntr returns the pointer on object which has the standard interface functions:
The main structure of of CanOpen readout system is shown below.
Can interface component is hardware dependent class. The server downloads it during startup depend on hardware using at the system.
It is possible to use different can cards and driver in one system br<> The Can object sends can messages or send rtr message via interface class and receive date from callback class.