OPC UA Solutions for GBT-SCA



Introduction

The GBT slow control adapter (GBT-SCA) will be used in ATLAS upgrade projects to interface on-detector electronics with the counting room back-end control systems. GBT link connect the detector front-ends with the FELIX systems. FELIX in turn will be connected to a dedicated OPC UA server process which allows bi-directional communication via OPC UA clients on the ATLAS control network. Clients should include run control and detector control applications.

~Regular meetings on this project are held Thursdays 10-11h. Indico events can be found within the FELIX category marked as "OPC UA for GBT-SCA and FELIX".

Architecture

SCA Software package

A comprehensive SCA communication library has been developed. It is known as the "SCA Software". At the moment it is hosted at CERN's gitlab:

atlas-dcs-common-software / ScaSoftware

The SCA Software is composed of several modules described below.

HDLC Back-end abstraction

A provider of HDLC connectivity to an SCA has been called "a HDLC back-end". In order to keep the SCA Software flexible, back-end is an interface (in terminology of object-oriented programming), and multiple concrete implementations may (and do) exist. Please have a look at include/Hdlc/Backend.h for a declaration of the interface.

Simulator Back-end

The SCA Software aims to provide a SCA Simulator which (ideally) would behave like a real SCA. At the moment the simulator is very functional and follows all existing features of the API.

The simulator itself is one of implementations of HDLC back-end; what it does is replying to request frames obtained from the back-end. More details on how to use are described in [ TODO ].

FELIX Back-end

TODO: netio backend.

SCA-USB Back-end

The SCA-USB backend consists of three boards allowing communication with an SCA ASIC via a USB port. The boards are the following:

  • a Digilent Genesys evaluation board
  • a GBT-SCA Demo board
  • a GBT-SCA daughter board with the SCA ASIC

The setup was provided by the GBT group and was used for the initial SCA ASIC evaluation. The Genesys board houses a Virtex-5 FPGA which is programmed with a firmware facilitating the communication with the SCA. Various tools and the firmware that was provided can be found here.

For the communication with the evaluation board over USB, the Digilent Adept 2 solution is used. The firmware takes care of the HDLC traffic packing/unpacking and uses a wishbone bus controller to drive the SCA HDLC data to the SCA ASIC eports via the "Elink Master" IP core. The architecture is shown in the following picture.

SCA_USB_Backend.png</verbatim>

In order for the ScaSoftware to communicate with the SCA ASIC over the described layers, it uses a complex multi-wrapping scheme. It takes care of the encapsulation of SCA HDLC frames into wishbone frames which are encapsulated into low level DEPP transactions.

SCA API

The SCA API is a part of the SCA software which provides a high-level API to communicate with SCA. It could be illustrated by the following excerpt from one of included demonstrator programs called "StandaloneAdcSimulation" (to be found in Demonstrators directory). The program simply displays the value of SCA's ADC channel 31 (internal temperature) in an infinite loop.

 Sca::Sca sca ("sca-simulator://1") ;

 while (1)
 {
 auto value = sca.adc().convertChannel(31);
 LOG(Log::INF) << "obtained value " << value;
 usleep(100000);
 }



The program is probably self-explanatory apart from the literal used for SCA address: "sca-simulator://1".

A SCA Address is composed of backend description and a specific part, joined by "://". The table below explains formats of SCA addresses:

Back-end type Back-end address Specific address Example address
SCA Simulator sca-simulator An unique number of simulated SCA. There is no limit in the number of simulated SCAs.
An instance of simulated SCA is created the first time it is requested.

sca-simulator://1
sca-simulator://2

sca-simulator://100

SCA-USB Test Board sca-usb A name identifying your Digilent FPGA board in the system. So far we only saw "Genesys". sca-usb://Genesys
"Simple netio backend" simple-netio

A backend that passes the HDLC Payload encapsulated in netio framed. This is the actually chosen
format to talk to the FELIX. Please note that at the moment FELIX's mapper as well as the meta data

are not supported.

Please note the endpoint gives the port number of request receivers. It is assumed that replies can be

subscribed to on a port which is one up.

simple-netio://127.0.0.1:13453

Building the SCA Software

CMake is used to build the SCA Software.

There are two modes in which the SCA Software can be built: "stand-alone" and "as-component", they depend on value of CMake flag called STANDALONE_SCA_SOFTWARE.

The first mode, "stand-alone" is appropriate for obtaining an independent library (.h/.so/.a) and for building the demonstration programs. There is a convenience script in the main directory called "build_standalone.sh".

The second mode makes sense when the SCA Software should be a part of a bigger software project build and inherit build settings from the parent project. A prime example of such use case is when building the OPC-UA SCA Server, in which SCA Software is a component providing SCA connectivity. For such usage it is sufficient that you "refer to" the SCA Software project from parent CMake (using "add_subdirectory" statement). Please have a look at OpcUaScaServer main CMakeLists.txt for an example.

