Controller Programming
Controller Programming
● Chapter Overview
● Standardising PLC Programming
● New Project Creation
● Language Editors
● Tasks
● Sections
● Elementary Functions (EFB’s)
● Variables
● Five programming languages have been defined. This means that their syntax
and semantics have been defined so that every vendor uses the same
language.
Textual Graphical
• Instruction List, IL • Function Block Diagram, FBD
• Structured Text, ST • Ladder Diagram, LD
• Sequential Function Chart, SFC
● These languages are fully standardised and portable across solutions from ALL
vendors
● A sixth language is available in Unity Pro. LL984 this will be covered later in the
course.
Unity Pro Configuration – V11.1 Training
Schneider Electric | Industry Business | Training – July 24, 2018 3
IEC 611131-3 PLC programming
● Set Output ‘C’ to TRUE only if Input ‘A’ is TRUE and Input ‘B’ is False
Sequential
Function
Chart (SFC)
● This will help us become familiar with the different languages. Unity Pro
software supports the 5 different languages and they can all be used in
the same project if desired.
● The first step is to create a new project . The project is where all the
information is stored.
● Assisted data entry functions for gaining access to function libraries, the
Variables Editor, or the text object used to enter comments.
● Bookmarks
● Setting of bookmarks on lines of text or in the margin enables users to
easily locate these lines in an important program sections.
● Master
● Usually abbreviated to MAST
● Main code for the whole PLC
● Identified under the Program branch
● Contains Sections and Subroutines
● Cyclic or Periodic execution (0 to 255 ms)
● Controlled by:
●Watch Dog
●System bits & words
● Fast
● High priority
● Interrupt processing
● Alarms for instance
● Contains Sections and Subroutines
● Programmed in LD, FBD, IL or ST
● Periodic execution (1 to 255ms)
● Controlled by:
●Watch Dog
●System bits & words
● Auxiliary
● Low priority
● Typically measurement or slow process control
● Only available on ‘top of the line’ processors
● Up to 4 Auxiliary tasks (AUX0 to AUX3) on
Premium and Quantum PLCs
● Contains Sections and Subroutines
● Programmed in LD, FBD, IL or ST
● Periodic execution (10 to 255ms)
● Controlled by:
●Watch Dog
●System bits & words
Create a Section
● The functions are sorted into libraries depending on their type of use.
● No internal states
● Sorted into libraries
● Represented as a box
● multiple input pins
● Single output pin Name
Function Execution
Counter Number
Output Pin
Input Pins
● The letters x, y and z are variables. The right side of the equation is
evaluated and then assigned to the left side.
● This address may be a memory bit or word in the State RAM of the
PAC, or a topological address that has been assigned to an I/O module.
Address Type Description
%M17 Memory Bit Flat address for a discrete
output
%QI.3.5 Topological address Discrete output at Rack 1,
Slot 3, Point 5
%MW0.5.1 Memory Word Flat address for a memory
word
%QW1.5.2 Topological address Analog output at Rack 1, Slot
5, Point 2
Unity Pro Configuration – V11.1 Training
Schneider Electric | Industry Business | Training – July 24, 2018 33
Common Data Types and Ranges
● A Data Type must also be assigned to the variable. The data type will
determine what kind of data can be stored in each memory location and
the amount of RAM required to store the data.
Digital/Boolean value not connected to State RAM, Can be
BOOL
Set but not Forced. Must be FALSE (0) or TRUE (1)
Digital I/I or internal State RAM data that can be Forced, with
EBOOL
edge detection
Numerical data from -32,768 to +32,768. Analog module data
INT
type
Located variable
(tag name, type and
address)
Unlocated variable
(without address)
Feedpump_Start Feedpump_Running
Feedpump_Run BypassValve_Opened
BypassValve_Open HoldingTubeTemp_OK
Feedpump_Estop Agitator_Available
● The I/O Data Type is the term used for the choice of addressing
schema within Unity Pro. There are two choices of I/O Data Type:
● Topological addressing and IODDT structures
● The supported I/O Data Type in Unity Pro is dependent upon Unity
Controller family and the equipment location, here are some examples:
Modicon M580 X X
Local Rack Modicon M340 X -
Premium X -
● When using M580 CPU is used, a Device DDT (Derived Data Type) is
added to the application that can be used to easily obtain information
about the CPU, including running services, diagnostics and the state of
embedded Ethernet ports.
● The default name is BMEP58_ECPU and type is T_BMEP58_ECPU:
Variables
● Chapter Summary
● Standardising PLC Programming
● Language Editors
● Tasks
● Sections
● Elementary Functions (EFB’s)
● Variables