Professional Documents
Culture Documents
L-3 - Basics of PLC Programming
L-3 - Basics of PLC Programming
PLCs, as well as digital computers, use the binary number system, or module 2
arithmetic
Numbers, integers or real, are represented in fixed-size memory words
A memory word is typically 1, 2, 4, or 8 bytes long
Octal (base 8) and hexadecimal (base 16) representations are derivatives of the
binary system conveniently used in documentation
Data Blocks
DB Data block DB, FB, SFB, UDT 0-65532
Memory map
Divided into several data files
Each data file consists of an operand and tags such as
I/P, O/P, and bit memory
CPU identifies these operands based on a numerical
absolute address
Code Blocks
The CPU supports the following types of code blocks that
allow users to create an efficient modular program
– Organization blocks (OBs) define the structure of a
program.
– Functions (FCs) and function blocks (FBs) contain the
program code that corresponds to a particular task,
which can be executed frequently or as needed.
– Data blocks (DBs) store the data that can be used by
the different program blocks.
Functions are logic blocks without memory. After the function
has been executed, the data in the temporary variables
therefore are lost.
Dr.-Ing. Jackson G. Njiri EMT 2549 L-3: Basics of PLC programming 7