The architecture x86 recently was positioned as embedded and it's real solutions into this industry rarely have resources (< i386), which is not enough for full-featured OS and advanced environment execution. For this reason and by reason of big the architecture unification the individual assemblies of kernel Linux and main programs of the OS environment performed rarely enough, and that typical mostly for the architecture ARM. More interest and practical for x86, for wide the hardware circle, it is assembling firmwares with compressing a root file-system (RFS). But still possible individual assembling by aid of the build systems as "BuildRoot" or "PTXDist", bottom. And also here possible direct installing a Linux distribution.
The following requirements were pulled out to the implementation of the PLC firmware of the section:
Given the above requirements, for the creation of the firmware it was chosen the tool for creating the distributions mkimage of ALTLinux. mkimage is the tool for building Sisyphus-based system on basis of template. As an initial set of templates it was taken the set of templates of formation of ALTLinux distributions at git://git.altlinux.org/people/boyarsh/packages/mkimage-profiles-desktop by the command:
As the basis it was taken the "rescue" template, as the most compact and close to the target PLC.
Firstly building performed basing on the package base of the distributive ALTLinux 5.1, there is present the realtime kernel from XENOMAI. For obtaining some specific packages you need to connect the repository of packages "ALTLinux 5.1" from the OpenSCADA project:
rpm ftp://ftp.oscada.org/ALTLinux/5.1 openscada main
Firstly it was created the configuration of PLC without local display in mind of the availability of this type of equipment and lack of equipment for the Touch-panels.
New PLC template was named "plc", it was tested on the boards of PC/104 form factor MOPSlcdLX of Kontron company, ATH400-128 of Diamond Systems company and modular PLC LP-8781 of the ICP DAS company. The archive of the resulting mkimage tree with the "plc" template can be downloaded here ftp://ftp.oscada.org/OpenSCADA/PLC (templates and materials of individual controllers are placed in their own directories).
The key points of the configuration of new template was the writing of the new init-script (rc.sysinit), the script of the after installation configuration of the firmware's image and the list of packages in the image of firmware.The first script is designed as the package "startup-plc". The second script was embedded in the template "plc" on the way: profiles/pls/image-scripts.d/01system. The list of packages was embedded in the template "plc" on the path: profiles/pkg/lists/plс.in.
The procedure of creating the firmware from the image is the following:
The result is an output directory in the "profiles/out/" have look:
It is possible to download the firmware to: USB-flash, IDE-flash and HDD. However, in the case of the USB-flash there is the problem with waiting for initialization of USB-subsystem and you'll have "to run" some dialogues.
The file system can be FAT or EXT2/3. In the case of EXT3 the root is mounted as in EXT2, because of problems in the initializer. In the case of EXT2/3 you'll need to use not the syslinux boot, but extlinux, the configuration of which is almost the same one.
Next, lets mount the medium and place the files from the output directory on it as follows.
In the case with FAT and syslinux:
In the case with EXT2/3 and extlinux:
To ensure the reliable operation of the operating data stored in the file "work" with the file system EXT3. The file-system of this file is checked for integrity at the initialization. This file is created as follows:
In the case of the file system EXT2/3 on the target disk the "work" file can not be created. In this case, the working data will be placed in the directory "root" of the target disk.
The next step is the configuration and initialization of the loader. To configure the loader it is necessary to edit the file "syslinux/syslinux.cfg" or "extlinux/extlinux.conf" as follows:
In the case of selection the identification of the bootable partition by the identifier you can get the ID of our partition with the command: blkid.
In the case of the label it is a bit harder and this is done for different file systems in different ways.
For the file-systems EXT2/3 it is done by the utility e2label. For example: e2label /dev/sdb1 PLC
For the FAT file system it does by the set of utilities that come with mtools or with parted, easier. With mtools you can do it as follows:
Now we can initialize the loader:
That is all with the boot and initialization of firmware. If the resulting disk is not loaded:
The result is the firmware with the size from 30Mb to 100Mb, satisfying all announced requirements and it provides:
As the PLC runtime system the OpenSCADA is used. For this case we'll take the building with separate packages for each module and indicate to install the virtual package openscada-plc, which contains all the dependencies on all the OpenSCADA packages, typical used for this configuration. The package of gd2 graphics library has been rebuilt without the support of xpm graphic file format and library was called libgd2-noxpm. All this was done in order to avoid the heavy dependencies on the libraries of GUI XOrg.
The result is the runtime of the PLC with support:
The configuration of OpenSCADA runs in demon mode in locale "en_US.UTF-8" (also available "ru_RU.UTF-8" and "uk_UA.UTF-8") using the local database SQLite, providing the following default network services:
In this section let examine the details of the OS tree of the firmware, the initialization script rc.sysinit.plc and the script of preparation of the OS tree of the firmware.
To build the PLC firmware it was used the following list of packages:
List of the modules of the loader's system kernel with the purpose to reducing the initialization image size was decreased to the following ones:
To the script of the tree preparation there were added the following functions:
The initialization script (rc.sysinit.plc) was provided with the following functions:
As the result of these actions the mount table of the resulting PLC tree looks like:
One option of the firmware is built with a graphical interface, which, however, necessary to configure for automatic startup with the visualization area of OpenSCADA. In addition, it should be noted that the firmware with a graphical interface does not contain all the drivers and you may have to rebuild it under the right equipment.
After downloading and logging to the console it is necessary to configure the XServer, automatic graphical login, start of the graphical environment and automatic startup of OpenSCADA from the IceWM environment:
Next stage of the firmwares creation was moving to the package base of distributive ALTLinux T6. On the whole firmwares creation concept saved, with bits changes, but there were added some improvements and expansions:
During the possibility of a free additional installation of needs packages direct from the repository gone needs to the separated built of the firmware with GUI. That is you can easy install the desired window manager (WM) or desktop environment include needed drivers, than create a separated firmware with a limited list of the drivers.
The script "startup-plc" was turned spare into the new firmwares besides the "root" FS remounting to writing does early on the initial sage. The script "profiles/plс/image-scripts.d/01system" renamed to "profiles/plс/image-scripts.d/init1-PLC", but it changed and expanded. The packages list of the firmware was left into "profiles/pkg/lists/plс.in" and some changed.
For get the some specific packages you have to connect the repository "ALTLinux T6" from the OpenSCADA project:
rpm ftp://ftp.oscada.org/ALTLinux/t6 openscada main
The firmware creation procedure mostly left unchanged:
# Creation of the configuration script "configure"
$ ./autoconf
# The builder configuration for the disk's images generation. The key "--with-imagetype" you can set to "iso", or pass
# for creation the combined ISO-image
$ ./configure --with-distro=kdesktop --with-branding=altlinux-kdesktop --with-version=6.0 --with-language=en_US --with-imagetype=flash
# The image assembling
$ make plc.cd
The output folder's content with the image and the firmware installing process to file system FAT and EXT2/3/4 different only by renaming the FS archive's file from "plc" to "live". Installing the ISO-image to USB-flash, HDD, SSD performs by the command dd:
$ dd if=LP8x81-ALTLinuxT6-OpenSCADA_0.8.0.6-i586-plc.iso of=/dev/sd{x} bs=4096
Instead the file "work" you should create partition EXT3 with the label "alt-live-storage", if it is not the ISO-image. The new partition creation you can do with the help of fdisk, if the FAT partition was not created to all allowed the storage space, or with help of parted where the FAT partition you allowed to change. To the details about a partition creation the reader will send to the documentation on fdisk or parted.
Configuration of files "syslinux/syslinux.cfg" and "extlinux/extlinux.conf" were not changed, besides the FS file archive's name changed from "plc" to "live".
At the result we get the firmware with size from which provides:
For the PLC firmware assembling used next packages list:
The Linux kernel modules list of the initial stage was some changed and include:
To the script of the tree preparation "profiles/plс/image-scripts.d/init1-PLC" performs the functions:
For a series of tasks are important, often also critical, criteria of the environment is the real-time handing level, then it is possibility of working the tasks according to the real-time priorities and provision of a reaction to events by that priorities.
The Linux kernel of itself provides POSIX real-time scheduling policies "SCHED_FIFO" and "SCHED_RR" with the priorities range (0...100). But the important criteria is "Timer frequency and the reaction to it" up to version of Linux kernel 2.6.24 was too low, for criteria of the real-time systems. In modern kernels of Linux (> 2.6.24) provided support for timers of the high-precision resolution (HPET), what decreased the reaction time to a timer up to 100 microseconds, but that time stability is not guaranteed. To ensure stability of reaction to a timer on level 60 microseconds, and also series of the other criteria of real-time, at the moment you need to assemble a kernel with one real-time extension.
On the ALTLinux distributions observed the kernel 2.6.29-rt-up, which assembled with the real-time extension of real-time is XENOMAI. Into other distributions, for example OpenSuSE, observed also the solutions with it extension.
For now higher criteria of the real-time ensured of the extension The Real Time Preempt Patch, on enabling here full it's features by (CONFIG_PREEMPT_RT), The patch assembling to Linux kernels process and it's work result will trace into this section.
For the real-time level testing on different kernels will use the utility "Cyclictest", which typical call command line and it's arguments looks: "$ cyclictest -t1 -c1 -p 80 -n -i 200 -l 100000". Where:
Pair of measurements for Linux kernels of the wide purpose:
The kernel originally presents into the distribution ALTLinux 5.1, and it is also moved to the local repository of the project OpenSCADA for ALTLinux T6. The kernel assembled with the extension XENOMAI and AUFS, allowing it using into the firmwares and packed root FS, that was done for the PLC LP-8x81.
Results of the kernel testings:
As you can see from the testing results the patch XENOMAI does not ensure proper level of the real-time on using the standard mechanisms of the POSIX real-time scheduling, at the same time as the kernel version 3 even without the specific real-time extensions ensures the clearly better result.
Necessity for assembling same that kernel with the patch/parameter CONFIG_PREEMPT_RT is actual by presence a number of binary modules from ICP_DAS, for "LP8x81". Also here is actual a question of building the kernel 2.6.33 at the same reasons but for "LP8x81 Atom". The preliminary assemblies of the kernels 2.6.29 and 2.6.33 reveals series of problems which will described here. Solving also a variant to build a modern kernel with CONFIG_PREEMPT_RT and next to request for building these binary modules from "ICP DAS".
Assembling and testing process:
Result kernel, which renamed to "kernel-image-rt1-up-2.6.29.alt1", you can use for PLC with HPET or a high precision timer, and also into "LP-8x81" and "LP-8x81 Atom" (only single kernel)!
Kernel version 2.6.33 assembling with the patch CONFIG_PREEMPT_RT needs for PLC LP-8x81 of firm "ICP DAS" and LP-8x81 Atom (main and original kernel) by reason of presence for it the binary drivers of "ICP DAS".
Testings results of the kernel:
Assembling and testing process:
The boards from "Diamond Systems" were a first on which OpenSCADA had tested and stabilized. First board here was single-board computer ATH400 of the form-factor PC/104, shown on the image bottom. On the computer a OS environment early was installing in traditional method and for now by the presented conception of the firmwares assembling.
Hardware specification of the board:
Central processor: | VIA Eden 400-660MHz |
Operational memory: | 128MB, soldered to the board |
Permanent memory: | IDE (44) port with UDMA-33 |
Video subsystem: | S3 Savage 4 Chipset with extension of 3D/2D video; supported flat panels, CRT and LCD |
Audio subsystem: | present |
Interfaces/ports: | 10/100Mbps Ethernet; 4 RS-232 serial ports; 4 USB 1.1 ports; PS/2 keyboard and mouse |
Power supply: | +5VDC ±10% @ 2A |
Operating conditions: | -40 ... +85°C |
DAQ: | 16AI (16 bit, 100 kHz), 4AO, 24DIO, 2CNTR |
First task of the board and OpenSCADA was implementation of function of high-frequented (10 kHz * 8 channels) signals archiving of a gas compressor for learning the surge phenomenon on Anastasievskaja GLKS.
Second task was the PLC prototype of power substations nodes. Already for this task the firmware had assembled on base of new package base. Into the task Data acquisition module of boards of the "Diamon Boards" was unified for support all boards of the manufacturer.
Second board was one board of the interface to the object DMM32-AT, shown on the image bottom. The board used for creation of mockups and emulators of field of technological programs. The board has specification:
Power supply: | +5VDC ±10% @ 200mA |
Operating conditions: | -40 to +85°C |
DAQ: | 32AI (16 bit, 200 kHz), 4AO, 24DIO, 2CNTR |
Analysis of noise properties of high-impedance inputs of boards from Diamond Systems in different conditions placed to table bottom:
Conditions | External PS: Noise level, mV [Hz] | Internal PS: Noise level, mV [Hz] | Notes |
(10 kHz, ±0.625 V, 20 us), Grounded-32 | 0.08 [-] | ||
(10 kHz, ±5 V, 20 us), Grounded-32 | 0.5 [-] | 0.35 [-] | |
(10 kHz, ±5 V, 20 us), Grounded-31, Loading ∞ | 5 [50, 270] | 18 [50, 150] | |
(10 kHz, ±5 V, 20 us), Grounded-31, Loading 1mOm | 10 [50, 270] | ||
(10 kHz, ±5 V, 20 us), Grounded-31, Loading 100kOm | 7 [150, 50, 270] | 7 [-] | |
(10 kHz, ±5 V, 20 us), Grounded-31, Loading 10kOm | 4.5 [100] | 6 [-] | |
(10 kHz, ±5 V, 20 us), Grounded-31, Loading 1kOm | 0.9 [150] | 1 [-] | |
(10 kHz, ±5 V, 20 us), Grounded-31, Loading 100Om | 0.5 [-] | 0.5 [-] |
MOPSlcdLX is single-board computer of form-factor PC/104, shown on the image bottom. The computer had attracted attention by some low price, by ordinal conditions of the exploitation and then lower heating.
Hardware specification of the board:
Central processor: | AMD LX800™ 500 MHz, fanless |
Operational memory: | DDR-RAM-SODIMM socket |
Permanent memory: | IDE (44) port |
Video subsystem: | built-in graphic with support output to flat panels, CRT and LCD |
Audio subsystem: | no |
Interfaces/ports: | 10/100Mbps Ethernet (Intel® 82551ER); 2 RS-232 serial ports; 2x USB 2.0; PS/2 keyboard and mouse, Floppy, LPT |
Poser supply: | +5VDC ±10% @ 1A |
Operating conditions: | 0 ... 60°C |
The board had used for testing of creation operator stations/panels with OpenSCADA into like environment. Latter there had occur problems series with the board:
For now base on this board preparing "The program oscilloscope" why it was successfully downloaded by the modern firmware with kernel "std-def" and addition board DMM-32X-AT installed, about that see above.
VSX104 is single-board computer of form-factor PC/104, sown in the image below. The computer had attracted attention by the reason of low price and low power consumption (< 2Вт) and followed low heating. But by using the processor "Vortex86SX-300 МГц" here needs specific points to forming of the OS environment, but here used CPU instructions set of i486 and the mathematical coprocessor lack.
Hardware specification of the board:
Central processor: | DM&P SoC Vortex86SX-300 MHz |
Operational memory: | 128 МБ DDR2 RAM, soldered to the board |
Permanent memory: | slot CompactFlash Type I, microSD and 2 ports EIDE (Ultra DMA 100) |
Video subsystem: | no |
Audio subsystem: | no |
Interfaces/ports: | 10/100Mbps Ethernet; 4 RS-232 serial ports; 2x USB 2.0; PS/2 keyboard and mouse, LPT, Redundancy, SPI |
Power supply: | +5VDC ±10% @ 370mA |
Operating conditions: | -40 ... 85°C |
DAQ: | 1 port 16-bit GPIO |
For now there is not a solution based on the board but planed to assemble for it a environment, possible for an autonomous control resources system.
The revision in progress
VDX-6354D представляє собою одно-платний комп'ютер формфактору PC/104, представлено на рисунку нижче. Цей комп'ютер побудовано на процесорі "DM&P SoC CPU Vortex86DX- 800MHz", який продуктивніше "Vortex86SX-300 МГц" у попередньому розділі, однак і енергоспоживання цієї плати вже не 2, а 4 Вата більше на сторінці проекту (RU)
Промислові контролери сімейства LP-8x81 фірми ICP DAS є першим продуктом із серії LinPAC, який побудовано на x86 сумісному процесорі, попередні контролери цього сімейства основані на процесорі сімейства ARM. Крім x86 процесору ці контролери мають значні ресурси оперативної пам'яті та дискового простору. Все це дозволило розглядати цей контролер як першого кандидата із продукції ICP DAS для адаптації OpenSCADA у якості середовища виконання більше на сторінці проекту (RU).
Фірма Avalue, сумісно з її дистриб'ютором у Росії фірмою ElTech надає широкий спектр панельних ПК, які можуть використовуватися починаючи із звичних офісних моноблоків та закінчуючи промисловими сенсорними панелями у фронтальному виконанні класу IP65. У зв'язку використання стандартного обладнання запуск та робота OpenSCADA на них не викликає проблем більше на сторінці проекту.
iROBO-3000a is a fanless industrial computer with Intel Atom D425 1.8 GHz с VGA, 2xGb LAN, 4xCOM, 4xUSB, 1GB RAM, 1x2.5" SATA HDD 120GB, Mini-PCIe, 4x4 DIO, CF slot, SIM Card slot, Audio, WDT on board, operating temperature range -5..+55°С. Performance of this computer is enough to run the functions of data acquisition, monitoring and control server, as well as the visualization station's functions. However, because of usage the non-productive Atom processor family, the implementation of mathematical models of processes will require almost all of the CPU resources. For example, during the performance of the AGLKS mathematical model, the CPU is loaded at 86%. The controller has been certified by "UKRSEPRO" that may be important for many users in the territory of Ukraine.
OpenSCADA operating environment for this computer was based on the packets base of the ALTLinux T6 distribution, as well as freshly-builded Trinity (TDE) desktop environment. Building of the environment was made using the above described conception with an updated profile of "mkimage". The "plc" objective has been added to the new profile, but its nature has changed in fact and has become a copy of the "live" target, which became possible thanks to the implementation in primary initialization stage the transparent mount of the partition with the "alt-live-storage" label as a reflection of a packed file system with random access to the modification. In general, it made possible to create the fixed core of the firmware with the basic set of software environment with the size of 300MB and with the possibility of free expansion by installing the necessary packages from the distribution.
The Trinity was selected as the desktop environment because of the presence of background artefacts problem in conjunction with XOrgServer 1.10 + QT4, as well as because of TDE low-resource with high maturity and stability.
Archive of the build profiles of the new environment is called mkimage-profiles-6-kdesktop-plc.tgz, and the latest build of the firmware ALTLinux6-OpenSCADA_0.7.2-i586-plcUI_TDE-generic.flash.tar.