OpenSCADAWiki: Home Page En/Using/PLC/firmware ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 

Firmware and PLC program environment creation for architecture x86

The following requirements were pulled out to the implementation of the PLC firmware:

Tools and work environments building

Given the above requirements, for the creation of the firmware it was chosen the package's repository of the distributive of OS Linux ALTLinux and the tool for creating the distributions mkimage. mkimage is the tool for building Sisyphus-based system on the basis of the template. As an initial set of templates it was used 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.

Creation

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 "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 features 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 is embedded in the template "plc" on the way: profiles/pls/image-scripts.d/01system. The list of packages is embedded in the template "plc" on the way: 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/ of the type:

Installation

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 pass some dialogues.


The file system can be fat or ext2/ext3. In the case of ext3 the root is mounted as in ext2, again because of problems in the initializer. In the case of ext2/ext3 you'll need to use not the syslinux boot, but extlinux, the configuration of which, incidentally, 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/ext3 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 file is created as follows:


In the case of the file system ext2/ext3 on the target disk the "work" file may not be created. In this case, the working data will be placed in the directory root of the target disk. Warning. This is an unreliable solution because the root file system of the target disk is not static and its check is not possible, because of earlier mounting in the "ro" and the potential unreliability of the check of the file system, mounted at "ro", as well as because of the inability to remount as ext3.


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, since it needs to be set, and this is done for different file systems in different ways.


For the file systems ext2/ext3 it is done by the utility e2label. For example: "e2label /dev/sdb1 PLC"


For the FAT file system it is done by the set of utilities that come with mtools as follows:


Now we can initialize the loader:


That is all with the boot and initialization of firmware. If the resulting disc is not loaded:

Result

The result is the firmware with the size from 30Mb to 100Mb, satisfying all stated requirements and it provides:

OpenSCADA

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 dependences 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 current configuration of OpenSCADA runs in demon mode in locale uk_UA.UTF-8 using the local database SQLite, providing the following default network services:

Implementation details

In this section we'll 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 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 reduce the initialization image size was reduced to the following one:


To the script of tree preparation there were added the following functions:


Initialization script (rc.sysinit.plc) was provided with the following functions:


As the result of these action the mount table of the resulting PLC tree looks like:

Customizing the GUI

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:

iROBO-3000a

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.


 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]