0% found this document useful (0 votes)
81 views

Note-14 Program Control

The document discusses program control operations in a Siemens S7-300 PLC, including jump operations, shift and rotate functions, and math functions. Jump operations allow interrupting the linear program flow to jump to other parts of the program. Shift and rotate functions move bits within data words in the desired direction and number of bits. Math functions covered include addition, subtraction, multiplication, and division, and must use 32-bit or 64-bit data types. Conversion between integer and real data types is also discussed. The document aims to understand these programming concepts on the Siemens S7-300 PLC.

Uploaded by

Andee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Note-14 Program Control

The document discusses program control operations in a Siemens S7-300 PLC, including jump operations, shift and rotate functions, and math functions. Jump operations allow interrupting the linear program flow to jump to other parts of the program. Shift and rotate functions move bits within data words in the desired direction and number of bits. Math functions covered include addition, subtraction, multiplication, and division, and must use 32-bit or 64-bit data types. Conversion between integer and real data types is also discussed. The document aims to understand these programming concepts on the Siemens S7-300 PLC.

Uploaded by

Andee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

NOTE-14 PLC

PROGRAM CONTROL OPERATION

Aulia El Hakim, S.ST.,M.T

festo retooling 2019, Turkey


PURPOSE
• Memahami konsep Program control operation pada PLC siemens s7-300
• Memahami konsep jump operation pada PLC siemens s7-300
• Memahami konsep SHIFT AND ROTATE pada PLC siemens s7-300
• Memahami konsep MATH FUNCTION ADD ; SUB, MUL , DIV pada PLC
siemens s7-300

festo retooling 2019, Turkey


OUTLINE
konsep Program control operation pada PLC siemens s7-300

konsep jump operation pada PLC siemens s7-300

konsep SHIFT AND ROTATE pada PLC siemens s7-300

konsep MATH FUNCTION ADD ; SUB, MUL , DIV pada PLC siemens s7-
300

festo retooling 2019, Turkey


HARDWARE PLC SIEMENS S7-300
MODUL Tipe ID Number
Power Supply ( PS) PS 307 2A 307-1BA01-0AA0
CPU CPU315-2DP 315-2AH14-0AB0
Digital input (DI) DI 16 X DC24 V 321-1BH02-0AA0
Digital Output (DO) DO 16XDC24V / 0.5A 322-1BH01-0AA0
Analaog Input (AI) AI 2X12BIT 331-7KB02-0AB0
Analaog Output (AO) AO 2X12BIT 332-5HB01-0AB0

festo retooling 2019, Turkey


Tugas note-12
It is requested to monitor the occupancy of a car park with a capacity of 10 cars. Cars entering and leaving the parking lot
by entering a sensor are counted.
Parking availability; should be monitored with lighted warnings such as empty, not empty, half full, full full

festo retooling 2019, Turkey


Program control operation pada PLC siemens s7-300
JUMP OPERATIONS
Jumping operations allow the program to continue the program from another partition /
network by interrupting the linear flow within the program blocks (OB .., FC .., FB ..) to
perform the operation at another point.

1. Conditional or unconditional jump (JMP-JMPN)

The conditional or unconditional jump commands placed during the linear


flow of the program jump to the network where the label (LABEL) is placed
according to the result of the logic operation (JMP-JMPN) and the program
continues from there.

festo retooling 2019, Turkey


3-PRORAM CONTROL OPERATIONS | JUMP OPERATIONS |

festo retooling 2019, Turkey


3-PRORAM CONTROL OPERATIONS | JUMP LIST OPERATIONS |
A function that allows conditional jump to the label between 0~99 defined in a byte field (K: Jump distributor).
The jump spreader jumps to the label defined in “DEST0” if the number value is “0,, to the label defined in 1 DEST1” if the
number value is “1,, to the label defined in 2 DEST2” if the number value is “2

festo retooling 2019, Turkey


3-PRORAM CONTROL OPERATIONS | STOP | - Oparation

When the signal connected to “EN” input is warned, it takes PLC to stop position.

The PLC can then be started via the programming software (TIA Portal).

festo retooling 2019, Turkey


SHIFT AND ROTATE
These are the functions that allow the "bits" in any memory area to be
shifted or rotated in the desired direction and in the desired number.

festo retooling 2019, Turkey


festo retooling 2019, Turkey
SHIFT AND ROTATE
Shift Right Integer:
Shift Right Integer instruction is used to shift
bits 0 to 15 of input IN bit by bit to the right.
The input N specifies the number of bits by
which to shift
After shifting, the bit position shifted in from
the left to fill vacated bit position are filled
with 0 if 15th bit (Sign bit) of input data is 0
or 1 if 15th bit (Sign bit) of input is 1
Example 1:
Input IN: 1010 0110 1000 1000
N : 2
OUT : 1110 1001 1010 0010

Input IN :0011 0001 0001 1100


N :2
OUT : 0000 1100 0100 0111
festo retooling 2019, Turkey
Shift right Word:
Shift right Word instruction is used to shift bits 0 to 15 of
input IN bit by bit to the right. The input N specifies the
number of bits by which to shift.
After shifting, the bit position shifted in from the left to fill
vacated bit position are filled with 0.

Example 1:
Input IN: 0011 0110 1100 0110
N: 2
OUT: 0000 1101 1011 0001
Example 2:
Input IN: 1111 0110 1100 1111
N: 2
Output OUT: -0011 1101 1011 0011

festo retooling 2019, Turkey


Exercise:4 In the PLC output channel, we want a LED to shift continuously from low value bit to high value bit by
switching on the start signal. (shifting light) In the next step after the last “bit” lights up, the first “bit gerek should light
again.
Another extinguishing signal must also be used to stop the slip.

festo retooling 2019, Turkey


Exercise:4 In the PLC output channel, we want a LED to shift continuously from low value bit to high value bit by
switching on the start signal. (shifting light) In the next step after the last “bit” lights up, the first “bit gerek should light
again.
Another extinguishing signal must also be used to stop the slip.

festo retooling 2019, Turkey


SOLUTION

festo retooling 2019, Turkey


Application 12: Bottle caps will be checked at a pet bottle water filling station and bottles found to
have no cap will be discarded after 16 steps.

festo retooling 2019, Turkey


festo retooling 2019, Turkey
Rotate Right Double Word:
Rotate Right Double Word instruction is used to rotate the entire content of input IN bit by bit to
the right. Input N specifies the number of bits by which to rotate.
The bit position shifted in from the left is assigned the logic states of the bits which were rotated
out to the right.

Example 1:
Input IN : 1100 0110 0111 0011 0101 0101 1010 1100
N: 2
Output OUT: 0011 0001 1001 1100 1101 0101 0110 1011

festo retooling 2019, Turkey


MATH FUNCTION ADD ; SUB, MUL , DIV

festo retooling 2019, Turkey


MATH FUNCTION ADD ; SUB, MUL , DIV

festo retooling 2019, Turkey


MATHEMATICAL FUNCTIONS
Math functions are functions other than simple arithmetic functions. The data types to be used here
must be 32 or 64 “bit” comma numbers (Real, LReal).

festo retooling 2019, Turkey


CONVERSION OF DATA TYPES

festo retooling 2019, Turkey


Converting REAL numbers to integers
In converting whole numbers to comma numbers, we are interested in adding “? .0 asına to the back of the
number. In other words, “5” as “INT, becomes“ 5.0 ”as AL REAL”.

festo retooling 2019, Turkey


festo retooling 2019, Turkey
festo retooling 2019, Turkey

You might also like