Programming Languages
What is a Program
A Program is a user developed series of instructions or commands that
directs the PLC to execute actions.
The latest standard (IEC 61131-3) has tried to merge plc programming
languages under one international standard. We now have PLCs that are
programmable in function block, instruction lists, C and structured text
IL example
Comments
FFB-Declaration
AND-Function
Assignment
FFB call
Assignment
AND-Function
FFB call
Assignment
Function Block Programming
Function Block Programming
The primary concept behind a FBD is data flow. In these types of programs the
values flow from the inputs to the outputs, through function blocks.
A FBD program is constructed using function blocks that are connected
together to define the data exchange. The connecting lines will have a data
type that must be compatible on both ends.
FBDs use data flow from left to right through function blocks
Inputs and outputs can be inverted
Function blocks can have variable argument list sizes
When arguments are left off default values are used
Understanding FBDs
Execution order Value Passed Programmer Selected
without declaring Instance Name
Basic Counters
FBD Program Example
Structured Text Programming
Structured Text Programming
ST is a high level language, similar to PASCAL or
BASIC.
Comment
FFB-Declaration
S_2_1 S_2_1
another.
Only transitions following active steps are solved / evaluated.
location.
A jump can be used in two ways:
sequence jump
sequence loop
Up Limit SW Wait
Slow Speed Limit SW
Bottom Limit SW
Up Limit SW
Lower Slow, drill motor on
Slow Speed Limit SW
Bottom Limit SW
Start
Bottom Limit SW reached
Up Limit SW reached
Programming Example
Objective
Here, we want the fill motor to pump lubricating oil into the tank until the high level
sensor turns on. At that point we want to turn off the motor until the level falls
below the low level sensor. Then we should turn on the fill motor and repeat the
process.
Input Address :
PLC
Low : 0000
High : 0001
Output Address :
Oil Tank Motor
Motor : 0500
Drain
Internal Utility Relay : 1000
The Logic – Electrical Diagram
High
1000
Motor
Temp. Bit
1000 0500
Program Scan
1st Scan Start 1st Scan Complete