0% found this document useful (0 votes)
578 views74 pages

CoDeSys Version 3.5 First Steps Ver. 1

The document provides steps for getting started with the CoDeSys programming software for PLCs. It outlines 14 main steps, including starting up the CoDeSys software, setting options, adding hardware packages, configuring I/O, adding libraries, writing the program in different languages like ladder logic and function block diagram, compiling the program, setting communication settings, downloading the program to the PLC, running the program, and saving the project. Each main step contains additional sub-steps that provide instructions and screenshots to guide the user through the process.

Uploaded by

Redenel Serquina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
578 views74 pages

CoDeSys Version 3.5 First Steps Ver. 1

The document provides steps for getting started with the CoDeSys programming software for PLCs. It outlines 14 main steps, including starting up the CoDeSys software, setting options, adding hardware packages, configuring I/O, adding libraries, writing the program in different languages like ladder logic and function block diagram, compiling the program, setting communication settings, downloading the program to the PLC, running the program, and saving the project. Each main step contains additional sub-steps that provide instructions and screenshots to guide the user through the process.

Uploaded by

Redenel Serquina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

CoDeSys – First Steps

The IEC 61131-3 Programming System

ABTEILUNG/Name
Steps
Step To do
1 Starting Up the CoDeSys Software
2 Setting the Options
3 Adding in New Packages for the Hardware
4 Getting Started
5 The IOs
6 The Library
7 The Program
8 Compiling the Program
9 Controlling the Communication Settings
10 Task Configuration

ABTEILUNG/Name
Steps
Step To do
11 Setting the Communication Parameter
12 Downloading the Program
13 Running the Program
14 Saving the Program/Project

ABTEILUNG/Name
Step To do
1.1 Starting Up the CoDeSys Software

Start up the CoDeSys software and you will get


the following screen:

ABTEILUNG/Name
Step To do
1.2 Starting Up the CoDeSys Software

It is recommended to run the program at 96 dpi.


You can choose to ignore this if you wish.

ABTEILUNG/Name
Step To do
2.1 Setting the Options

Before starting the new project, you might want


to change some settings.

The following are just recommended settings; you


need not set them if you wish.

Go to Tools, Options

ABTEILUNG/Name
Step To do
2.2 Setting the Options

Choose International Settings in the left panel.

Here, you can choose the language that you


want.

ABTEILUNG/Name
Step To do
2.3 Setting the Options

Choose Features and click on the Predefined


feature sets button.

ABTEILUNG/Name
Step To do
2.4 Setting the Options

Choose Professional and click OK

ABTEILUNG/Name
Step To do
2.5 Setting the Options

Choose Load and Save.

Click on At startup and choose Show empty


environment

ABTEILUNG/Name
Step To do
2.6 Setting the Options

Click OK

ABTEILUNG/Name
Step To do
2.7 Setting the Options

Choose FBD, LD and IL editor.

Choose the items you want to view in your


program and click OK

ABTEILUNG/Name
Step To do
2.8 Setting the Options

Choose CoDeSys 2.3 converter and click on


“(Enter a new mapping here..)”

ABTEILUNG/Name
Step To do
2.9 Setting the Options

Choose Festo CPX-CEC/CPX-CEC-C1 and click OK

ABTEILUNG/Name
Step To do
3.1 Adding the New Packages for the Hardware

In order to include the hardware into the


program, you need to install the package.

Click Tools; Package Manager

ABTEILUNG/Name
Step To do
3.2 Adding the New Packages for the Hardware

Click the icon Install new packages

Click the button CD or disk...

ABTEILUNG/Name
Step To do
3.3 Adding the New Packages for the Hardware

Locate where you place the package file.

Click on the file and click Open.

ABTEILUNG/Name
Step To do
3.4 Adding the New Packages for the Hardware

Click the button Start installation

ABTEILUNG/Name
Step To do
3.5 Adding the New Packages for the Hardware

Choose Typical setup

Click Next

ABTEILUNG/Name
Step To do
3.6 Adding the New Packages for the Hardware

