Search by Tags

Partner Demo Container - Codesys

 
Article updated at 04 Oct 2019
Subscribe for this article updates

3S-Smart Software Solutions GmbH - CODESYS

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.

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 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
  • Sofmotion
  • CNC
  • EtherCAT Master
  • Modbus TCP Slave
  • Modbus Serial Slave

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.

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 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 in the end of this guide provide instructions about display and touch screen configuration.

How to Get Started

This section provides instructions for you to quickly get started with the CODESYS Partner Container. Select your module from the tabs below:

Pull From Docker Hub

To pull the latest revision of the container, run on the board:

# docker pull torizonextras/codesys

CODESYS for NXP i.MX8 modules is only available under NDA. Contact us to learn more and get the CODESYS Partner Demo Container for NXP i.MX8 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

Demo Project - Step By Step

  1. Install the CODESYS Development System.

  2. Download and install the device descriptor file for Toradex ARM Linux on the CODESYS Development System:

  3. Go to the menu Tools > Device Repository:


    • Device Repository

      Device Repository

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


    • Install Device Descriptor

      Install Device Descriptor

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


    • Create a new *Standard Project*

      Create a new *Standard Project*

  6. 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 in the left-hand side of the project window.

  7. 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

  8. 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

  9. 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

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


    • Configure the input device

      Configure the input device

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


    • Configure the output device

      Configure the output device

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


    • Add visualization

      Add visualization

  13. On Add Visualization window just click Add button:


    • Add visualization

      Add visualization

  14. 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

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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.

To create the Weston container use the command:

# docker run --name weston --rm -dt --network host --privileged -v /tmp:/tmp torizon/arm32v7-debian-weston:latest

To start the Chromium container use the command:

# docker run --name kiosk --rm -dt --network host --privileged -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev/dri:/dev/dri \
    torizon/arm32v7-debian-kiosk-mode-browser:latest http://localhost:8080

  • WebVisualization on the device

    WebVisualization on the device

Next Steps

For more information and custom requests please contact our partner CODESYS.

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.

You can configure a specific display using the easy to use Torizon device tree overlays container:

Release Notes

This 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.