Check out the latest updates! View News & events

Cosylab Logo Cosylab Logo
  • Solutions
    • Radiation therapy
      Enable the best cancer care, streamline workflows, treat more patients and reduce your development risks and time-to-market with our innovative, integrable software.
      Read more
    • Fusion
      Fusion projects are dynamic environments, and success is measured in milestones. Our experts in control, prototyping, diagnostics and subsystems development can help your project stay on track.
      Read more
    • Quantum
      Bring your quantum system to the market sooner with our control system components and integration while focusing on core innovation! Industrial quality and dependability hardware and firmware are our business.
      Read more
    • Accelerators
      With decades of experience in control systems for all particle accelerator types, we can help you mitigate development risk, shorten delivery time and reduce the total cost of ownership.
      Read more
    • Complex medical devices
      Leverage our vast engineering expertise in developing complex medical software to bring your innovative device to the market and patients sooner.
      Read more
    • Semiconductor
      Gain some breathing space while shortening development cycles with our advanced software and electronics engineering solutions
      Read more
    • Space
      Let us help you develop top-class software systems for your scalable space missions faster, reducing risk and time-to-market in a highly regulated environment.
      Read more
    • Astronomy
      Astronomy projects are increasing in cost and complexity while timelines are shortening. You can count on us to provide well-designed, standards-based software to reduce your project's risk.
      Read more
  • Customer stories
  • Expertise
  • About us
  • Careers
  • Blog
  • News & events
Get in touch
  • sl
  • en
  • zh
  • ja
Get in touch
  • sl
  • en
  • zh
  • ja

Solutions

(121 results)

Search Result Image
Space
Bring your space mission to life with expert engineering force
Search Result Image
Expertise
Bring your space mission to life with expert engineering force
Search Result Image
Some space solution
Bring your space mission to life with expert engineering force

Articles

(21 results)

Search Result Image
Article about space
Bring your space mission to life with expert engineering force
Search Result Image
Article about space
Bring your space mission to life with expert engineering force
Search Result Image
Article about space
Bring your space mission to life with expert engineering force
Search Result Image
Article about space
Bring your space mission to life with expert engineering force
Search Result Image
Article about space
Bring your space mission to life with expert engineering force

Content

(21 results)

Search Result Image
Content about space
Bring your space mission to life with expert engineering force
View all results
  1. Homepage
  2. LabVIEW and Accelerator Control Systems

LabVIEW and Accelerator Control Systems

Publish date:
28. October 2021
Category:
Accelerators Big science Industry Technology
Author:
ROK VINTAR
Every particle accelerator must have a commanding system that controls and monitors hundreds of various devices and subsystems with sub-microsecond synchronisation. Good architecture and design is the key to building modular, scalable, maintainable, and testable software. This is especially true for large systems such as control systems for accelerators which require high uptime, reliability and scalability for long term operation and future upgrades. Therefore, the accelerator control system (ACS) is an extensive and complex piece of software that must supervise the correct and safe performance of all devices integrated into the machine. The system has to guarantee dependability, stability and performance. It must also be extensively modular and configurable to meet new current and especially future demands.
LabVIEW and Accelerator Control Systems
Share:
  • Facebook
  • Instagram
  • Twitter

Graphical Versus Traditional Programming

Our teams develop full-stack control systems using the usual programming languages in the domain, such as VHDL, C++, C# and Java, but we also leverage the unique capabilities of LabVIEW.

The latter is a system-design tool and development environment for visual programming from NI. The environment has a graphical language and runs on Microsoft Windows, Unix, Linux, and macOS. Engineers typically use LabVIEW for instrument control, data acquisition, and industrial automation. Specific customers that rely heavily on NI hardware, for example, in the accelerator community, stipulate the use of LabVIEW for their device and systems integrating, so we comply — and in other cases may even advise it ourselves. In some instances, whole accelerator control systems are built with LabVIEW.

Relatively simple basic visual programming concepts of LabVIEW allows non-programmers to build programs by dragging and dropping virtual representations of simple laboratory devices. Advanced LabVIEW shops, however, employ more demanding LabVIEW programming for creating larger, distributed and self-sufficient applications using LabVIEW object-oriented programming (LVOOP) and other more complex programming concepts.

A Typical Cosylab Accelerator Control System

We usually design accelerator control systems with a three-tier architecture:

  • Presentation tier – presents and handles user interaction;
  • Service tier – is composed of services, such as alarm handling, archiving;
  • Equipment tier – integrates devices and subsystems (in our example, based on LabVIEW);

