• Non ci sono risultati.

1. - Esercitazione in aula informatica (Prima Parte)

N/A
N/A
Protected

Academic year: 2021

Condividi "1. - Esercitazione in aula informatica (Prima Parte)"

Copied!
19
0
0

Testo completo

(1)

Università degli Studi di Modena e Reggio Emilia Automation

Robotics and System

CONTROL Università degli Studi

di Ferrara

PLC

First example

PLC

(2)

CoDeSys (Controller Development System)

• Sviluppato dalla ditta 3S Software (

www.3s-software.com

)

• su Personal Computer permette di progettare controllori per macchine

automatiche

• il compilatore a norma IEC 61131-3 genera un programma

eseguibile per l’ambiente di esecuzione real-time CoDeSys SP

RTE

RTE

• l’eseguibile viene installato appositamente sul PC target.

• su sistemi di controllo industriali (es. PLC):

Il programma CoDeSys viene fornito a chi acquista il PLC con un

nome o una interfaccia personalizzata dal costruttore del PLC.

(3)

CoDeSys (Controller Development System)

Modalità di funzionamento “simulazione”

permette di eseguire il programma sviluppato senza avere a

disposizione nè l’ambiente real-time CoDeSys SP RTE, nè un vero e

proprio PLC.

proprio PLC.

CoDeSys

consente di creare pannelli di visualizzazione grafica

“dimostrativi”

(4)

Indice

Installation

Starting CoDeSys

The First Project

Variables

Program Languages Overview

Variables

(5)

Installation



Running “Setup CodeSys V3 SP1”

http://www.3s-software.com/



Installation custom

-Select “CoDeSys V 3.2” e “3S Licensing Manager” (necessari)

-Don’t select:

-Don’t select:

-“CoDeSys Gateway Server”

- “CoDeSys SP RTE”

(6)

Starting CoDeSys

Launch from the Start menu.

CoDeSys interface has:

1. Menu bar and toolbar

2. Project Explorer

2. Project Explorer

3. Workspace

4. Output window: to display compiler and debugger messages

5. Status bar: to display the online connection between the programming

device and the target system

(7)

CoDeSys

Technical data:

• Real time kernel guarantees deterministic behaviour with jitter values in the µs

region without additional hardware components or operating system extensions

•Interface to I/Os: discrete I/O cards or standard field bus cards

•Configuration of most field buses directly in CoDeSys; no external tool required

•Many supported field bus cards, such as Hilscher (CIF), Siemens Profibus,

Beckhoff Profibus, Applicom, HMS Profibus, Automata CAN/SERCOS, PEAK

CAN. Open API driver interfaces with Software Developer Kit (SDK) for

customized I/O cards

•Configurable start up behaviour

(8)

The First Project

Task 1: Handle a dummy traffic signal unit.

The red/green phases of both traffic signals alternate and we have to

handle the request of pedestrian crossing to stop the traffic.

Task 2: We will insert a yellow transitional phase.

Step by step procedure

1. Create a schema solution, a new project and a new program

2. Compile a project

3. Run the simulator and transfer the project to the target

4. Configure the visualization

(9)

The First Project

Create a schema solution

Car access

GREEN LIGHT

Wait pedestrian request to stop the traffic

START

The red/green phases of both traffic signals

alternate and we have to handle the request of

pedestrian crossing to stop the traffic.

We have to think and design a solution draw a

stop the traffic.

Stop cars

RED LIGHT

After the pedestrian cross the road reset the state.

Pedestrian request NOT Pedestrian request

We have to think and design a solution draw a

simple diagram that is directly connected to

the PLC program.

In the schema have to define:

- States

(10)

A project contains all of the objects in a PLC program. Object: POUs (Program Organization Units), data types, visualizations, resources, and libraries.

Each project needs a program called PLC_PRG.

Select File > New Project > Stardard

Project

Target configuration:

NONE

or

The First Project

Create a new project and a new program

Target configuration:

NONE

or

CoDeSys SP Win V3

Define new POU using Ladder Diagram

(LD)

In Project Explorer select Resources

and Global variables to open the editor

for declaring data.

(11)

Ladder diagram (LD) è un linguaggio di programmazione grafico che segue i principi di un circuito elettrico.

Il linguaggio a contatti è adatto alla progettazione di circuiti logici. Il linguaggio a contatti è composto da una sequenza di reti.

Una rete è limitata a sinistra e a destra da una linea elettrica verticale sinistra e da una linea elettrica verticale destra.

Elementi usati sono: contatti, bobine, moduli opzionali (POU) e linee di connessione.

The First Project

Ladder diagram (LD)

Elementi usati sono: contatti, bobine, moduli opzionali (POU) e linee di connessione.

