Search by Tags

Partner Demo Container - Codesys

 

Article updated at 29 Oct 2021
Compare with Revision




Partner Demo Container - Codesys

Warning: this CODESYS runtime is meant for demonstration purposes and has a limited time to run of 2 hours from the start of the container. See the section Licensing Information for more details.

3S-Smart Software Solutions GmbH - A member of the CODESYS Group

Toradex partner 3S-Smart Software Solutions GmbH is the company that provides CODESYS: the leading manufacturer-independent IEC 61131-3 automation software for engineering control systems.

This article complies to the Typographic Conventions for Torizon Documentation.

CODESYS

CODESYS is a software PLC solution that can be deployed on our ARM-based System on Module families Colibri and Apalis in order to enable the module to work as a PLC. The software solutions provide a development environment and runtime.

See the list of Devices using CODESYS (you see some famous PLC brands like Beckhoff, Wago and Eaton).

In this Partner Demo Container, which consists of a Docker image meant to be run on Torizon, the CODESYS runtime and its dependencies can be deployed to Toradex modules easily. The image has the following CODESYS features enabled:

  • WebVisu
  • Softmotion
  • CNC
  • EtherCAT Master
  • Modbus TCP Slave
  • Modbus Serial Slave

Supported Modules

The following Computer on Modules are supported:

Supported OS

The following platform and configuration are supported:

CODESYS requires the Linux kernel with the PREEMPT_RT patch applied and configured to run fully preemptive. The support for PREEMPT_RT on Torizon is in an early stage and, for evaluation purposes, you may run this container using the default TorizonCore without PREEMPT_RT at your own discretion. Alternatively, you may install the nightly build of TorizonCore with PREEMPT_RT from our Toradex Easy Installer CI feeds, if available at all. Images from the CI feeds are not supported by Toradex and you may use them at your own discretion.

To follow-up on the PREEMPT_RT topic, subscribe for updates on the TorizonCore Release Roadmap.

Supported Displays

For Apalis modules:

For Colibri modules:

While you can use a wide variety of displays and monitors, additional configuration may be required for a specific setup.

A section at the end of this guide provides instructions about the display and touch screen configuration.

Intended Use

This partner demo container is meant for the evaluation of the technology. It is not suitable for development or production.

How to Get Started

This section provides instructions for you to quickly get started with the CODESYS Partner Container.

Download the Container Image

The CODESYS evaluation container is only available under NDA. Contact us to learn more and get the CODESYS Partner Demo Container forwarded to you.

Attention: the next instructions are only applicable after you have contacted us.

Run a Container

To create a container from the image pulled, use the following command:

# docker run --rm -dt --name codesys --network host --privileged torizonextras/codesys

Tip: running a container with the flags --privileged and --network host is easy for evaluation but they are a bad practice from a security standpoint. You should figure out which hardware interfaces require access to the container to replace the --privileged and which ports must be exposed to replace the --network host. Read our Torizon Best Practices Guide for some help.

Demo Project - Step By Step

Install the CODESYS Development System.

Download and install the device descriptor file for Toradex ARM

Linux on the CODESYS Development System:

Go to the menu Tools > Device Repository:


  • Device Repository

    Device Repository

On the Device Repository window, click in the Install... button and select the downloaded device descriptor file:


  • Install Device Descriptor

    Install Device Descriptor

Create a new Standard project, give the project a name and click ok:


  • Create a new *Standard Project*

    Create a new *Standard Project*

Select the device previously installed. In PLC_PRG select Ladder:


  • Setup device and PLC programming language

    Setup device and PLC programming language

Now a new project is created. You will see a menu listed on the left-hand side of the project window.

Double click on Device. A new tab will open. Click on Scan network ...:


  • Find your device in the network

    Find your device in the network

In the Select Device window make sure the device was found and then double click on it:


  • Select your CODESYS device

    Select your CODESYS device

With the device connected to the development environment, we can start programming the logic. Click PLC_PRG in the project tree. In Toolbox drag and drop a Contact and a Coil to the Ladder area:


  • Create a basic project logic

    Create a basic project logic

Add the INPUT_01 variable name in the Contact text box and select as type BOOL:


  • Configure the input device

    Configure the input device

Add the OUTPUT_01 variable name in the Coil text box and select as type BOOL:


  • Configure the output device

    Configure the output device

