Skip to content
PDF

Working with CODESYS Applications#

In order to work with CODESYS applications on nodes, workloads need to be provisioned in the Management System. Here, provisioning is the creation of a workload and its storage in the workload repository of the Management System so that it can be deployed to nodes. This requires configuration of the workload and files that need to be uploaded to the Management System. After that, the workload can be deployed to nodes.

Before the workload can be provisioned, however, a CODESYS application has to be loaded into the CODESYS runtime first. Refer to the introduction to working with CODESYS and the MFN 100 first before continuing.

Once a CODESYS application has been loaded into the MFN 100, the following steps have to be taken:

  1. Creating the ZIP file of the CODESYS application
  2. Transferring the ZIP file to a local workstation

In this version, Nerve Blue does not provide a GUI based method for creating a ZIP file of the CODESYS application. Therefore, this chapter focuses on the manual process. Two tools are required for the instructions below, assuming Windows is used on the workstation:

  • an SSH client like PuTTY
  • a file transfer client like WinSCP

Also the workstation needs to be connected to the console port (P1) of the MFN 100 and the network adapter of the workstation needs to be configured. The IP address has to be in the range from 172.20.2.5 to 172.20.2.254 with a 255.255.255.0 subnet mask.

Creating the ZIP File on the Nerve Device#

First, the CODESYS project needs to be zipped on the Nerve Device before it can be copied from the CODESYS runtime.

  1. Open an SSH client like PuTTY.
  2. Enter 172.20.2.2 under Host Name (or IP address) to log in to the CODESYS runtime of the MFN 100.

    !PuTTY

  3. Click Open.

  4. In the new window, enter the admin password for the CODESYS runtime.
  5. Enter the following commands:

    sudo su
    
    systemctl stop nerve-codesys
    
    cd/var/lib/codesys
    
    zip -r /tmp/<userproject>.zip CmpApp.cfg PlcLogic/
    

    Note

    You can freely name the ZIP file here by replacing <userproject> with a name of your choice.

The ZIP file has now been created and is available on the Nerve Device.

Transferring the ZIP File to a Local Workstation#

After zipping the CODESYS project on the Nerve Device, you need to transfer it with a file transfer client to your workstation.

  1. Open a file transfer client like WinSCP.
  2. Enter 172.20.2.2 under Host Name.
  3. Enter the credentials for the CODESYS runtime below under User name and Password.

    !WinSCP Login

  4. Navigate to the /tmp/ directory on the right side of the WinSCP window. You will find it in the root directory.

    !WinSCP TMP Directory

  5. Drag and drop the ZIP file to your workstation.

Since the CODESYS project ZIP file is on your local workstation, you can now provision a CODESYS workload in the Management System.

Provisioning a CODESYS Workload#

The following instructions cover the basic requirements for provisioning a CODESYS workload. Optional settings will be left out. Extended options are addressed in the last section of this chapter.
There are two further types of workloads that can be provisioned: Virtual Machine workloads and Docker workloads. The process for each workload is highlighted in its respective chapter.

  1. Log in to the Management System.
  2. Select Workloads in the left-hand menu.
  3. Select + in the upper-right corner.
  4. Select the CODESYS symbol (CODESYS workload) on the left of the three symbols that expanded.

    !CODESYS Workload

  5. In the new window, enter a name for your workload.

  6. Select + next to Versions to add a new version of the workload.

    !New Version

  7. In the new window, enter the following information:

    Item Description
    Name Enter a Name for the version of this workload.
    Release name Enter a Release name for the version of this workload.
    CODESYS project file Click the upward arrow symbol to add the CODESYS application ZIP file.
    This is the ZIP file that you have created before.

    !Version Settings

  8. Click Save.

The workload has now been provisioned and is ready to be deployed in the Deploy menu.

Settings for CODESYS Workloads#

In the instructions above, optional settings have been left out. Below is an overview of all options with an explanation to each option.

Setting Description
VERSION SPECIFIC INFO Name
A name for your workload version. Choose a precise name to make the workload version unambiguous.

Release name
A release name for your workload version. This could be a version number. Example: 1.0.1
CODESYS APPLICATION FILES TO UPLOAD Here you have to upload the CODESYS project file. This is a ZIP file that has to be generated from a CODESYS project running in the CODESYS runtime. Upload it here by clicking the upward arrow symbol to open your file browser.
SELECTOR Labels
If you have defined labels and assigned them to nodes, you can add them as selectors to the workload. When deploying a workload, the list of nodes will be filtered automatically to the specified label.
Mark as released Tick this checkbox if you want to mark this workload as released. Once marked as released, the workload cannot be edited anymore.