The Equipment tier is comprised of a set of distributed services responsible for the integration of devices and subsystems. It takes care of both business logic as well as the communication of disparate subsystems and devices.

The Old Way of Creating God Classes

We typically observe in our integration projects, also where we use LabVIEW, that we can continually improve, refactor and optimise our development approach, replacing past practice.

In the past, we would usually create one big (god) class per device/subsystem type, whose methods represent values in the system (data points), such as set_voltage, set_acceleration, get_voltage, get_alarm, clear_alarm.

For example, as seen by the operator, the voltage must be limited to a range, multiplied by a factor, and added an offset before it is written to a register on the device.

In this case, we need additional parameters or class properties — or the original methods need extra parameters, for example, set_max_voltage, set_min_voltage, set_acceleration_scale …

The list can get long, and a lot of parameters require more or less similar processing.

Since some subsystems/devices possess many control parameters, even more than a hundred, such required functionality results in plenty of almost duplicated coding, which is prone to errors and lowers the maintainability.

The New Solution: Device Parameters as Objects

Even in LabVIEW we can use object oriented concepts as in other traditional programming languages to avoid this mostly duplicated coding. Let’s think of device parameters as objects, identify types of variables on the control system and preparing a class for each of them! One of the simplest and most commonly used is the real value:

class Double() {
write(double)
double get()
set_max(double)
set_min(double)
set_scale(double)
set_offset(double)
}

Note: For clarity of examples, we use C++ like pseudo code to represent ideas implemented with LabVIEW graphical programming.

Such a class aims to transform the variable from the CS representation to the device/subsystem controller representation (and vice versa).

In the simple example above, solely scaling and limiting is enabled. Still, we can apply the same principle to more complex parameters, where the CS variable requires interaction with multiple device registers to perform an action.

A simple example of more complex variables is the device’s state.

The transition of the state requires multiple steps and interaction with multiple device registers:

  • check multiple parameters whether the transition is possible;
  • go to state;
  • check whether the transition is ok;

We can then represent each of the variables as an object of its respective class:

Double voltage,
Double acceleration,
State powerSupplyState;

With a collection of these objects, we can describe a device. In a trivial case, the objects can be simply indexed by the control system variable handles (names); thus, the code can mostly be agnostic of the actual variables.

But Wait, God Class is not Yet Gone

Class Double is still somewhat of a god class. The functionalities of the class are still exposed as methods.

In the next step, we can modify the actions that are performed on the variables —
min, max, linear scaling.

Note; these actions are reusable regardless of which device type we’re dealing with.

We introduce a family of decorator classes whose responsibility is to modify the values of the control system.

class Decorator {
variant Update(variant)
}

The decorator has an update method that takes input and transforms it, then returns the transformed input.

Example:
class LinearScaler<–Decorator { void Init(double k, double n)

variant Update(variant var) {
return k * var + n;
}
}

class Min<–Decorator { void Init(double min)

double Update(variant var) {
variant scale * var;
}
}

Conclusion: LabVIEW Has its Place in a Modern Accelerator Control System

Some software developers who use traditional programming are convinced that visual programming is ineffectual, too simplistic and not deserving of their time.

Years ago, we, too, held such beliefs. But then we started using LabVIEW in complex setups, as required by several of our customers. Namely, the latter were already using LabVIEW at a large scale for controlling their extensive NI hardware infrastructure. It was not long that we realised the potential of system building with LabVIEW. We started using it in ways that taxed ourselves and elevated the LabView potential to its highest level of useability and performance.

There are three general skills that a sound software engineer must possess — but they also play a central role in a visual programming environment, such as LabVIEW:

  • using logic to solve a problem,
  • realising an efficient solution efficiently and
  • applying the solution in a way that is both understandable and maintainable.

We believe that with thoughtful design and planning, the benefits of using LabVIEW applications can be increased.

As with other programming environments, it also holds for LabVIEW. Thoughtful planning at the very onset of development, such as creating a clean architecture, can help us significantly streamline the development of a control system and achieve better dependability and maintenance.

Back

The leading provider of cutting-edge expertise, software and electronics for the world’s most advanced systems and devices.

Our expertise
  • Expertise
Solutions
  • Radiation therapy
  • Complex medical solutions
  • Quantum
  • Accelerators
  • Fusion
  • Space
  • Astronomy
Media
  • Blog
  • News & events
About
  • Contact
  • About us
  • Careers
  • linkedin
  • facebook
  • instagram
  • twitter
  • Privacy policy

© 2025 Cosylab. All rights reserved.

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. Check our privacy policy

Necessary
Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.
Always active
Statistics
Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.