Introduction

The Function Control Framework Simulator (FcfSim) is a python SDK used for integrating device simulators. The main purpose of FcfSim is to emulate, on the instrument workstation, the physical devices that are normally controlled from a PLC.

To do so, FcfSim deploys a real OPC-UA server inside its host application (running on the instrument workstation), exposing the same interface as the one provided by the PLC. The emulated devices behave sufficiently like the real ones to carry out the basic operations of the device. This makes it possible to run an integration test of the instrument software without the availability of a ‘physical’ PLC or hardware — useful, e.g., for autonomous tests running in Jenkins, and during development.

However, because FcfSim is layered into several modules, it can also be used to build any application involving an OPC-UA server and an optional state machine.

FcfSim also provides simulators for the standard devices; they have the same state machine as is implemented on the PLC as well as the same OPC-UA interface.

Scope

The scope of this manual is developers integrating device simulator solutions, or any application involving an OPC-UA server and/or an SCXML state machine.

Main Deliverables

In this version of FcfSim, the following main deliverables are provided:

  • The python FcfSim SDK, used to integrate (develop) simulator solutions.

  • The fcfsimServer executable to run any simulator(s).

  • A FcfSim manager: a configurable simulator which includes other simulators. Used to run several device simulations in one python kernel (one fcfsimServer).

  • A “generic” simulator which works out of the box with configuration only but no business logic.

  • Standard device simulators: Adc, Drot, Motor, Lamp, Piezo, Shutter, IODev.

The package and its SDK is split in different components, it can also be used as a framework to build any application involving an OPC-UA server with or without scxml4py state machine.

Disclaimer

FcfSim is under active development and is being prepared for release. Modifications may be introduced in future releases that are not necessarily backwards compatible.

Acronyms

Acronym

Description

ADC

Atmospheric Dispersion Compensator

CCS

Central Control System

DROT

De-Rotator

ELT

Extremely Large Telescope

FCF

Function Control Framework

FcfSim

Function Control Framework Simulator

HW

Hardware

OPC UA

Open Platform Communications Unified Architecture

PLC

Programmable Logic Controller

RPC

Remote Procedure Call (an OPC UA method call)

SCXML

State Chart XML

SDK

Software Development Kit

TMC

TwinCAT Module Class (Beckhoff PLC model file)

Nomenclature

Term

Description

Device Engine

The Python class implementing a simulator’s business logic (its data and methods). Knows nothing about OPC UA directly.

Simulator Interface

Links a Device Engine to the OPC UA server: builds and connects the nodes, and declares the threads (runners) the server runs. A standard ServerInterface is provided and suffices for most simulators.

Factory

A function f(cfg: dict) -> IServerInterface named in the configuration file; fcfsimServer calls it to build the interface for a device.

Runner

A unit of asynchronous work (a thread/task) declared by a simulator and executed by the server — e.g. a cyclic business- logic task or a state-machine loop.

Manager (mgr)

A simulator that runs several device simulators in one process / one fcfsimServer instance.

Generic simulator

A configuration-only simulator (no business logic) provided for quick prototyping.

Profile

The description of a device’s OPC UA namespace (nodes, methods), declared either via Python class annotations/decorators or in a YAML namespace file.