Ciascuna rete, sul lato sinistro, è composta da una serie di contatti che, da sinistra verso destra, trasmettono lo stato "ON" oppure "OFF"; questi stati corrispondono ai valori booleani TRUE e FALSE. Ad ogni contatto appartiene una variabile booleana. Se questa variabile è TRUE, lo stato viene trasmesso da sinistra verso destra tramite la linea di connessione; in caso contrario la connessione di destra riceve il valore OFF.

(12)

• LOGIC

AND serial connection of two or more contacts

OR parallel connection of two or more contacts

The First Project

Ladder diagram (LD)

Negations

Jumps to skip over networks in the program, using a symbolic name of a jump label

(13)

Car access

GREEN LIGHT

Wait pedestrian request to START

• Ladder diagram program is dived in

Network

• Each network can be linked to a part of the solution schema

The First Project

Compiling a project and trasferring the project

Wait pedestrian request to stop the traffic.

Stop cars

RED LIGHT

After the pedestrian cross the road reset the state.

(14)

CoDeSys HMI can be installed with the standard CoDeSys setup We want plot a dummy traffic light unit which will illustrate

the switching process.

• Select Visualization > Add Object and set “Lights” as name of the new visualization.

• Select Insert > Eclipse and try to draw a circle

The First Project

Visualizing the solution to test the program sequence

• Now doubleclicking the circle and set

Variable>Change Color> “variable of light” Color>Inside> choose black

Alarm color>Inside> choose red

And set others two light in the same way.

(15)

CoDeSys HMI can be installed with the standard CoDeSys setup We want plot a dummy traffic light unit which will illustrate

the switching process.

• Select Visualization > Add Object and set “Lights” as name of the new visualization.

• Select Insert > Eclipse and try to draw a circle

The First Project

Visualizing the solution to test the program sequence

• Now doubleclicking the circle and set

Variable>Change Color> “variable of light” Color>Inside> choose black

Alarm color>Inside> choose red

And set others two light in the same way.

• Insert a button to define the request of pedestrian crossing.

• Define a Image repository under POU section: declare new object and new image repository. Then on the right side it will open a image list where you can declare your image.

(16)

Step:



Online> Simulation



Compile application



Online>Log In



Download

The First Project

PLC SIMULATOR



Download



Toolbar Start

(17)

RESET A CALDO

Questo comando (categoria In linea) è disponibile in modalità in linea. Esso reimposta tutte le variabili – ad eccezione di quelle rimanenti (retain, persistenti) – ai valori di inizializzazione.

RESET A FREDDO

Questo comando (categoria In linea) è disponibile in modalità in linea. Questa procedura

corrisponde al comando 'Reset' (Reset a caldo) con la differenza che, in questo caso specifico,

The First Project

PLC SIMULATOR - Reset

corrisponde al comando 'Reset' (Reset a caldo) con la differenza che, in questo caso specifico, vengono resettate ovvero riportate ai loro valori di inizializzazione, oltre alle variabili "normali", anche quelle di retain (!). Questa condizione è analoga a quella che si produce all'avvio di un programma applicativo, che sia già stato caricato sul controllo ("Avvio a freddo").

RESET ORIGINE

Questo comando (categoria In linea) è disponibile in modalità in linea. Esso reimposta i valori di tutte le variabili rimanenti ai valori di inizializzazione ed elimina il programma di applicazione dal controllo.

(18)

The First Project

Task 1: Handle a dummy traffic signal unit.

The red/green phases of both traffic signals alternate and we have to

handle the request of pedestrian crossing to stop the traffic.

Task 2: Insert a yellow transitional phase.

Task 2: Insert a yellow transitional phase.

Task 3: Control two traffic signals at an intersection. The red/green phases

of both traffic signals alternate and, in order to avoid accidents, we

will insert yellow or yellow/red transitional phases.

(19)

PLC

Riferimenti

Documenti correlati

Additionally, the dipole moment of trans-propargylamine was determined by Stark effect mea- surements (the values µ a = 0.586 D and µ b = 0.445 D being derived), but the very

Se all’atto della fondazione di Santa Maria degli Angeli era già presente a Firenze il monastero camaldolese di San Salvatore e altri se ne aggiungeranno negli

cole si sarebbe infatti proposto di rimediare alla scarsa rappresentativita` del palazzo di corte e della citta` di Ferrara nel suo complesso; ma il principio che il baricentro

In particular it linearizes the system in the following way: if the input signal at the gate increases, a larger drain current will flow through the inductor, its voltage drop

Gli sforzi di Totila, durante il 550 e il 551, sono quindi rivolti alla conquista della Sicilia e allo spoglio delle ricchezze dei Siciliani, «gli alleati più

The fact that an obstacle accelerates exiting from a bounded path, and that the increasing speed of the crowd results in a higher probability of traffic jam—important aspects in

Due to more complex SE spectra, the accuracy of the model describing the optical properties of silver nanoparticle arrays did not allow us to identify the surface premelting;

The language centre, together with the Internationalisation office, are attempting to meet the needs of a growing number of academic staff who are teaching their content