Click Next

ABTEILUNG/Name
Step To do
3.7 Adding the New Packages for the Hardware

ABTEILUNG/Name
Step To do
3.8 Adding the New Packages for the Hardware

Click Finish

ABTEILUNG/Name
Step To do
3.9 Adding the New Packages for the Hardware

The package with the hardware should be


installed.

ABTEILUNG/Name
Step To do
4.1 Getting Started

We will now start creating a new program.

On the File menu, click New Project….

Another option would be to click directly on the


Create a new project icon.

ABTEILUNG/Name
Step To do
4.2 Getting Started

Choose Empty project

Give your project a name. In this case; First


Project

Click OK

ABTEILUNG/Name
Step To do
4.3 Getting Started

Right-click on First Project

Click on Add Device

ABTEILUNG/Name
Step To do
4.4 Getting Started

Alternatively, you can go to Project, Add Device

ABTEILUNG/Name
Step To do
4.5 Getting Started

Choose the PLC you want to program to.

If it is not there, you need to install the hardware


package as previously described.

Give a name to the device and click Add Device

Click Close

ABTEILUNG/Name
Step To do
4.6 Getting Started

Your device should appear under the project


heading.

ABTEILUNG/Name
Step To do
5.1 The IOs

Before we start, it is recommended that we


configure our inputs and outputs for the program.

Click Digital inputs under the heading of


“Onboard”

A new window will appear on the right; you would


also be able to see a tab with the Digital Inputs
heading.

ABTEILUNG/Name
Step To do
5.2 The IOs

Here you can declare the input variables.

ABTEILUNG/Name
Step To do
5.3 The IOs

You can give it a symbolic name and also the


description.

The absolute address can also be seen.

ABTEILUNG/Name
Step To do
5.4 The IOs

You can do the same for the digital outputs.

ABTEILUNG/Name
Step To do
5.5 The IOs

This is how the different hardware variables are


called.

ABTEILUNG/Name
Step To do
6.1 The Library

Before writing the program, you might want to


add in the relevant libraries.

This need not be done at this early stage.

You can add in the library at any time when


needed.

Click on Library Manager on the left window.

Click on Add library in the right window.

ABTEILUNG/Name
Step To do
6.2 The Library

Choose the library Standard under Application;


Common.

Click OK

ABTEILUNG/Name
Step To do
6.3 The Library

The new library will be added and you should be


able to see what it contains at the bottom left
window.

ABTEILUNG/Name
Step To do
7.1 The Program

We can now start writing the program.

Right-click on Application

Click on Add Object

Click on POU

ABTEILUNG/Name
Step To do
7.2 The Program

Similarly, you can add it in from the main menu.

ABTEILUNG/Name
Step To do
7.3 The Program

Type in the name.

Choose Program

Click Open

ABTEILUNG/Name
Step To do
7.4 The Program

The programming window will appear on the


right.

You can start writing your program by adding in


the required symbols for LD.

You can click the relevant elements from the


toolbar at the top.

ABTEILUNG/Name
Step To do
7.5 The Program

At the symbols you will see question marks; you


are required to allocate the relevant variables.

ABTEILUNG/Name
Step To do
7.6 The Program

Click on the box next to the ???

ABTEILUNG/Name
Step To do
7.7 The Program

You can choose the variables from the Input


Assistant

ABTEILUNG/Name
Step To do
7.8 The Program

Choose the variable and click OK

ABTEILUNG/Name
Step To do
7.9 The Program

Complete the program.

ABTEILUNG/Name
Step To do
7.10 The Program – Program in Different Languages

Anytime during the writing of the program, you


can change to another language.

The three languages are:

• Ladder Diagram
• Function Block Diagram
• Instruction List

ABTEILUNG/Name
Step To do
7.11 The Program – Program in Different Languages

Click FBD/LD/IL

Click View

Choose the language you want to view your


program.

ABTEILUNG/Name
Step To do
7.12 The Program – Program in Different Languages

Choose the language you want to view your


program.

