Page 1 of 1

[PL700-TCxxx] CODESYS programming examples

Posted: 09/12/2020, 15:32
by Pixsys tecnico 1
In order to be able to program Pixsys PLCs/HMIs equipped with Codesys runtime, these steps are initially necessary:
- download the Codesys IDE from the official Codesys website
- from the Pixsys website, enter the page of the product you want to program and in the "Software" section download and install the ".package" package. This package contains the description of the Pixsys device (as well as the mapping of the MCM and ETD1644 CANopen modules) and puts it in the Codesys device library.

All Codesys downloads (development program, libraries, etc.) can be found on the official STORE: https://store.codesys.com/
If you want to download only the IDE, you can do it directly from here: https://store.codesys.com/codesys.html

As for the connection to the target and programming, you can refer to the official Codesys guides/videos, the programming environment is completely standard.

Codesys v3 programming examples for the Pixsys PLC/TC series.

EXAMPLE 1: PLC Codesys interface with PDR100 and PDR200 series inverters
This example show how to use, in the PLC PL700-335-1AD, the ModbusRTU serial to communicate with PDR100 and PDR200 series inverters
Bus: ModbusRTU
Direct link to the topic in which the application is explained in detail:
viewtopic.php?f=31&t=2234

EXAMPLE 2: How to use RS485, CANopen, PLE-DIN-BUS serials
This example show how to use, in the PLC PL700-335-1AD, the ModbusRTU, CANOpen and PLE-DIN-BUS on some MCM260X e PLE500-6AD I/O modules.
In the PLC PL700, the PLE-DIN-BUS is used as a standard CANopen, on the channel "0", while the CANopen available on the terminal blocks is on the channel "1". her you can find the EDS files to be use in Codesys for all Pixsys I/O modules.
Bus: ModbusRTU, CANopen, PLE-DIN-BUS
PL700_Complete_Serials_Use.zip
EXAMPLE 3: How to use EtherCAT protocol with a OMRON ServoDrive serie R88D
This example show how to use the EtherCAT protocol for the management of a OMRON R88D servo with the NX-ECC203 coupler.
It includes web visualization (WEBvisu) with predefined Codesys graphical objects to configure and give commands to the servo.
This example can be used with different servo producers, because the commands are standard. It doesn't need optional licence because it uses the Codesys standard EtherCAT master driver.
Bus: EtherCAT
PL700_Ethercat_Drive_R88D_1s_ECC203.zip
EXAMPLE 4: How to use EtherCAT protocol with a LSiS ServoDrive serie XGT "XDL"
This example show how to use the EtherCAT protocol for the management of a LSiS XGT servo..
It includes web visualization (WEBvisu) with predefined Codesys graphical objects to configure and give commands to the servo.
This example can be used with different servo producers, because the commands are standard. It doesn't need optional licence because it uses the Codesys standard EtherCAT master driver.
Bus: EtherCAT
PL700_Ethercat_Drive_LSiS_L7NH.zip
EXAMPLE 5: How to use the EtherCAT protocol with a virtual axis
This example show how to use the EtherCAT protocol to manage a VirtualAxis, including also the Webserver visualization with predefined Codesys graphical objects to configure and give commands to the Axis.
Bus: EtherCAT
PL700_Ethercat_VirtualAxis0.zip
EXAMPLE 6: How to use the MQTT protocol
This example show how to use the MQTT protocol using an OpenSource library to publish and subscribe data form/to a MQTT server.
Bus: MQTT (Ethernet port)
PL700_MQTT.zip
EXAMPLE 7: How to use the Persistente Manager to manage retain variables
This example show how to use the Codesys "Persistente Manager" service to manage the variables that must be maintained after a power off (retain). It is composed by a simple project and a PDF with a step by step guide on how to import the MQTT FunctionBlock in an existing project.
Bus: none
PL700_Retain_Persisten_Manager.zip
Important: please set the priority of the task HIGH and LOW to 10 and 30 respectively.

EXAMPLE 8: Creating Historical Graphs in WebVisu
This example describes how to use the 'trend' object for displaying simple (short), historical, and variable-conditioned graphs. The project and its description is provided directly by Codesys Forge and can be found from this link:
Image
Bus: none
TrendExample.zip
EXAMPLE 9: Working with files and folders
This example describes how to work with PLC files and folders. The project and its description is provided directly by Codesys Forge and can be found from this link:
https://forge.codesys.com/prj/codesys-e ... home/Home/
Bus: none
FileUtilities.zip
EXAMPLE 10: Creating/editing/reading files
This example describes how to read/write files. The project and its description is provided directly by Codesys Forge and can be found from this link:
https://forge.codesys.com/prj/codesys-e ... home/Home/
Bus: none
TextEditorExample.zip
EXAMPLE 11: "loop control" package
This package contains a number of function blocks and libraries for process control. The package and its description is provided directly by Codesys.
Bus: none
Control_Loop_Library_en.zip
EXAMPLE 12: OSCAT package: 'Open Source Community for Automation Technology' (http://www.oscat.de/)
This package contains a number of function blocks and libraries developed by OSCAT and ported to Codesys. The packages and their description are provided directly from the Codesys store and can be found from this link:
https://store.codesys.com/en/catalogsea ... t/?q=oscat
Bus: none
OSCAT.zip
EXAMPLE 13: Interfacing Codesys PLC with Movicon scada
This example describes how to make a PanelPC or HMI equipped with the Movicon 11.6 scada communicate with a Codesys V3 PLC such as the PL700.
Codesys-side configuration:
- in the project in use, add the "Symbols Configurator" object and open it
- select from the existing variable groups which variables you want to make available to the scada
- use the "Build" button to compile the symbol configurator
- compile and download the project to the PLC.
Configuration on the Movicon side
- from the list of available drivers, choose the "3S\CoDeSys" communication driver
- double click on the driver to open the driver configuration: in the "Stations" tab press "Add" to add a PLC and then configure it as you see in the image in the zip, changing only the IP address of the PLC. Before exiting, use the "Test Cable/Comm." button to check that the configuration is correct.
- Right-click on the driver name and select "Import PLC database". Variables can be imported directly from the connected PLC ("import from PLC" button) or from file ("import from file" button), filtering the file extension as ".xml".
- With "Select All" you select all importable variables and with "Import" you add them to the RealTimeDB of the Movicon project.
Bus: none
PL700_Movicon (2).zip
EXAMPLE 14: HMI TC615: Communication with ETD1644 module in CANopen
The project is a starting point in which any Pixsys TC panel (TouchController) with Codesys runtime, communicates with the I/O plug-in module ETD1644 using the CANopen protocol. It shows the configuration and acquisition of analog input 1 for reading a PT100 probe and reading/writing the digital outputs. Analog output 1 is also configured and controlled as 0-10V in percentage value. Finally, all data is displayed through a simple synoptic accessible both as a WebClient (using Codesys' WebVisu technology) and directly on the device (using Codesys' TargetVisu technology).
Bus: CANopen
TC615_ETD1644_CANopen.zip
EXAMPLE 15: HMI TC615: Recipe Management
The project describes the Codesys recipe management, with the save, load, delete and "directoring" buttons, i.e. it lists in a table the list of existing recipes within a specific path in the memory of the TC panel. In this example, the recipes are saved inside the "Recipes" folder which is automatically created in the panel's internal memory within the Codesys runtime working path.
Bus: None
TCxxx_Recipes.zip
EXAMPLE 16: TC615 HMI: Reads text files / Codesyscontrol log file
The project describes how a text file in a specific folder on the device can be displayed at runtime (WebVisu or TargetVisu). In particular, the example allows you to view the system log, normally available only from the development environment with a connected device.
Bus: None
TC_ReadTextFile.zip