OpcUaCANOPENSERVER3

Henk Boterenbrood
Benjamin Farnham
Vyacheslav Filimonov
Sebastien Franz
Piotr Nikiel
Jolanta Olszowska
Stefan Schlenker
OpcUaCanOpenServer
Program interface between CANopen device
and SCADA system OPC UA client
Readout Platform
Standalone
OPC UA Client
WinCC OA
OPC UA Client
SCADA
WinCC OA
OPC UA Protocol
via TCP/IP
OPC UA CANopen Server
HW Component
OS Function Calls
CAN Driver Type X
CAN Driver Type Y
CAN Driver Type Z
ComponentSpecific Messages
CAN Hardware
Interface Type X
Field
Overview
Distributed
SCADA
CAN Hardware
Interface Type Y
CAN Hardware
Interface Type Z
ELMB
ELMB
CANopen Device
node_id=1
node_id=1
node_id=1
ELMB
node_id=2
ELMB
node_id=n
ELMB
node_id=2
CANopen Device
node_id=2
ELMB
CANopen Device
node_id=n
node_id=k
via e.g.
USB, Ethernet, PCIe
CANopen
Messages
via CAN Bus
 Support
all general CANopen protocol objects and
operations (NMT,SDO,PDO,NG, Emergency, Sync…)
 Segmented
 ELMB
SDO
extensions
 Event-driven
 Hardware
 Linux
processing of calculation items
driver plugins
and Windows
Main Features

Support most of OPC UA features

Data Access

Alarm & Event

Historical trend

Security

SOAP interface is absent (in C++ version)

Windows & Linux

Good Documentation

Source code

WINCC OA OpcUaClient was written using this toolkit

Toolkit and UA stack – same developers (Ascolab)
Unified Automation C++
OPC UA Toolkit
notifications
HW-specific
OPC UA
Address
Space
commands
OPC UA Client
Address Space
Interface
Driver
Component
Codebase:
read/write data
OPC UA Stack
CAN
Interface
send/receive messages
OPC UA Server
CANopen
Interface
Can Interface
Architecture
Configuration
Node
Manager
Custom
XSD Configuration
OPC UA toolkit

Schema document predefined

Code Synthesis XSD tool

Linux, Windows

Open Source

Utility to create the parser code

Very simple configuration C++ classes
for parsing XML file

Automatic syntax checking
Configuration
<xs:complexType name="CanOpenOpcServerConfig">
<xs:sequence>
<xs:element name="NODETYPE“ type="NODETYPE"
minOccurs="0” maxOccurs="unbounded"/>
<xs:element name="CANBUS" type="CANBUS"
minOccurs="0“ maxOccurs="unbounded"/>
<xs:element name="REGEXPR" type="REGEXPR"
minOccurs="0“ maxOccurs="unbounded"/>
<xs:element name="ITEM" type="ITEM"
minOccurs="0“ maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
 Include
 Check
 Node
file
syntax
types
 Calculation
items
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE CanOpenOpcServerConfig [<!ENTITY ELMB SYSTEM
".\OPCUA_nodeType_ELMB.xml">]>
<CanOpenOpcServerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xsi:noNamespaceSchemaLocation="..\Configuration\CANOpenServerConfig.xsd">
&ELMB;
<CANBUS speed="125000" port="14" type="st" name="Bus_1” nmt = “start">
<NODEGUARD interval="0"/>
<SYNC interval="0"/>
<NODE type="ELMB" name="ELMB_1" nodeid="1">
<REGEXPR name ="$VAL1" value="TPDO3\.Value\_\d*[13579]"/>
<REGEXPR name ="$VAL2" value="TPDO3\.Value\_\d*[02468]"/>
<ITEM name="Temp" value="($VAL1+$VAL2)/2" when="$VAL1"/>
</NODE>
<NODE type="ELMB" name="ELMB_11" nodeid="11"/>
</CANBUS>
</CanOpenOpcServerConfig>
XML Configuration – Example
<?xml version="1.0" encoding="UTF-8" ?>
<NODETYPE name="ELMB" >
<SDOITEM subindex="0" access="R" type="byte" index="1001" name="NodeError" />
<SDO index="100A" name="elmbSw" >
<SDOITEM subindex="0" access="R" type="UInt32" name="swVersion" />
<SDOITEM subindex="1" access="R" type="UInt32" name="swMinorVersion" />
</SDO>
<TPDO1 access="R" name="TPDO1" cobid="180" rtr = "init">
<PDOITEM bit="0" type="bit" name="di_F_0" byteindex="0" />
<PDOITEM bit="1" type="bit" name="di_F_1" byteindex="0" />
</TPDO1>
<TPDO3 access="R" numch="64" name="TPDO3" cobid="380" >
<PDOITEM type="byte" name="Flag" byteindex="1" />
<PDOITEM type="UInt32" name="Value" byteindex="2" />
</TPDO3>
</NODETYPE>
XML Configuration – Node Type Example
 Possible
Client
Operations
1.
Read (Single query)
2.
WinCCOA: Polling
(read periodically set of
Items)
3.
Write (dpSet)
4.
Subscription
 OpcUa
Server
Operations
A.
Read
 Callback – PDO, Emergency…
UaVariable_Value_CacheIsSource

IOManagerSDO: one thread per node, allows to
send/receive data in parallel to/from different nodes
UaVariable_Value_Cache
B.
Write
 IOManager SDO: one thread per node .
 IOManagerPDO: one thread per bus
C.
Monitoring
 PDO, Calculation Item … (Default IOManager)
Client-Server-Interaction
 Linux


SocketCan – used in production
Native Kvaser driver
 Windows



Systec
Peak PCAN
Kvaser
class CCanAccess {
public:
CCanAccess() {};
virtual bool createBUS(const char *, const char *) = 0 ;
virtual bool sendRemoteRequest(short ) = 0;
virtual bool sendMessage(short, unsigned char, unsigned char *) = 0;
char *getBusName() { return busName; }
virtual ~CCanAccess() {};
Readout Interface
Plugins
boost::signals2::signal<void (const canMessage &)>
canMessageCame;
boost::signals2::signal<void (const int, const char *, timeval &)>
canMessageError;
protected:
char *busName;
}
 Current
version 2.0.2-1
 Production:

OpcUaCanOpenServer working on >15 ATLAS
projects

CIC ~40 busses, 300 ELMBs

TGC & MDT ~100 busses, 3000 ELMBs

Until end of 2014 to be installed on all ATLAS
projects with ELMB readout

All under Linux with SocketCAN interface and
SYSTEC hardware
 Documentation:
Status
doxygen