Please note that some C++11 features are used. It is sufficient though to use the devtoolset-2 package which can be easily installed in SLC6 and CC7. Moreover, boost libraries are used (1.48 and above should work fine). An example to build the standalone version under devtoolset-2:

scl enable devtoolset-2 bash
./build_standalone.sh

OPC UA Server

The server is at:

https://gitlab.cern.ch/atlas-dcs-opcua-servers/ScaOpcUa

The contact people to building the OPC-UA server for SCA are Stefan Schlenker, Paris Moschovakos and Piotr Nikiel

OPC UA client in Python

You can use a simple, text-based OPC-UA client in Python to connect to the server and perform write/read/monitor etc operations.

The code is at:

https://gitlab.cern.ch/atlas-dcs-common-software/ScaOpcUaPythonClient Download tar.gz

Look into client.py - inside you will find the addresses which are polled by the sample client. When you run run.sh it will run by default client.py which is good for reading values, e.g. from ADC. Another interesting example is how to send a vector of data, e.g. for SPI or JTAG.

You can find an example in write_vectors_of_data.py and you can run it the following way: ./run.sh write_vectors_of_data.py

To run the code, you will need the PyUAF package. You can grab it from here: https://cernbox.cern.ch/index.php/s/F061wBPrRLo1oq4 . The last resort contact person for obtaining PyUAF is Piotr Nikiel.

Installing from RPM is the preferred method, however if you can't install the RPM (i.e. you didn't manage to convince your system admin that it's good for you), you can just unpack the RPM:

rpm2cpio PyUAF -v1.10-0.x86_64.rpm | cpio -idmv

If you don't install from the RPM, then in run.sh (from the git repo above) fix the PYTHONPATH to match the place where you unpacked the rpm.

Prototype Development Progress and Notes

SCA Evaluation Board tests @NSW vertical slice setup

(Mini)FELIX integration

Integration tests

NSW vertical slice 12/2016

The setup that was used to test the path to and from the SCA were:

ScaSoftware -> NetIO -> FelixCore -> Felix Firmware (fiber)--> VLDB GBTx --(elink)--> VLDB SCA > devices to be controlled

1. To ScaSoftware: Used low level tools to force SCA send an HDLC frame. Frame captured and propagated to ScaSoftware. (Done once, could not reproduce)

2. From ScaSoftware: Used SCA API to produce some GPIO traffic to control the LEDs on VLDB. That was successful!

There were some difficulties to get replies from the SCA after each request send.

NSW vertical slice 03/2017

1. Incorporate and validate part of HDLC encoding (U-frames and FCS) in the SCA Software

  • Done and demonstrated
  • Established communication with VLDB's SCA via SCA API

2. Control LED and push buttons via SCA GPIO interface

  • demonstrated via SCA API
  • demonstrated via OPC-UA server (UA Expert)
  • demonstrated via WinCC -OA with a "VLDB demo" panel
  • demosntrated in VLDB
  • demonstrated in Router board
  • demosntrated in Pad Trigger board

3. Read SCA temperature / voltage level via SCA ADC interface

  • demonstrated via SCA API
  • demonstrated via OPC-UA server (UA Expert)
  • demonstrated in WinCC -OA with an ADC demo trend (change voltage level via potentiometer)
  • demonstrated in VLDB
  • demonstrated in Router board
  • demosntrated in Pad Trigger board
  • demonstrated with current source enabled

4. Communication with the SPI interface

  • demonstrated via SCA API
  • demonstrated via OPC-UA server (UA Expert)
  • demonstrated in VLDB
  • demonstrated in USTC demo board
  • demonstrated a VMM3 configuration

5. Performance measurements for various SCA operations

  • GPIO get register, ADC set input line, ADC conversion, SPI write (128bits) operation
  • Findings have been circulated showing a big overhead when OPC-UA server is sitting on the network

NSW vertical slice 06/2017

List of proposed OPC UA integration tests

Related Documents

  • Requirements doc
  • Initial presentation on the vertical slice development
  • Verification document for registers endianness, bytes position and bits orientation against an actual SCA ship

Notes on performance measurements

Here

The SCA OPC-UA User Guide


Major updates:
-- StefanSchlenker - 2016-10-12


Responsible: StefanSchlenker


Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng SCA_OPC_UA_Vertical_Slice.png r1 manage 42.0 K 2016-10-12 - 17:20 StefanSchlenker  
PNGpng SCA_USB_Backend.png r2 r1 manage 168.8 K 2016-10-28 - 19:26 ParisMoschovakos SCA-USB backend (GBT group SCA evaluation setup)
Edit | Attach | Watch | Print version | History: r16 < r15 < r14 < r13 < r12 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r16 - 2019-07-19 - PiotrNikiel
No permission to view Atlas.WebLeftBar
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Atlas All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback