0% found this document useful (0 votes)
44 views

CODESYS

Uploaded by

Oscar Jiménez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

CODESYS

Uploaded by

Oscar Jiménez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

CODESYS

internal PLC
CODESYS as IEC 61131-3
CODESYS is a development environment for programming controller applications
according to the IEC 61131-3
IEC 61131-3 is the third part of the open international
standard IEC 61131 for PLC
IEC 61131-3 deals with programming languages and defines three graphical and two
textual PLC programming language standards:
Ladder diagram (LD)
Function block diagram (FBD)
Structured text (ST)
Instruction list (IL)
Sequential function chart (SFC)

©2020 EXOR International S.p.A. All rights reserved 2


CODESYS V2.3 and CODESYS V3.5

CODESYS V 3.5 internal PLC available for all HMI models

CODESYS V2.3 internal PLC available only for eTOP500/600 WCE based HMI models

©2020 EXOR International S.p.A. All rights reserved 3


Programming Languages

Instruction Structured Sequential


List (IL) Text (ST) Function Chart (SFC)
LD A
ANDN B C:= A AND NOT B Step 1 N FILL
ST C
Transition 1

Function Block Step 2 S Empty


Ladder Diagram (LD)
Diagram (FBD)
AND Transition 2
A B C
A C
-| |--|/|----------------( ) Step 3
B

©2020 EXOR International S.p.A. All rights reserved 4


IEC 61131-3 Data Types
IEC 61131-3 CODESYS JMobile
Limits Memory Space
Data Type Data Type Data Type
BOOL BOOL Boolean 0 ... 1 1 bit data
SINT SINT Byte -128 ... 127 8-bit data
USINT USINT / BYTE UnsignedByte 0 ... 255 8-bit data
INT INT Short -32768 ... 32767 16-bit data
UINT UINT / WORD UnsignedShort 0 ... 65535 16-bit data
DINT DINT Int -2.1e9 ... 2.1e9 32-bit data
UDINT UDINT / DWORD UnsignedInt 0 ... 4.2e9 32-bit data
LINT --- --- -9.2e19 ... 0.2e19 64-bit data
IEEE single-precision
REAL REAL Float 1.17e-38 ... 3.40e38
32-bit floating point type
IEEE double-precision
LREAL --- Double 2.2e-308 ... 1.79e308
64-bit floating point type

©2020 EXOR International S.p.A. All rights reserved 5


CODESYS objects
POUs (Program Organization Units)
default: PLC_PRG
can be Program, Function or Function block
every POU has variable declaration and code
language can be selected

Library Manager
standard 3S libraries for utilities
EXOR libraries to manage specific scenarios
PT100 and thermocouples (PLIO03)
NM2000
NEW
in 4.0

©2020 EXOR International S.p.A. All rights reserved 6


Communication stacks

CANOpen Master Profinet I/O Master

Modbus TCP/RTU Master/Slave EtherCAT Master

EtherNet/IP Scanner PowerLink Master

NOTE: Support depends on hardware capabilities

©2020 EXOR International S.p.A. All rights reserved 7


CODESYS Development software
Download from EXOR website

Many versions can be installed in the same PC

Standard 3S Environment

NOTE: CODESYS v2.3 is not compatible with CODESYS v3.5


©2020 EXOR International S.p.A. All rights reserved 8
CODESYS EXOR Targets
Distributed into JMobile Installation folder

Once CODESYS is installed, double click on Target Package file


to install EXOR Targets into CODESYS software

Or by opening Tools > Package Manager > Install and selecting the package

©2020 EXOR International S.p.A. All rights reserved 9


CODESYS v3: create a new project

©2020 EXOR International S.p.A. All rights reserved 10


CODESYS v3: create a new project

©2020 EXOR International S.p.A. All rights reserved 11


CODESYS v3: create a new project

©2020 EXOR International S.p.A. All rights reserved 12


CODESYS v3: create a new project

©2020 EXOR International S.p.A. All rights reserved 13


CODESYS v3: create a new project

©2020 EXOR International S.p.A. All rights reserved 14


CODESYS v3: create a new project

©2020 EXOR International S.p.A. All rights reserved 15


Create a new project - remarks
Select the device based on HMI series:

500/600 (WCE)
for eTOP500 and eTOP600

600L/700 (Linux)
for JSmart700, eX700, eXware700, eSMART107

eSMART (Linux) *
for eSMART04, 07M, 10

* CODESYS Retentive variables not supported


©2020 EXOR International S.p.A. All rights reserved 16
CODESYS v3: symbol configuration

©2020 EXOR International S.p.A. All rights reserved 17


CODESYS v3: symbol configuration

©2020 EXOR International S.p.A. All rights reserved 18


CODESYS v3: symbol configuration

©2020 EXOR International S.p.A. All rights reserved 19


CODESYS v3: symbol configuration

©2020 EXOR International S.p.A. All rights reserved 20


CODESYS v3: symbol configuration

©2020 EXOR International S.p.A. All rights reserved 21


CODESYS v3: symbol configuration

©2020 EXOR International S.p.A. All rights reserved 22


Symbol configuration - remarks
Right-Click on Application, then select
Add Object > Symbol Configuration...

Inside Symbol Configuration click "Build"

Go to Build > Generate code to generate the .xml file


xml file is used as the tag import file to bring all selected variables into the JMobile
project

OPTIONAL: select "Support OPC UA features" to expose symbols via


CODESYS OPC UA Server

©2020 EXOR International S.p.A. All rights reserved 23


CODESYS v3: download to PLC

©2020 EXOR International S.p.A. All rights reserved 24


Download to PLC - remarks
Online > Login
will open a dialog box to confirm the download to the PLC.
At that time, the code is in RAM. A restart of HMI will erase
the PLC code

Online > Create boot application


will save the PLC application to flash

Debug > Start


will put the PLC in Run mode

©2020 EXOR International S.p.A. All rights reserved 25


CODESYS v3: configure protocol in JMobile

©2020 EXOR International S.p.A. All rights reserved 26


CODESYS v3: configure protocol in JMobile

Set localhost IP Address


in protocol configuration
(127.0.0.1)

©2020 EXOR International S.p.A. All rights reserved 27


CODESYS v3: configure protocol in JMobile

Import XML file


containing CODESYS
variables

©2020 EXOR International S.p.A. All rights reserved 28


Configure protocol - remarks
Add CODESYS v3 ETH protocol

Configure PLC IP address as 127.0.0.1

Import Tags from symbol file ".xml"

©2020 EXOR International S.p.A. All rights reserved 29


PLC Configuration: add local I/O plug-in

©2020 EXOR International S.p.A. All rights reserved 30


PLC Configuration: add local I/O plug-in

©2020 EXOR International S.p.A. All rights reserved 31


PLC Configuration: add local I/O plug-in

©2020 EXOR International S.p.A. All rights reserved 32


PLC Configuration: add remote I/O

©2020 EXOR International S.p.A. All rights reserved 33


PLC Configuration: add remote I/O

©2020 EXOR International S.p.A. All rights reserved 34


PLC Configuration: add remote I/O

©2020 EXOR International S.p.A. All rights reserved 35


PLC Configuration: add remote I/O

©2020 EXOR International S.p.A. All rights reserved 36


PLC Configuration: add remote I/O

©2020 EXOR International S.p.A. All rights reserved 37

You might also like