ABTEILUNG/Name
Step To do
8.1 Compiling the Program

After writing the program, we need to compile or


build the program.

This is to check for any errors.

Click on the Build in the menu bar and then click


Build or press F11.

ABTEILUNG/Name
Step To do
8.2 Compiling the Program

Make sure that there are no errors.

Errors and warnings will be displayed in the


bottom window.

You need not clear the warnings but all errors


must be solved or you will not be able to
download the program into your hardware.

ABTEILUNG/Name
Step To do
9.1 Controlling the Communication Settings

Before downloading the program we must be


sure that the communication settings between
the PLC and the PC are correct.

Connect the network cable to the PLC as well as


to the PC either directly or with a hub.

Check the address of the PLC.

Click Online

Click Scan Festo devices

ABTEILUNG/Name
Step To do
9.2 Controlling the Communication Settings

After scanning, you would be able to see the PLC


with its IP address. Take note of the address.

If you wish, you can change the IP address of the


PLC.

This is to make sure that if there are more than


one PLC in the network, they have the same first
three numbers and a different last number.

Click OK

ABTEILUNG/Name
Step To do
9.3 Controlling the Communication Settings

Now, you must change the computer network IP


address for your PC from your control panel,
network settings.

This is done in your PC depending on the version


of Windows you are using.

Click Change Adapter Settings

ABTEILUNG/Name
Step To do
9.4 Controlling the Communication Settings

Right-click on Local Area Connection, then click


on Properties

ABTEILUNG/Name
Step To do
9.5 Controlling the Communication Settings

Click on Internet Protocol Version 4 (TCP/IPv4)

Click OK

ABTEILUNG/Name
Step To do
9.6 Controlling the Communication Settings

Key in the IP address for the PC based on the one


from the PLC, remember that the last number
should be different.

Click OK

Then close all windows.

ABTEILUNG/Name
Step To do
10.1 Task Configuration

Before downloading the program, we need to set


the task.

This will tell the software which program to


download to the hardware.

Right-click on Application

Click Add Object

Click Task Configuration

ABTEILUNG/Name
Step To do
10.2 Task Configuration

Click Open

ABTEILUNG/Name
Step To do
10.3 Task Configuration

Click Add

ABTEILUNG/Name
Step To do
10.4 Task Configuration

Choose the POU

Click OK

ABTEILUNG/Name
Step To do
10.5 Task Configuration

The POU should appear in the box below.

ABTEILUNG/Name
Step To do
10.6 Task Configuration

You should see the Task in the left window.

ABTEILUNG/Name
Step To do
11.1 Setting the Communication Parameter

A next step is to set the communication


parameter.

Double-click on the device.

A new window will open on the right panel.

ABTEILUNG/Name
Step To do
11.2 Setting the Communication Parameter

Choose the hardware and click Set active path

ABTEILUNG/Name
Step To do
12.1 Downloading the Program

Once we have communication, we can download


the program.

Click Online

Click Login

If there is an existing program in the PLC, click Yes


to overwrite the existing program.

ABTEILUNG/Name
Step To do
12.2 Downloading the Program

The program is downloaded.

ABTEILUNG/Name
Step To do
13.1 Running the Program

After getting Online click Start to run the


program.

ABTEILUNG/Name
Step To do
13.2 Running the Program

You can also click the icon

The program is now running.

ABTEILUNG/Name
Step To do
13.3 Running the Program – Monitoring the Program

When the program is running, you might want to


monitor the IOs.

Click on Debug

Click Write values

ABTEILUNG/Name
Step To do
13.4 Running the Program – Monitoring the Program

Click Run

ABTEILUNG/Name
Step To do
13.5 Running the Program – Monitoring the Program

When you run the program, you would be able to


see the contacts change colour.

ABTEILUNG/Name
Step To do
13.5 Running the Program – Logging Out

To logout, go to Online

Click Logout

ABTEILUNG/Name
Step To do
14.1 Saving the Program/Project

To save the program, click File

Click Save Project or the Save icon.

ABTEILUNG/Name

You might also like