Click and Start M340 EN_V1_modified.ppt
-
Upload
shaikhsajid242 -
Category
Documents
-
view
204 -
download
7
description
Transcript of Click and Start M340 EN_V1_modified.ppt
Schneider Electric 1
Tutorial
Unity Pro & Modicon M340Developing your first project with Unity Pro
Schneider Electric 2
The purpose of this tutorial is to show you how easy it is to use Unity Pro by means of a practical application controlled by the Modicon M340 programmable logic controller (PLC).
Your first Unity Pro projectProgramming in LD Programming in ST To find out moreOn-line modification
The chosen application is a
conveyor belt that transports boxes to place them in batches of 10 on a
pallet.
The chosen application is a
conveyor belt that transports boxes to place them in batches of 10 on a
pallet.
Schneider Electric 3
Your first Unity Pro project Goals
Programming in LD Programming in ST To find out moreOn-line modification
Starting from an application specification of requirements, we are going to show you the project development principles using Unity Pro
The project will be debugged on the PLC simulator and then configured to run on the real PLC. Recorded demonstrations of the operating modes will also be proposed.
The project will be debugged on the PLC simulator and then configured to run on the real PLC. Recorded demonstrations of the operating modes will also be proposed.
The tutorial is divided into four parts:
1. Programming in LD (Ladder Diagram language): this part presents the method to be used to create a project, the programming procedures in LD, as well as project debugging.
2. Programming in ST (Structured Text language): this part presents the programming and debugging procedures in ST, as well as how to use the operator screens to view and control the process.
3. On-line modification: presents the procedures required for the on-line modification of the program.
4. To find out more: this last part of the tutorial shows how easy it is to integrate Modicon M340 PLC, programmed with Unity Pro, in an automation architecture: controlling an ATV31 variable speed drive, operator dialog with a Magelis XBT GT terminal.
The tutorial is divided into four parts:
1. Programming in LD (Ladder Diagram language): this part presents the method to be used to create a project, the programming procedures in LD, as well as project debugging.
2. Programming in ST (Structured Text language): this part presents the programming and debugging procedures in ST, as well as how to use the operator screens to view and control the process.
3. On-line modification: presents the procedures required for the on-line modification of the program.
4. To find out more: this last part of the tutorial shows how easy it is to integrate Modicon M340 PLC, programmed with Unity Pro, in an automation architecture: controlling an ATV31 variable speed drive, operator dialog with a Magelis XBT GT terminal.
Schneider Electric 4
Your first Unity Pro project Methodological approach
Programming in LD Programming in ST To find out moreOn-line modification
The installation we want to control is a conveyor belt that is used to transport boxes which are placed in batches of 10 on a pallet and then dispatched. An expression of requirements will be proposed for each function, as well as a development methodology.
The chosen application breaks down into three functions:
The Conveyor function which is used to control the conveyor belt.
The Palletizer function which is used to count the boxes and process a new pallet.
The Management function which makes it possible to stop the conveyor belt after a certain lapse of time, if there are no boxes left on the conveyor.
The chosen application breaks down into three functions:
The Conveyor function which is used to control the conveyor belt.
The Palletizer function which is used to count the boxes and process a new pallet.
The Management function which makes it possible to stop the conveyor belt after a certain lapse of time, if there are no boxes left on the conveyor.
Schneider Electric 5
Unity Pro allows you to program the following PLCs: Modicon M340, Premium, Atrium, Quantum . The Project Browser visualizes the organization of the project and gives the access to the editors. The windows are repositionable on the screen and can be posted according to several modes (full page, reduced, floating)
Your first Unity Pro project Introduction to Unity Pro
Definition of the hardware
configuration
Data declaration
Programs structuration and
creation Creation of the application's graphic
operator screens
Creation of animation tables for the application's variables
Editing window
Tool bar
Menu bars
Information window
Status line
Logical axes configuration
Logical Networks configuration
Programming in LD Programming in ST To find out moreOn-line modification
Schneider Electric 6
Expression of requirements for the conveyor
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
The installation includes a conveyor belt and a control panel
Use the mock-up buttons to understand the expression of requirements
The input requirements:• A RUN input to start the conveyor• A STOP input to stop the conveyor• An URGENCY emergency shutdown input
The input requirements:• A RUN input to start the conveyor• A STOP input to stop the conveyor• An URGENCY emergency shutdown input
The output requirements: • A MOTOR command output • A RUNNING indicator light output
The output requirements: • A MOTOR command output • A RUNNING indicator light output
Remark:In this first phase we are going to define the input/output information required, without assigning the real inputs/outputs for the moment; with the project being tested on the Unity Pro simulator.The inputs/outputs will be assigned in phase 3
Remark:In this first phase we are going to define the input/output information required, without assigning the real inputs/outputs for the moment; with the project being tested on the Unity Pro simulator.The inputs/outputs will be assigned in phase 3
Programming the conveyor in LD language
Schneider Electric 7
Your first Unity Pro project Development methodology
The development chronology that we propose is as follows:
Expression of requirements
Expression of requirements
AnalysisAnalysis
Running Unity ProRunning Unity Pro
Project creationProject creation
Data declarationData declaration
Program creationProgram creation
Transfer of the project to the simulator
Transfer of the project to the simulator
Transfer to RunDynamic visualization of the program and setting of the
variables
Transfer to RunDynamic visualization of the program and setting of the
variables
Analysis of the program and code generation
Analysis of the program and code generation
Taking charge of the application Project development Project debugging
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Schneider Electric 8
Analysis of the expression of requirementsDebuggingProgramming in LD Code generationProject creation
Expression of requirements Analysis Data declaration Customization
This phase consists of determining the conveyor belt's command logic
RUN MOTOR
MOTOR
STOPURGENCY
RUNNING
Conveyor Command
Program structure:
The conveyor starts up when the user presses the RUN button, provided there is no emergency stop.
The conveyor stops when the user presses the STOP button or when there is an emergency stop.
The program will be developed in Ladder Diagram language (LD).
Program structure:
The conveyor starts up when the user presses the RUN button, provided there is no emergency stop.
The conveyor stops when the user presses the STOP button or when there is an emergency stop.
The program will be developed in Ladder Diagram language (LD).
Programming the conveyor in LD language
Schneider Electric 9
Project creation (1/3)
Using the Unity Pro software we are now going to:• Create a new project called "Machine"• Define the PLC's family and reference
Select the File/New menu.
2
The project structure is
created.
3
Programming the conveyor in LD language
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
1
Select the PLC: BMX P34 2030 and validate by clicking OK.The browser then presents an application
structure.
Schneider Electric 10
5
4
Naming and saving the project:
Right click on Station and select the Properties menu, so you
can give the name and type in the comments for the project.
Programming the conveyor in LD languageProject creation (2/3)
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
MachineSave the project using the
File/Save menu (*.STU file).
Projet_Machine
Schneider Electric 11
Demonstrations of the various procedures are proposed in this tutorial. Run the demonstrations, then carry out the procedure presented with Unity Pro yourself.
Demonstration
Read Pause Rewind
Now, it's your turn…Run the Unity Pro software and carry out the project creation operations.
Meaning of the commands available during the demonstration
END will be displayed at the end of the demonstration, and the film winds back to the beginning.Click on the Pause button if you want to freeze on the last image.Close the demonstration before passing in the following page .
Click on the icon shown opposite to run the demonstration on application creation
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Programming the conveyor in LD languageProject creation (3/3)
Schneider Electric 12
The data can be declared:- either using the data editor,- or gradually, as you key in the program.
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
We are going to declare the input data for the Conveyor program in the data editor. The output data will be declared gradually as you create the program.
We are going to declare the input data for the Conveyor program in the data editor. The output data will be declared gradually as you create the program.
Name Type Comment
RUN EBOOL Start conveyor
STOP EBOOL Stop conveyor
URGENCY EBOOL Emergency stop
Name Type Comment
MOTOR EBOOL Conveyor Motor command
RUNNING
EBOOL Motor Run/Stop indicator light
Inputs Outputs
Remark: we will type-define the I/O variables in EBOOL so that we can then associate them with the PLC's module channels.
Programming the conveyor in LD languageData declaration (1/2)
Schneider Electric 13
1
On the Unity Pro workshop, you can use variables simply by declaring the name and type but without having to declare the address: these variables are non-localized, it is the system that assigns these addresses internally.
Double click on Elementary variables
to access the data editor. 2
Indicate :the variable's namethe type of variable : EBOOLthe comment relative to the variable.
3 Declare all the following variables
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Remark: the other items of data will be declared gradually as you create the LD program
Programming the conveyor in LD languageData declaration (2/2)
Schneider Electric 14
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
A Unity Pro project may be comprised of several tasks (master task created by default and which represents the main task, event-related tasks, etc.). The tasks are made up of sections and sub-routines. The order of the sections determines the program polling order.
12
Right-click on Section and select the New
section menu.
Type in the Name of the section and select
LD language then click on OK to validate.
Programming the conveyor in LD languageCreating the conveyor section (1/3)
Schneider Electric 15
Building the network of contacts using the variables that have already been declared
Select the type of object.
Place the object on
the desired cell.
Place the object on
the desired cell.
Click to enter the contact
Click to enter the contact
Select the object on the list by double-
clicking (Inside structure box not
checked)
Select the object on the list by double-
clicking (Inside structure box not
checked)
Remark: the data input screen is divided up into cells receiving the various objects. You can display the object's meaning by hovering over it with the mouse.
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
2
1
3
5Double click on … to
show the list of variables already
declared
Double click on … to show the list of
variables already declared
4
Programming the conveyor in LD languageCreating the conveyor section (2/3)
Schneider Electric 16
Creating the network of contacts with declaration of the variables gradually as you progress
Select the type of object and position it.
Select the type of object and position it.
Click to enter the object
Click to enter the object
Enter the object name
and click on OK to validate
Enter the object name
and click on OK to validate
Select the type of object and validate.
Select the type of object and validate.
Remark: the type of object proposed is always coherent with the selected object.
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
1 2
3
4
Programming the conveyor in LD languageCreating the conveyor section (3/3)
Schneider Electric 17
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Once you have finished keying in your program, we are going to Analyze the project (report the errors and warnings in the project) and then Rebuild All the project (essential the first time).
Remark
The PLC simulator allows you to simulate a project in its entirety with all the associated user tasks. However, the dynamics of the simulator's execution behavior cannot be compared with that of a real PLC.
Run the program on the simulator
You can run the project on : - the PLC, in which case you must define the configuration. - a PLC simulator, in which case it is not necessary to define the configuration.
When generating code, Unity Pro takes into account whether the target is the PLC or a simulator.
Run the program on the simulator
You can run the project on : - the PLC, in which case you must define the configuration. - a PLC simulator, in which case it is not necessary to define the configuration.
When generating code, Unity Pro takes into account whether the target is the PLC or a simulator.
Programming the conveyor in LD languageAnalysis and first build of the project (1/3)
Schneider Electric 18
Project analysis. Reporting of the errors and warnings with navigation towards the cause of origin
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Run project analysis.
Run project analysis.
Display the project's analysis result.
Display the project's analysis result.
Double-click on the element displayed in blue or in red,
Unity Pro automatically positions itself on the element
in question.
Double-click on the element displayed in blue or in red,
Unity Pro automatically positions itself on the element
in question.
1
2
A warning indicates an element that might raise a problem, but which does not prevent transfer to the simulator or PLC.An error prevents any transfer
A warning indicates an element that might raise a problem, but which does not prevent transfer to the simulator or PLC.An error prevents any transfer
3
Programming the conveyor in LD languageAnalysis and first build of the project (2/3)
Schneider Electric 19
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
1
2
Select the program's execution target on the PLC / Simulation Mode
menu.
Select the program's execution target on the PLC / Simulation Mode
menu.
The first build requires a complete rebuilding of the project. Subsequently, you only have to rebuild the changes.
Select the Build / Rebuild All Project
menu.
Select the Build / Rebuild All Project
menu.
Remark: the warnings are due to the fact that the CANopen bus has not been configured
3 Display of all the warnings or
errors that have been found
Display of all the warnings or
errors that have been found
Programming the conveyor in LD languageAnalysis and first build of the project (3/3)
Schneider Electric 20
Once the analysis is correct, we are going to debug the application using the PLC simulator by connecting up to it.
2
?3
Remark: The ? On the task bar indicates that the simulator has been run without any valid project.
Remark: The ? On the task bar indicates that the simulator has been run without any valid project.
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Select the PLC / Connect menu. The bar at the bottom displays the simulator's status.
Select the PLC / Connect menu. The bar at the bottom displays the simulator's status.
The simulator starts to runThe simulator starts to run
The bar indicates that the project opened in Unity Pro and the one
in the simulator are not the same.
The bar indicates that the project opened in Unity Pro and the one
in the simulator are not the same.
1
Programming the conveyor in LD languageDebugging the project (1/7)
Schneider Electric 21
1
Once the connection has been made and we can transfer the project to the simulator, we can run the project.
3
Select the PLC / Transfer Project to PLC menu.
Select the PLC / Transfer Project to PLC menu.
Click on Transfer.
Click on Transfer.
The bar indicates that the programs are identical but the
PLC is on STOP.
The bar indicates that the programs are identical but the
PLC is on STOP.
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
2
Programming the conveyor in LD languageDebugging the project (2/7)
Schneider Electric 22
Once the connection has been made, the project has been transferred on the simulator.
6
The bar indicates that the PLC is in RUN mode.
The bar indicates that the PLC is in RUN mode.
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Select the PLC / Run menu.
Select the PLC / Run menu.
4
5
Click on OK to switch the PLC to RUN mode.
Click on OK to switch the PLC to RUN mode.
Programming the conveyor in LD languageDebugging the project (3/7)
Schneider Electric 23
We will now be able to view the program in dynamic mode and modify the variables values to simulate conveyor operation.
1
2
The Conveyor section appears in dynamic mode.
The on-state contacts are displayed in reverse video (on blue background). Or in green color if link animation is selected during project
settings
The Conveyor section appears in dynamic mode.
The on-state contacts are displayed in reverse video (on blue background). Or in green color if link animation is selected during project
settings
Double-click on the Conveyor section
Double-click on the Conveyor section
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Programming the conveyor in LD languageDebugging the project (4/7)
Schneider Electric 24
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Modifying variables on the Ladder Diagram viewing screen.
1
Right-click then select the Modify
value menu and set the value to 1.
Right-click then select the Modify
value menu and set the value to 1.
Select the RUN variable.
Select the RUN variable.
3The motor has started and the
running indicator light is
on.
The motor has started and the
running indicator light is
on.
4
Set the RUN command to 0 (by repeating steps 1
and 2)
Set the RUN command to 0 (by repeating steps 1
and 2)
2
Programming the conveyor in LD languageDebugging the project (5/7)
Schneider Electric 25
Initializing an animation table to view the status of the conveyor section's variables.
1
Select box 3 by multiple selection
(Shift).
Select box 3 by multiple selection
(Shift).
Select box 2.Select box 2.
4The animation table
appears with the selected variables.
The animation table appears with the selected
variables.
Right-click then select the Initialize Animation Table
menu.
Right-click then select the Initialize Animation Table
menu.
2
3
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Programming the conveyor in LD languageDebugging the project (6/7)
Schneider Electric 26
Modifying the variables from the animation table.
1
Select the STOP
variable.
Select the STOP
variable.
Select the Modification
button.
Select the Modification
button.
4The STOP variable
is at 1 and the motor stops.
The STOP variable is at 1 and the motor stops.
Click on the set to 1 icon.
Click on the set to 1 icon.
2
3
DebuggingProgramming in LD Code generationProject creationExpression of requirements Analysis Data declaration Customization
Save the project.End of phase 1: Programming in LD
Programming the conveyor in LD languageDebugging the project (7/7)
Schneider Electric 27
We are now going to make an extension to the project by adding the palletizer to the previous installation. The conveyor brings the boxes which are then stacked 10 by 10 on a pallet
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Use the mockup buttons to understand the expression of requirements
The input requirements:• One input for the optical sensor used to count the boxes (Optical_sensor).• One New_palett input to remove the pallet, reset the counter (Number) to 0 and call up a new pallet.
The input requirements:• One input for the optical sensor used to count the boxes (Optical_sensor).• One New_palett input to remove the pallet, reset the counter (Number) to 0 and call up a new pallet.
The output requirements• One output for the Palett_full indicator light• One Blocker output to control the blocker that
stops the boxes from arriving.
The output requirements• One output for the Palett_full indicator light• One Blocker output to control the blocker that
stops the boxes from arriving.
Programming the palletizer in ST languageExpression of requirements for the palletizer (1/2)
Schneider Electric 28
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Expression of requirements
Expression of requirements
AnalysisAnalysis
Data declarationData declaration
Creation of the section in ST
language
Creation of the section in ST
language
DebuggingDebugging
Control by means of an operator screen
Control by means of an operator screen
Taking charge of the application Project development operator screens
The development chronology that we are proposing is as follows:
Programming the palletizer in ST languageExpression of requirements for the palletizer (2/2)
Schneider Electric 29
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Remark:In order to simulate the supply of boxes, every second for example, we will use the %S6 system bit
Remark:In order to simulate the supply of boxes, every second for example, we will use the %S6 system bit
Structure of the Palletization section
If the conveyor is running, the boxes are placed on the conveyor. The boxes are counted. When there are 10 boxes, the pallet is full and the blocker is activated. When requested by the operator, the pallet is removed so that a new one can be processed. The section will be programmed in Structured Text (ST) language. An operator screen is used to command process and view its status.
Structure of the Palletization section
If the conveyor is running, the boxes are placed on the conveyor. The boxes are counted. When there are 10 boxes, the pallet is full and the blocker is activated. When requested by the operator, the pallet is removed so that a new one can be processed. The section will be programmed in Structured Text (ST) language. An operator screen is used to command process and view its status.
Program structure and visualization of the process in Unity Pro with an operator screen.
operator screen
10
Programming the palletizer in ST languageAnalysis of the requirements
Schneider Electric 30
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
1
We are now going to add new variables to the existing list of variables.Disconnect the simulator (select the PLC/disconnect menu or the disconnection icon) to return to local mode.
2
3
Double-click on Elementary Variables to
access the data editor.
The screen appears with the variables that have already been declared.
Symbolize all of the following
data items(no spaces).
Help
Programming the palletizer in ST languageData declaration
Schneider Electric 31
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Creating the palletizer section in structured text (ST) language .
2
Key in the Section name (Palletizer) and select the ST language to be used. Click
on OK to validate.Right-click on Section
and select the New Section menu.
1
Programming the palletizer in ST languageCreating the palletizer section (1/4)
Schneider Electric 32
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Creating the program in Structured Text: simulation logic for the optical sensor using the variables that have already been declared
Key in the comment
between (* and *)
Right-click to call up the Data selection
tool.
Right-click to call up the Data selection
tool.
Double-click on the OPTICAL_SENSOR
variable.
Double-click on the OPTICAL_SENSOR
variable.
Click on … to display the list of variables already declared.
Click on … to display the list of variables already declared.
12
3
4
5 The variable
has been entered.
Remark: the variables can also be keyed in directly.
Programming the palletizer in ST languageCreating the palletizer section (2/4)
Schneider Electric 33
Key in the complete program shown below.The number of boxes is checked by means of the "If then else" control structure A template is proposed.
Click on the place where you
want to insert the control structure
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
IF THEN
ELSIF THEN
ELSE
END_IF;
1
2Click on the icon associated with
IFAn input template
is displayed
Fill in the template
3
Help
Programming the palletizer in ST languageCreating the palletizer section (3/4)
Schneider Electric 34
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Analyzing, generating and transferring the project to the simulator for debugging.
2
Select the Build changes menu to check the
modifications and build the code. In case of default make the corrections before doing a partial build of the code.
Select the Build changes menu to check the
modifications and build the code. In case of default make the corrections before doing a partial build of the code.
Remark: the Build Changes / Rebuild All Project command starts with the analysis, if this has not been done beforehand.
1
Switch to Connection mode and Transfer the
project to the simulator in the same way as in phase
1. Switch to RUN mode
Switch to Connection mode and Transfer the
project to the simulator in the same way as in phase
1. Switch to RUN mode
Programming the palletizer in ST languageCreating the palletizer section (4/4)
Schneider Electric 35
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Colors are used to display the status of the variables in dynamic viewing. The inspection windows make it possible to complete the view in the editor.
Color of the variables according to their status:
Boolean type: Green if the variable is TRUE,
Red if the variable is FALSE
Yellow background for the other types. Number
6
If you want to view the value of a numerical variable in a tooltip you just have to point at the variable with the
mouse.
The inspection windows allow you to view the status of the
variables. To do this put the cursor on the
variable then select the New inspect.
The inspection windows remain on display even if you scroll.
Programming the palletizer in ST languageDebugging the palletizer section (1/2)
Schneider Electric 36
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Initializing an animation table to view the status of the variables in the Palletizer section. Modification of the variable to check the operation of the machine.
Right-click and select Initialize Animation Table
menu or Initialize New Animation
table menu .
Right-click and select Initialize Animation Table
menu or Initialize New Animation
table menu .
Select the program for the Palletizer
section. Ctrl+A to select all the
program
Select the program for the Palletizer
section. Ctrl+A to select all the
program
1
2
Programming the palletizer in ST languageDebugging the palletizer section (2/2)
Schneider Electric 37
Unity Pro proposes operator screens that are designed to facilitate operation of an automated process.These screens can be built in local or connected mode. We are going to create a screen associated with the machine in connected mode.
1
2
Key in the name of the screen and
click OK to validate.
Select the New screen menu in the Operator
screens browser.
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Programming the palletizer in ST languageOperators screens (1/4)
Schneider Electric 38
Creating the content of the Conveyor screen.The input screen proposes a set of graphic objects with which animation variables can be associated. The input principle is as follows:
Select the Object type.
Draw the object
using the mouse.
Draw the object
using the mouse.
Rectangle Align with the topCommand button1
2
3
Double click to access the object's
properties.
Double click to access the object's
properties.Drawing tab: Modification of the object's color, line, patternAnimation type tab: Choice of the type of animation and display conditionAnimation tab: Choice of animation variable and display condition
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Enter the object's
properties.
Enter the object's
properties.
4
Programming the palletizer in ST languageOperators screens (2/4)
Schneider Electric 39
Creating the content of the Conveyor screen: objects taken from the library.Unity proposes a library of predefined objects: actuators, displays, PLCs, machines. The input principle is as follows:
Double click on the type of object
to be inserted
Select the object to be inserted and copy it using the context-
sensitive menu (right-click)
ToolsTools
Operator screen librariesOperator screen libraries
Select theTools / Operator screen
libraries menu.1
Moteur
3
Access the screen concerned, paste
the object.
4
2
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Programming the palletizer in ST languageOperators screens (3/4)
Schneider Electric 40
DebuggingProgramming in ST Operator screensExpression of requirements Analysis Data declaration Customization
Your now going to create the content of the conveyor screen, the texts in yellow indicate the variables to be associated with the objects (by the animation tab or the control tab for the object properties.
To enable write variables and perform the commands when
the screen is displayed: press the F7 key or click on the corresponding
icon
To enable write variables and perform the commands when
the screen is displayed: press the F7 key or click on the corresponding
icon
Save the project.End of phase 2: Programming in ST
Control STOP
Control RUN
Control URGENCY
Animation bit = 1
PALET_FULL
Animation bit = 1
OPTICAL_SENSOR
Animation : intNUMBER
Animation bit = 1
URGENCY
Animation bit = 1
Blocker
Animation bit = 0
RUNNING Control NEW_PALETT
Remark: the command buttons are active after pressing the F7 key, and you can carry out process control
Remark: the command buttons are active after pressing the F7 key, and you can carry out process control
Programming the palletizer in ST languageOperators screens (4/4)
Animation bit = 1
RUNNING
Schneider Electric 41
Extending the machine's functions by modifying the project on line.Our conveyor application stops if there are no boxes present for 10 seconds.There is a conveyor control command installed at the other end of the conveyor.
Use the mockup buttons to understand the expression of requirements
The input requirements:• The conveyor can be stopped or started from the other end of the conveyor belt (RUN1 and STOP1 inputs)• A No_box_Input input makes it possible to simulate the absence of boxes at the conveyor input.
The input requirements:• The conveyor can be stopped or started from the other end of the conveyor belt (RUN1 and STOP1 inputs)• A No_box_Input input makes it possible to simulate the absence of boxes at the conveyor input.
The internal variable requirements: In order to save power, the addition of a timer device will
stop the motor automatically when there are no boxes for more than 10 seconds.
• The end of timeout variable (Motor_Timer) will stop the motor.
• The (Timer) variable contains the timeout's current time.
The internal variable requirements: In order to save power, the addition of a timer device will
stop the motor automatically when there are no boxes for more than 10 seconds.
• The end of timeout variable (Motor_Timer) will stop the motor.
• The (Timer) variable contains the timeout's current time.
Configuration I/O data declarationExpression of requirements
On-line modification CustomizationDebugging
Extending the application in connected modeExpression of requirements for phase 3 (1/2)
Schneider Electric 42
Configuration I/O data declarationExpression of requirements
On-line modification Customization
Expression of requirements
Expression of requirements
On-line modification of the LD program
On-line modification of the LD program
Configuration of the PLC's inputs/outputs
Configuration of the PLC's inputs/outputs
Data assignment to the input/output
channels
Data assignment to the input/output
channelsDebuggingDebugging
On-line modification of the project Using a real PLC
The development chronology that we propose is as follows:
Debugging
Extending the application in connected modeExpression of requirements for phase 3 (2/2)
Schneider Electric 43
Configuration I/O data declarationExpression ofrequirements
On-line modification Customization
The following modifications should be made on line:
Modification to be made to the program's structure:
1.Creation of the new command for controlling the end of the conveyor: insertion of RUN1 and STOP1 contacts
2. Insertion of the conveyor's stop timeout in the absence of a box for 10 seconds
Modification to be made to the program's structure:
1.Creation of the new command for controlling the end of the conveyor: insertion of RUN1 and STOP1 contacts
2. Insertion of the conveyor's stop timeout in the absence of a box for 10 seconds
Name Type Comment
RUN1 EBOOL Start conveyor 1
STOP1 EBOOL Stop conveyor1
No_Box_Input BOOL Simulate absence of boxes
Name Type Comment
Motor_Timer EBOOL End of 10s timeout
The new input variables
The new output variables
1
2
2
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 44
Displaying the "conveyor" section in dynamic viewing
2
The on-state contacts are displayed in
reverse video (on blue background) or in
green color.
The on-state contacts are displayed in
reverse video (on blue background) or in
green color.
The conveyor section is displayed in dynamic
mode.
The conveyor section is displayed in dynamic
mode.
Configuration I/O data declarationExpression of requirements
On-line modification Customization
1
Double-click on the Conveyor section
Double-click on the Conveyor section
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 45
Configuration I/O data declarationExpression of requirements
On-line modification Customization
Inserting the RUN1 and STOP1 contacts:It will be necessary to move coils in order to insert a contact in the network.
1
Select the 2 coils and the vertical bar with Shift/Right-click.
Hold down the Right-click and move the selection.
Select the 2 coils and the vertical bar with Shift/Right-click.
Hold down the Right-click and move the selection.
Confirm the modification by clicking on Yes.
Confirm the modification by clicking on Yes.
The coils have been moved.
The coils have been moved.
2
3
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 46
Configuration I/O data declarationExpression of r
equirementsOn-line modification Customization
Inserting additional contacts with declaration of the variables as you progress.
3
Insert the contact and double-click to
enter the object name.
Insert the contact and double-click to
enter the object name.
Enter the object name and the type
of object then validate.
Enter the object name and the type
of object then validate.
1
2
Remark: The procedures are identical to those performed in phase 1
Complete the diagram with the
RUN1 and STOP1 contacts
Complete the diagram with the
RUN1 and STOP1 contacts
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 47
Configuration I/O data declarationExpression of requirements
On-line modification Customization
Taking the modifications into account: analysis of the modifications and partial building of the code
Select the Build changes menu to check that there
are no errors in the project, and perform partial
rebuilding of the code.
Select the Build changes menu to check that there
are no errors in the project, and perform partial
rebuilding of the code.The modified project
becomes active in the PLC (the modification was made with the PLC in RUN
mode).
The modified project becomes active in the
PLC (the modification was made with the PLC in RUN
mode).
1
2
Remarks:Debugging is carried out in the same way as when making the conveyor section, via an animation table.
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 48
Configuration I/O data declarationExpression of requirements
On-line modification Customization
Right-click then select the FFB
Input Assistant. menu
Right-click then select the FFB
Input Assistant. menu
Click on the … button to access the DFB library
Click on the … button to access the DFB library1
2
Select and expand the
Global Libraries <Libset>
Select and expand the Base
Lib family
Select and expand the Base
Lib family 3
4
Selecting a timer for monitoring the arrival of boxes.
Remark: the Application folder contains the function blocks already used in the project
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 49
Adding the stop conveyor timeout, filling out the TON function block using the function input assistant
Configuration I/O data declarationExpression of requirements
On-line modification Customization
5
Select the Timers & Counters
family
Select the Timers & Counters
family
Select the TON timer
Select the TON timer
Enter the name of the instance:
Stop_motor.
Use the Entry field to enter the name of the variables:
IN : No_Box_InputPT : T#10s
Q : motor_timerET : timer
Select OK to validate
6
7
8
Confirm the modification by clicking on Yes.
Confirm the modification by clicking on Yes.
9
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 50
Inserting the function block and filling out by creating new variables as you progress.Inserting the end of timer information in the logic of the motor command.Taking into account the modifications: analysis of the modifications and partial rebuild of the code.
Position the cursor at the required place on the screen then
click.
Position the cursor at the required place on the screen then
click.
Create the variables in the
data editor. To do this right click on the variable name and
select create variable menu
Create the variables in the
data editor. To do this right click on the variable name and
select create variable menu
1
Configuration I/O data declarationExpression of requirements
On-line modification Customization
Remark 2 : You must modify the first line of the Palletizer section written in ST language
Reminder of the project's list of
variables
Remark 1 : After having made the modifications, select the Analyze menu to check that there are no errors in the project, and do a partial rebuild of the code.
2
Move the coils and add the contact
Motor-timer
Move the coils and add the contact
Motor-timer
3
Debugging
Extending the application in connected modeOn-line modification of the Conveyor section
Schneider Electric 51
Configuration I/O data declarationExpression of requirements
On-line modification CustomizationDebugging
Verifying execution of the TON timer
Select the No_Box_Input variable.
Select the No_Box_Input variable.
Right-click and select the Modify
value menu
Right-click and select the Modify
value menu
1
2
3
Set No_Box_Input to 1, the time delay elapses and the motor stops after 10 s.
Set No_Box_Input to 1, the time delay elapses and the motor stops after 10 s.
Extending the application in connected modeDebugging
Schneider Electric 52
Using the real PLC: creation of the physical configuration.We are going to work with a real PLC: disconnect the simulator (select the local icon of the toolbox) to return to local mode.
Configuration I/O data declarationExpression of requirements
On-line modification Customization
12
Double-click on PLC bus to access the hardware configuration. The rack is displayed and we are going
to configure it.
Double-click on PLC bus to access the hardware configuration. The rack is displayed and we are going
to configure it.
Double-click on slot 1 which is going to receive the inputs/outputs
module.
Double-click on slot 1 which is going to receive the inputs/outputs
module.
Select the 8 inputs/ 8 outputs module DDM16022 in the discrete references
and click on OK to validate, the module is inserted in the rack.
Select the 8 inputs/ 8 outputs module DDM16022 in the discrete references
and click on OK to validate, the module is inserted in the rack.
4
The module has been
configured.
The module has been
configured.
3
Debugging
Configuring the PLCUsing the Modicon M340 PLC
Schneider Electric 53
1
Once the PLC's configuration has been defined, we are going to declare the addresses of the Inputs and Outputs.
Double-click on Elementary
variables to access the data editor.
Double-click on Elementary
variables to access the data editor.
Select theBLOCKER variable
Select theBLOCKER variable
2
RemarksPerform the same operation for all the input/output variables: Addressing: I (input), Q (output). rack.slot.channel.
Configuration I/O data declarationExpression of requirements
On-line modification Customization
Name Type Comment Address
RUN EBOOL Start conveyor %I0.1.0
RUN1 EBOOL Start conveyor 1 %I0.1.1
STOP EBOOL Stop conveyor %I0.1.2
STOP1 EBOOL Stop conveyor %I0.1.3
URGENCY EBOOL Emergency stop %I0.1.4
New_Palett EBOOL New pallet %I0.1.5
Name Type Comment Address
MOTOR EBOOL Conveyor motor command
%Q0.1.16
RUNNING EBOOL Motor On-Off indicator light
%Q0.1.17
Palett_Full EBOOL Pallet full %Q0.1.18
Blocker EBOOL Box blocker %Q0.1.19
3
Assign an address to the variable.
Assign an address to the variable.
Debugging
Using the Modicon M340 PLCInputs/Outputs data declaration (1/2)
Schneider Electric 54
If you to have a Modicon M340 PLC, you can now test your program. Analyse the modifications and generate the code as in the preceding phases, then transfer the application in the PLC and finally go to RUN mode.
Configuration I/O data declarationExpression of requirements
On-line modification Customization
1
Select the program's execution target on the PLC / Standard Mode
menu
Select the program's execution target on the PLC / Standard Mode
menu
Connect Unity Pro to the PLC and select the download icon
then click on Transfer.
Connect Unity Pro to the PLC and select the download icon
then click on Transfer.
2
Save the project.End of phase 3: On-line modification
NoteYou can go to simulation mode after having configured a real PLC (proceed as in phase 1: To program in LD.
Debugging
Using the Modicon M340 PLCInputs/Outputs data declaration (2/2)
Schneider Electric 55
CANopen
Unity Pro allows you very simply to configure automation architectures including a Modicon M340 PLC, a variable speed drive and an XBT GT operator terminal
MasterSlave
Controlling an ATV31 variable speed drive on a CANopen bus by a Modicon M340 PLC
Display of the PLC data on a Magelis XBT GT
operator terminal
USB link
Programming in LD Programming in ST To find out moreOn-line modification
To find out moreIntegration in an automation architecture
Schneider Electric 56
In our installation, an ATV31 speed drive is used to control the motor.Communication between the PLC and the ATV is ensured via the CANopen bus
Declare the equipment on the CANopen bus in Unity Pro.
Select the equipment ATV31
Declare the equipment on the CANopen bus in Unity Pro.
Select the equipment ATV31
Choose the data exchange profile between the Modicon M340 PLC and the ATV31
Choose the data exchange profile between the Modicon M340 PLC and the ATV31
If necessary, modify the exchange profile(addition or deletion of data exchanged)
If necessary, modify the exchange profile(addition or deletion of data exchanged)
Pre-symbolize the variablesPre-symbolize the variables
Use the data from the speed drive in the PLC application
Use the data from the speed drive in the PLC application
Implementation principle
Programming in LD Programming in ST To find out moreOn-line modification
Master
Slave
CANopen
To find out moreControlling an ATV 31 with a Modicon M340 (1/6)
Schneider Electric 57
Declaring the ATV device on the CANopen bus with the part number
Click to access Canopen Bus configuration.
Click to access Canopen Bus configuration.
Right click and select the New device menu.
Right click and select the New device menu.
Select the device.and define the
Canopen address
Select the device.and define the
Canopen address
1
2
3
Programming in LD Programming in ST To find out moreOn-line modification
To find out moreControlling an ATV 31 with a Modicon M340 (2/6)
Schneider Electric 58
Each profile contains the list of preset variables exchanged between the PLC and the speed drive.
Double click to access device configuration.
Double click to access device configuration.
Select PDO tab to display the tables send and receive
between the PLC and the speed drive
Select PDO tab to display the tables send and receive
between the PLC and the speed drive
Select the Standard profile for
example then validate.
Select the Standard profile for
example then validate.
1
2
3
Programming in LD Programming in ST To find out moreOn-line modification
To find out moreControlling an ATV 31 with a Modicon M340 (3/6)
Schneider Electric 59
If necessary modify the exchange profile: add or delete data exchanged
Transmitted variables
predefined by the profile
Possibility of adding variables by drag and drop
(High speed example )
Possibility of adding variables by drag and drop
(High speed example )
Received variables predefined by the
profile
Programming in LD Programming in ST To find out moreOn-line modification
To find out moreControlling an ATV 31 with a Modicon M340 (4/6)
Schneider Electric 60
Pre-symbolize the variables. To do this, access to I/O objects tab of speed drive reference.
Select the channel (%CH)
Select the channel (%CH)
Key in a prefix for the name of the set of
variables. e.g. MOTOR_ATV
then click on Create
Key in a prefix for the name of the set of
variables. e.g. MOTOR_ATV
then click on Create
Click on Update grid
Click on Update grid
1
2
3
Programming in LD Programming in ST To find out moreOn-line modification
MOTOR_ATV
Open the data editor, and visualize the
IODDT of Motor-ATV types. All the variables
are symbolized.
Open the data editor, and visualize the
IODDT of Motor-ATV types. All the variables
are symbolized.
4
To find out moreControlling an ATV 31 with a Modicon M340 (5/6)
Schneider Electric 61
Use the variables exchanged in the PLC application example: modification of a speed setting on command
Create the corresponding
contact network
Create the corresponding
contact network
Double click to access Operate
block input.
Double click to access Operate
block input.
Click to access the list of variables.
Click to access the list of variables.
Select the Variable.
Select the Variable.
Key in the Operate block
Key in the Operate block
COMMAND
1 2
3
54
Programming in LD Programming in ST To find out moreOn-line modification
To find out moreControlling an ATV 31 with a Modicon M340 (6/6)
Schneider Electric 62
The data defined in Unity Pro can be reused in Vijeo Designer without having to key them in again.
Programming in LD Programming in ST To find out moreOn-line modification
You can locate the variables to be displayed on the terminal on addresses (in Unity Pro) but it’s not
mandatory.Validate and save the modifications
You can locate the variables to be displayed on the terminal on addresses (in Unity Pro) but it’s not
mandatory.Validate and save the modifications
Create the project in Vijeo DesignerCreate the project in Vijeo Designer
Define the terminal/PLC connection Define the terminal/PLC connection
Create the links with the Unity Pro application and select the variables
Create the links with the Unity Pro application and select the variables
Use the variables on the dialog screenUse the variables on the dialog screen
Implementation principle
USB link
To find out moreDisplaying data on the XBT terminal (1/6)
Schneider Electric 63
Programming in LD Programming in ST To find out moreOn-line modification
You can locate the variables to be displayed on the terminal on addresses (in Unity Pro) but this operation is not mandatory.Validate and save the modifications
Assign an address to the variables which will be used in Vijeo
Designer
Assign an address to the variables which will be used in Vijeo
Designer
1
2
Access the variable editorAccess the variable editor
Remark: It is possible to sort the variables by means of a customization of the columns
In order to take into account the modification, carry out a build by
means of the Build Changes menu and then
Save the project
In order to take into account the modification, carry out a build by
means of the Build Changes menu and then
Save the project
3
To find out moreDisplaying data on the XBT terminal (2/6)
Schneider Electric 64
Create the project in Vijeo Designer
Programming in LD Programming in ST To find out moreOn-line modification
1
Select the File/New project menu
and name it CONVEYOR
Select the File/New project menu
and name it CONVEYOR
2
Name the terminal Select the type and the
model for example 7.5 inches
Name the terminal Select the type and the
model for example 7.5 inches
To find out moreDisplaying data on the XBT terminal (3/6)
Schneider Electric 65
Define the PLC/Terminal connection.Use the Modicon M340 PLC's USB port: Modbus TCP/IP
Programming in LD Programming in ST To find out moreOn-line modification
1
Select the New driver menu by right-
clicking
Select the New driver menu by right-
clicking
2
Select the driver
Select the driver
3
Configure the device: address of
the unit and IEC syntax
Configure the device: address of
the unit and IEC syntax
To find out moreDisplaying data on the XBT terminal (4/6)
Schneider Electric 66
Create the links with the Unity Pro application and select the variables: the Vijeo Designer application is associated with the PLC application
Programming in LD Programming in ST To find out moreOn-line modification
1
Select the Link variables menu by
right clicking
Select the Link variables menu by
right clicking
2
Select the Unity Pro application (STU file)
Select the Unity Pro application (STU file)
3
Select the variables to
be added
Select the variables to
be added
To find out moreDisplaying data on the XBT terminal (5/6)
Schneider Electric 67
Use the variables on the dialog screen: display absence of boxes and box counter on the operator terminal
Programming in LD Programming in ST To find out moreOn-line modification
2 Draw the objects using the icons
Draw the objects using the icons
3
Assign a variable to each object by selecting it on the
list
Assign a variable to each object by selecting it on the
list
Access to the panel1
Access to the panel1
4
Rebuild the whole project
and transfer it to the terminal
Rebuild the whole project
and transfer it to the terminal
1
To find out moreDisplaying data on the XBT terminal (6/6)
Schneider Electric 68
To modify the inputs when you have assigned addresses, you have to be connected to a simulator or to create new section with a function block that is enabled to write the inputs.
Programming in LD Programming in ST To find out moreOn-line modification
2
3
4
1
To find out moreWriting the inputs
Create these new variables. L stands for Local
Create these new variables. L stands for Local
Create this new FBD section
Create this new FBD section
Modify in the operator screen the variables by their local variables.
Run the project.
Schneider Electric 69
Unity allows you to define different working options:- options relative to the utilization of Unity Pro (Tools/Options menu )- options relative to the project (Tools/Project settings menu )
Programming in LD Programming in ST To find out moreOn-line modification
Options for using the Unity Pro workstation
Project settings are embedded in the
project
Your first Unity Pro project Customizing Unity Pro (1/3)
Schneider Electric 70
Unity Pro allows you to define various workstation options.Here are some examples.
Automatic incrementation of projet versions. Modification of the various directories.
Automatic incrementation of projet versions. Modification of the various directories.
Automatic assignment of a variable to any graphic object Ladder editor parameter setting
Automatic assignment of a variable to any graphic object Ladder editor parameter setting
Library settings for the predefined function blocks
Library settings for the predefined function blocks
Programming mode: The PC is connected, by default, in programming mode.
Monitoring mode: The PC is connected in monitoring mode (reading of variables only).
Programming mode: The PC is connected, by default, in programming mode.
Monitoring mode: The PC is connected in monitoring mode (reading of variables only).
Programming in LD Programming in ST To find out moreOn-line modification
Your first Unity Pro project Customizing Unity Pro (2/3)
Schneider Electric 71
Unity allows you to define various options that will be embedded in the project.They thus preserved on any Unity Pro workstation.Here are three examples
Programming in LD Programming in ST To find out moreOn-line modification
When this box is checked, the coils are automatically placed on the right-hand
supply bar.
The upload information consists of the code, variable symbols, comments and
animation tables, etc. They are saved when you record the project and they may or may not be
included with the PLC memory.
This information makes it possible to work with a workstation that does not
contain the project.
This allows you to include, or not, the information that ensures link animation in contact language in the generated code.
Link animation(General tab)
Link animation(General tab)
Coils right-justified(General tab)
Coils right-justified(General tab)
Upload information(General tab)
Upload information(General tab)
Your first Unity Pro project Customizing Unity Pro (3/3)