Add a Visualization to the project. In the project tree, right click on Application > Add Object > Visualization:


  • Add visualization

    Add visualization

On Add Visualization window just click Add button:


  • Add visualization

    Add visualization

On the Visualization tab, which can be opened with double click on Visualization in the project tree, select Visualization Toolbox > Lamps/Switches/Bitmaps one DipSwitch and one Lamp1, drag and drop one at a time for the Visualization tab:


  • Create the visualization user interface

    Create the visualization user interface

Connect the elements of the visualization to the elements of the ladder.

Select DipSwitch and in Properties select Variable:


  • Configure the dip switch

    Configure the dip switch

The DipSwitch must be connected to the Contact element of the Ladder. In the window Input Assist select Application > PLC_PRG > INPUT_01 (the variable which has been added to Contact):


  • Configure the dip switch

    Configure the dip switch

Select Lamp1 and in Properties select Variable. In the window Input Assist select Application > PLC_PRG > OUTPUT_01 (the variable which has been added to Coil):


  • Configure the lamp

    Configure the lamp

With the connections made, we expect that o toggling the input DipSwitch, the output Lamp1 also toggles. To test, download the project for the device. Click the Online menu and select Login (always choose download):


  • Download the application to the device

    Download the application to the device

With the project downloaded and online, the following screen will be shown and the project will be in the STOP state:


  • Project ready to run on the device

    Project ready to run on the device

To start the application, click on play:


  • Start the application

    Start the application

At this point, the application will be in the RUN state. On the Visualization the elements can already be tested. Pressing the DipSwitch should light the Lamp1 on.


  • Video illustration of the application running

    Video illustration of the application running

The Visualization feature also adds to the project the WebVisualization. Click on Visualization Manager -> WebVisualization on project tree. In the WebVisualization tab you can find the settings:


  • Web visualization

    Web visualization

You can open your browser and remotely connect to the web visualization tool using the board IP address and port 8080: http://<board IP>:8080

Triggering the DipSwitch will act both on the WebVisualization of the browser as in development environment Visualization:


  • Video illustration of the web visualization

    Video illustration of the web visualization

Local WebVisualization

To complement this demo, you can also run a web browser in full screen (kiosk) mode for WebVisualization on a touch screen connected to the device. We use the Torizon base Weston container as the graphical backend and a container running Chromium to serve the WebVisualization locally.

A docker-compose.yaml file is provided to orchestrate the containers bring-up in Toradex GitHub:

Bring-up the three required containers - CODESYS, Weston, and Chromium - by running docker-compose in daemon mode:

Warning: stop any previously running CODESYS container before executing the command below.

# wget https://raw.githubusercontent.com/toradex/codesys/master/docker-compose.yaml
# docker-compose up -d

See the collapsible section below if you want to bring-up each container manually, one at a time, instead of using docker-compose:

Manual container bring-up

  • WebVisualization on the device

    WebVisualization on the device

Next Steps

If you want to build the CODESYS demo container by yourself for any reason, the Dockerfile and related resources are publicly available in our GitHub:

This container is a demonstration meant solely for evaluation purposes. For more information and custom requests (for instance if you need a solution ready to deploy on the field) please contact one of our partners BE.services, 3S-Smart Software Solutions GmbH or neXo.

Display and Touchscreen Configuration

Displays and Monitors used in Embedded Systems are available in a myriad of configuration possibilities - resistive, capacitive or without touch, single or multi-touch, different resolution, density of pixels, pin-out and clock frequency are some examples.

To make things easy for you, Toradex provides specific instructions on how to use its display offerings as well as comprehensive information about how to interface your custom display or monitor to Toradex modules.

There are three tested and recommended displays by Toradex:

You can easily set-up and get them running with 3 steps explained on Setting up Recommended Displays with Torizon. If you prefer to configure a specific display, it is suggested the reading about the easy to use Torizon device tree overlays container on Device Tree Overlays. If you need to calibrate the touch screen, learn how on Touch Screen Calibration (Torizon).

Release Notes

These release notes are strictly related to the test of the CODESYS Partner Demo Container in Toradex hardware. They are not related to the CODESYS releases.

3.5.15.0

  • Initial Release

Licensing Information

If you want to License Codesys on Toradex hardware you can get in touch with our partners 3S-Smart Software Solutions GmbH or Nexo. For licensing information, check CODESYS Licensing page.