PLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

CODESYS Control for PLCnext Technology

Codesys Control for plcnext sl

The PLCnext controller from Phoenix Contact can be programmed with the market-leading IEC 61131-3 tool CODESYS.

Watch the following video for further information.

Contact: This email address is being protected from spambots. You need JavaScript enabled to view it.

More and more PLC programmers are using the market-leading IEC 61131-3 development platform CODESYS. Due to the open architecture of PLCnext, it is now also possible to install a compatible SoftPLC on it. This enables users not only to create PLC applications in the CODESYS Development System, but also to visualize them with the integrated options and operate them via HTML5 web browser. CODESYS Control for PLCnext SL, as the SoftPLC is called, also contains an OPC UA Server for data transfer to other systems.

The following description shows you how to program and configure a PLCnext with CODESYS.

Preparation:

  • Download the current version of the CODESYS Development System from the CODESYS Store at codesys.store. If necessary, you must first create a customer account by clicking on the button "My Account".The CODESYS Development System V3 can be found in the category Engineering. Download and use of the tool are free of charge.
  • Install and start the downloaded development interface. On the right side of the toolbar, you will find the icon for the CODESYS Store
    .Store in CODESYS
    Click on it and log in again to "My Account" with your access data in the loaded store interface.
  • Search for the package for "CODESYS Control for Linux SL" in the category "Systems" or via the search field. Open the entry and click on "Download". Read the license conditions by confirming at the bottom with the button "Accept". Confirm the EULA and further queries and the package will be downloaded and installed in CODESYS. After completion, the CODESYS Package Manager appears and shows that CODESYS Control for PLCnext SL has been installed.Package Manager
  • Exit and start the CODESYS Development System so that the installed plug-in component is available for installing the runtime system.
  • After the restart, open the newly installed plug-in component with Tool/Update PLCnext. In the new component you can install the CODESYS SoftPLC runtime system on the PLCnext:
    deploy tool
    Enter the log-in data as found in the PLCnext documentation. Identify the desired device via its IP address. You can either enter this address manually or scan to find it:
    Scan PLCnext
    Select the last loaded package version and press the "Install" button. The SoftPLC runtime system is installed on the device. After completion of the installation you can use the PLCnext as CODESYS compatible controller.

Usage:

  •  Close the PLCnext dialog and start a new CODESYS project. Select a standard project under "Templates", assign a suitable project name, select the desired storage location and confirm the selection. In the following dialog, you can immediately select CODESYS Control for PLCnext SL as the desired target system.
    standard project
    In addition, you can define in which IEC 61131-3 programming language the first program block is to be created. Confirm the selection.
  • The wizard integrated in CODESYS creates a new project with PLCnext as target system and also automatically adds a PLCnext Axioline node. The desired I/O modules can be configured with the right mouse click "Add Device":


  • By double-clicking on the I/O modules inserted in this way, you can specify the available I/O channels with symbolic variable names:

    The newly created variables are immediately available as global variables in the entire project.
  • Use these variables to program your logic application, e.g.
    coding

Integrated Visualization (this chapter can be skipped)

  • If you want to visualize the logic application in the same project, create a new visualization object by clicking on the application:
    add visu obj
    A new visualization object, a visualization manager and the CODESYS WebVisu are created as a display client.
    visu obj
  • In the newly created visualization object, you can use the available elements to create user interfaces, such as
    easy visu
    These visualization objects can be used, for example, directly in the CODESYS Development System for testing and commissioning the application, or as web visualization in the browser.

Integrated OPC UA Server (this chapter can be skipped)

  • You can use the integrated CODESYS OPC UA server of the SoftPLC to transfer data from your PLCnext controller to other OPC UA clients. Click with the right mouse button on the Application and select Add Object/Symbol configuration:
    add symbolconfig
    Leave the check mark at "Support OPC UA Features" set and confirm with "Add".
  • Click on the "Build" button to determine the available data for the transfer. Select which variables from which object you want to transfer, e.g. from the object PLC_PRG (the first POU) or IoConfig_Globals_Mapping (the IO variables that you have assigned symbolic names to).
    symbolconfig
    If necessary, assign access rights and attributes for these variables.

Download and Execution of the PLC application

  • Double-click on the device on the left side in the project tree. The device dialog opens with the Communication Settings. Click on "Scan network". The Gateway Service on your PC finds the connected PLCnext device(s):
    scan device
    Double-click on axcf2152. In the Communication Settings the connections between your PC and the Gateway Service and from the Gateway Service to the device are marked with a green circle and are thus established:
    device connected
  • Close the device dialog. Then click Online/Login. The CODESYS Development System translates the entire application, if necessary including visualization and OPC UA Server and loads it onto the device.
  • The application has not yet been started, as you can see in the bottom line of the CODESYS Development System:
    stop
    Press the F5 key and the application switches to run mode. At the same time, the declaration part of the POU objects becomes the watch window. With a double click in the column "Prepared Value" you can enter new values and write them once to the controller with CTRL + F7.
  • Open the Web visualization with any HTML5-capable browser by entering the following URL:
    http://<PLCnext-IP-address>:8080/webvisu.htm

Have fun trying it out! In the CODESYS Store you will find numerous free sample projects that you can run on your device.

Comments  

# ksobczyk 2019-03-21 08:51
Quote:
Search for the package for "CODESYS Control for Linux SL" in the category "Systems"
For sure it is supposed to be "CODESYS Control for Linux SL"? In the end of this paragraph there is "CODESYS Control for PLCnext SL".
# roland_wagner 2019-03-21 10:49
In fact, the package is not yet available, but will be for the Hannover Fair 2019 in April. Thus, just be a little patient ;-) . The other mentioned package, "CODESYS Control for Linux SL" is not suitable for the PLCnext, but for Linux based PCs or other x86/ix based devices with Linux.