lecture 19 and 20
Post on 03-Jun-2018
213 Views
Preview:
TRANSCRIPT
-
8/12/2019 Lecture 19 and 20
1/54
Course Computer Based Automation WS 06/07 1Stephan Simons
Computer Based AutomationWinter Term 06/07
Prof. Dr. Stephan SimonsUniversity of Applied Sciences Darmstadt
Master of Science in Electrical Engineering
-
8/12/2019 Lecture 19 and 20
2/54
Course Computer Based Automation WS 06/07 2Stephan Simons
Contents of the course
1. Introduction to automation systems
2. Fundamentalsa) numerical representations, b) logical functions and operations
3. Programmable Logic Controller (PLC)a) basics, b) principle of operation, c) architecture, d) PLC family
4. PLC S7-300 with interface modules
5. Programming of a PLC
1. Overview PLC standard IEC 1131-3
2. Programming Languages for S7 family & program structure
3. Basic operations of STEP 7 in STL, LAD and FBD: Flags, Edgeevaluation, Result of logic operation & Status word, Set and resetoperations (flip flop), Timer instructions, Counter instructions,Particular instructions
4. Program organization units
5. Sequential Control Language (S7-Graph)
6. Structured Control Language (S7-SCL)
7. Indirect Addressing
6. PLC standard IEC 1131-3
today
-
8/12/2019 Lecture 19 and 20
3/54
Course Computer Based Automation WS 06/07 3Stephan Simons
Repetition of last lecture
Timer functions
On delay timer, retentive on delay timer, off delay timer, pulse timer, extended pulsetimer (symbols, example programs, timing diagrams, differences FBD, LAD, STL)
Setting the timer value as S5-Time or as hexadecimal value
Unused inputs and outputs
Example for timer functions (oscillator)
S7 Counter
Up counter, Down counter, Up and down counter (Symbols an program example for
LAD, FBD and STL)
Overview over counter operations
Signal state chart
Example for counter usage (frequency divider) Standard data types and their internal representation
Load and transfer commands
Load and transfer commands in STL; MOVE blocks in LAD & FBD
Examples for load and transfer instructions
Example loading and transfering an analog value (AI & AO)
-
8/12/2019 Lecture 19 and 20
4/54Course Computer Based Automation WS 06/07 4Stephan Simons
Instruction contents of lecture
Bit logic instructions
Bit logic instructions with expressions in parenthesize
Edge triggered instructions
Memory functions: Setting / Resetting bit addresses
Timer instructions
Counter instructions
Load and transfer instructions
Comparison instructions
Integer and floating-point arithmetic instructions
Floating point mathematical instructions
Jump instructions
-
8/12/2019 Lecture 19 and 20
5/54Course Computer Based Automation WS 06/07 5Stephan Simons
S_ODT
S BI
TV BCD
R Q
T1
I0.0
S5T#2S
I0.1
MW0
MW2
Q 4.0A I 0.0
L S5T#2S Load time (2s) in ACCU 1
SD T1 Start timer T1 as a pulse
A I 0.1R T1 Reset timer T1
L T1 Load timer T1 DUAL-coded
T MW0
LC T1 Load timer T1 BCD-coded
T MW2
A T1 Query of the timer T1
= Q 4.0
S_ODT
S Q
TV BI
R BCD
T1
I0.0
S5T#2S MW0
MW2
Q 4.0
( )I0.1
On-delay Timer
FBD
LAD
STL
-
8/12/2019 Lecture 19 and 20
6/54Course Computer Based Automation WS 06/07 6Stephan Simons
S5-TimeIf a delay time of 2 hours, 35 minutes, 24 seconds and 60 mill iseconds shall be
set use the S5 Time:
S5T#2h35m24s60ms
The possible time range is from 10ms to 2h46m30s with a resolution of 10ms.
The S5 time is transferred to the ACCU 1 with the load instruction L. The time is
stored into the ACCU 1 as a 16 bit word with the following format:
15 14 13 12 11 8 7 4 3 0Bit
102
101
100
time
basefactor for t ime base in BCDIrrelevant
00(2) 0(16) 0,01sec
01(2) 1(16) 0,1sec
10(2) 2(16) 1sec
11(2) 3(16) 10sec
Time base:Examples:
S5T#3s 2003(16) or 0300(16)
S5T#100ms 1001(16) or 0010(16)
S5T#2h46m30s 9990s 3999(16)
As a rule the smallest possible time base is used to achieve a better precision.
-
8/12/2019 Lecture 19 and 20
7/54Course Computer Based Automation WS 06/07 7Stephan Simons
No. STL Comments
1 L 16#1350 // Load time (35s) as hex literal (const.)
2 T MW10 // Transfer to MW 10
3 A I2.1 // Start delay time with positive edge of I2.1
4 L MW10// Transfer time into ACCU 1.
5 SD T4 // Start timer T4 as an on-delay timer.
6 NOP 0 // Reset
7 L T4 // Load current time value of T4 as binary.
8 T QW4 // Transfer binary current time value to QW4.
9 NOP 0 // Current time value as BCD not used.
10 A T4 // Check signal state (binary output) of timer T4.
11 = Q4.0 // Transfer to Q4.0.
Changing the on-delay program:
The instructions no. 7 and 8 transfer the current time value of T4 as binary to
the output word QW4.
The output word QW4 consists of the two bytes QB4 and QB5
QB4 holds the more signif icant value:
QW4 [ QB4, QB5 ]
-
8/12/2019 Lecture 19 and 20
8/54Course Computer Based Automation WS 06/07 8Stephan Simons
Choosing
the righttimer
-
8/12/2019 Lecture 19 and 20
9/54Course Computer Based Automation WS 06/07 9Stephan Simons
S7 Counter
S_CUDCU
CD
S CV
PV CV_BCD
R Q
C1
I0.0
C#5
I0.3
QW2
QW4
Q 0.0
FBDSTL
A I 0.7 Release (only in STL)
FR C1
A I 0.0
CU C1 Count up
A I 0.1CD C1 Count down
A I 0.2
L C#5 Load counter with default value
S C1 Set counter with default value
A I 0.3
R C1 Reset counter C1
L C1 Load counter C1 DUAL-coded
T QW2
LC C1 Load counter C1 BCD-codedT QW4
A C1 Query of the counter C1
= Q 0.0
S_CUDCU Q
CD
S
PV CVR CV_BCD
C1
I0.0
C#5
I0.2
QW2
QW4
Q 0.0
LAD
( )
I0.1
I0.1
I0.3
I0.2
Counter limits: 0 999
-
8/12/2019 Lecture 19 and 20
10/54Course Computer Based Automation WS 06/07 10Stephan Simons
S7 Counter: Signal state chart
FR
CU
CD
S
R
Q 0.0
1
2345
0
-
8/12/2019 Lecture 19 and 20
11/54Course Computer Based Automation WS 06/07 11Stephan Simons
Load and transfer commands in STL
Load function consists of operation L (load) and an operand.
Operand is Byte, Word, DWord.
Operand is loaded into ACCU 1.
Examples for types of Operands:
L 16#F8A4 Load a constant value (Immediate addressing)
L IW16 Load an operand (Direct adrdressing)L ActValue Load a variable (Symbolic addressing)
Loading takes place in two steps:
Step 1: The content of ACCU 1 is moved into ACCU 2.
Step 2: The operand of the load instruction is loaded into ACCU 1.
Both Accumulators ACCU 1 and ACCU 3 have 32 bits each (Width of
DWORD data type).
-
8/12/2019 Lecture 19 and 20
12/54
Course Computer Based Automation WS 06/07 12Stephan Simons
Examples for loading of binary operands in STL
Loading of inputs:
L IBn // Byte
L IWn // Word
L IDn // Doubleword
Loading of outputs:
L QBn // Byte
L QWn // Word
L QDn // Doubleword
Laden from periphery:
L PIBn // Byte
L PIWn // Word
L PIDn // Doubleword
Loading of flags:
L MBn // Byte
L MWn // Word
L MDn // Doubleword
n : Address parameter e.g. 4 or 32
-
8/12/2019 Lecture 19 and 20
13/54
Course Computer Based Automation WS 06/07 13Stephan Simons
Transfer instruction T in STL T: Transfers contents of ACCU 1 to the operand
Operand: Byte, Word or Doubleword
T MW120 Contents ACCU 1 Flag (absolute addressing)
T RefValue Contents ACCU 1 Variable (symbolic addressing)
This function also works with Twisting (Exchanging byte positions).QW10 = [QB11, QB10]
QW10 consists of the two bytes QB10 and QB11.
The lower byte of ACCU 1 is stored as the most significant byte QB11. The higher byte of ACCU 1 is stored as the least significant byte QB10.
Examples for transfer instructions:
T QB15 // Transfers ACCU 1 to output byte 15.
T IW20 // Transfers ACCU 1 to process image of the inputs at// word address 20.
T MD30 // Transfers ACCU 1 to flag doubleword at address 30. T PQW320 // Transfers ACCU 1 to the periphery output word 320,
// e.g. to an analog output.
-
8/12/2019 Lecture 19 and 20
14/54
Course Computer Based Automation WS 06/07 14Stephan Simons
MOVE function in FBD and LAD
LAD
FBD
Input at IN and output at OUT can be of any elementary data type except BOOL.
Variables at input IN and output OUT may be of different data types.
-
8/12/2019 Lecture 19 and 20
15/54
Course Computer Based Automation WS 06/07 15Stephan Simons
Comparison functions in STL
Comparison
function INT DINT REAL
Equal ==I ==D ==R
Not equal I D R
Greater >I >D >R
Greater or equal >=I >=D >=R
Less
-
8/12/2019 Lecture 19 and 20
16/54
Course Computer Based Automation WS 06/07 16Stephan Simons
Comparison functions in FBD and LAD
Comparison
function INT DINT REAL
Equal CMP ==I CMP ==D CMP ==R
Not equal CMP I CMP D CMP R
Greater CMP >I CMP >D CMP >R
Greater or equal CMP >=I CMP >=D CMP >=R
Less CMP
-
8/12/2019 Lecture 19 and 20
17/54
Course Computer Based Automation WS 06/07 17Stephan Simons
Example: Comparison functions in STL
The input word IW0 is compared with the literal 120(10). If both values are
equal Bit Q4.0 shall be set to 1 , otherwise Q4.0 shall be 0.
No. STL Comments
1 A Q4.0Q4.0
IW0
120
Q4.0
2 R // Q4.0 is set to 0
3 L // load IW0 into ACCU 1
4 L // transfer IW0 from ACCU 1 into ACCU 2 and load 120// into ACCU 1
5 ==I // Compare ACCU 1 with ACCU 2 to be equal
6 S // Set Q4.0 to 1 if ACCU 1 = ACCU 2
-
8/12/2019 Lecture 19 and 20
18/54
Course Computer Based Automation WS 06/07 18Stephan Simons
Example: Comparison functions in STL
The input word IW0 is compared with the literal 120(10). If both values are
equal Bit Q4.0 shall be set to 1 , otherwise Q4.0 shall be 0.
No. STL Comments
1 A Q4.0Q4.0
IW0
120
Q4.0
2 R // Q4.0 is set to 0
3 L // load IW0 into ACCU 1
4 L // transfer IW0 from ACCU 1 into ACCU 2 and load 120// into ACCU 1
5 ==I // Compare ACCU 1 with ACCU 2 to be equal
6 S // Set Q4.0 to 1 if ACCU 1 = ACCU 2
-
8/12/2019 Lecture 19 and 20
19/54
Course Computer Based Automation WS 06/07 19Stephan Simons
Example comparison function in FBD
The input word IW0 is compared with the literal 120(10). If both values areequal Bit Q4.0 shall be set to 1 , otherwise Q4.0 shall be 0.
-
8/12/2019 Lecture 19 and 20
20/54
Course Computer Based Automation WS 06/07 20Stephan Simons
Example comparison function in LADThe input word IW0 is compared with the literal 120
(10)
. If both values areequal Bit Q4.0 shall be set to 1 , otherwise Q4.0 shall be 0.
Arithmetic functions
-
8/12/2019 Lecture 19 and 20
21/54
Course Computer Based Automation WS 06/07 21Stephan Simons
Arithmetic functions
Additional: DEC n (Decrements ACCU 1 by the value of n)INC n (Increments ACCU 1 by the value of n)
Arithmetic function INT DINT REAL
Addition +I +D +R
Subtraction -I -D -R
Multiplication *I *D *R
Division with quotient as
result
/I /D /R
Division with remainder as
result
- MOD -
Arithmetic functions in FBD and LAD
-
8/12/2019 Lecture 19 and 20
22/54
Course Computer Based Automation WS 06/07 22Stephan Simons
Arithmetic functions in FBD and LAD
No DEC or INC functions in FBD and LAD
Arithmetic function INT DINT REAL
Addition ADD_I ADD_DI ADD_R
Subtraction SUB_I SUB_DI SUB_R
Multiplication MUL_I MUL_DI MUL_R
Division with quotient as
result
DIV_I DIV_DI DIV_R
Division with remainder asresult
- MOD_DI -
-
8/12/2019 Lecture 19 and 20
23/54
Course Computer Based Automation WS 06/07 23Stephan Simons
Examples for arithmetic functions
L MW0
L MW2
+I
T MW10
L MD0
L MD2
-D
T MD10L MD0
L MD2
*R
T MD10
L MD0
L MD2
/R
T MD10
Fct. LAD FBD STL
I1-I2
I1+I2
I1*I2
I1/I2
-
8/12/2019 Lecture 19 and 20
24/54
Course Computer Based Automation WS 06/07 24Stephan Simons
Meaning of EN and ENO within functions
EN Explanation ENOEN = FALSE If EN is FALSE when calling the function, the
code-part of the function may not be executed.
In this case output ENO will be set to FALSE
upon exiting in order to indicate that the functionhas not been executed.
ENO = FALSE
EN = TRUE If EN is TRUE when calling the function, the
code-part of the function can be executed nor-
mally. In this case ENO will initially be set to
TRUE before starting the execution.
ENO = TRUE
ENO can afterwards be set to TRUE or FALSE
by instructions executed within the function
body.
ENO = individual
value
If a program or system error (as described in
Appendix E) occurs while executing the function
ENO will be reset to FALSE by the PLC.
ENO = FALSE
(error occurred)
a TRUE = logical 1, FALSE = logical 0
-
8/12/2019 Lecture 19 and 20
25/54
Course Computer Based Automation WS 06/07 25Stephan Simons
Example: Two-step controller (two-position
controller, bang-bang servo)(e.g. for temperature control)
Voltage range 0 10 V
16 bit integer value in the range 0 27648
1,5 V is equivalent to 4147 (= 1,5V * 27648) / 10V
(PIW288)
(PIW290)
(Q4.0)
w: reference value (010V)
X: actual value (010V)
Y: control variable (bit)
Xd: control deviation
Xd
= w - x
-
8/12/2019 Lecture 19 and 20
26/54
Course Computer Based Automation WS 06/07 26Stephan Simons
Two-step controller:
FBD program
(PIW288)
(PIW290)
(Q4.0)
y
-
8/12/2019 Lecture 19 and 20
27/54
Course Computer Based Automation WS 06/07 27Stephan Simons
Mathematical functions
Square, square-root
Sine, cosine, tangent
Arc sine, arc cosine, arc tangent
Exponential function to base e, natural logarithm
All these mathematical functions only work with values of the data type
REAL
!
-
8/12/2019 Lecture 19 and 20
28/54
Course Computer Based Automation WS 06/07 28Stephan Simons
Mathematical functions
Square, square-root
Sine, cosine, tangent
Arc sine, arc cosine, arc tangent
Exponential function to base e, natural logarithm
All these mathematical functions only work with values of the data typeREAL!
Conversion functions for REAL INTEGER (in STL):
lTD Conversion of INT to DINT
ITB Conversion of INT to BCD
DTR Conversion of DINT to REAL
RND Conversion of REAL to DINT with rounding to the next higher
integer number
-
8/12/2019 Lecture 19 and 20
29/54
Course Computer Based Automation WS 06/07 29Stephan Simons
Conversion
16 bit Integer
to
32 bit Integer
Conversion
32 bit Integer
to
REAL
Input Data
Integer
16 Bit
Program
algorithms
using REAL
Conversion functions INT DINT REAL
LAD FBD STL
MW12 MD20
MD20 MD28
L MW12
ITD
T MD20
L MD20
DTR
T MD28
MW12
MD20
MD20
MD28
-
8/12/2019 Lecture 19 and 20
30/54
Course Computer Based Automation WS 06/07 30Stephan Simons
Conversion function: Example
(PIW288) (PQW320)
Analog Input: PIW288 (16 bit Integer)
Analog Output: PQW320 (16 bit Integer)
Realize the following function f(x) with a PLC:
x*.y 163=
with: 0V
-
8/12/2019 Lecture 19 and 20
31/54
Course Computer Based Automation WS 06/07 31Stephan Simons
( g)
xy *16,3
V1027648int 8,2764*
int
yy 8,2764*
int xx
8,2764*16,3
8,2764
intint xy intint
*8,2764*16,3 xy intint
*157,166 xy 7)
1)
2)
3)
4)
5)
6)
R li i t t ti (I)
-
8/12/2019 Lecture 19 and 20
32/54
Course Computer Based Automation WS 06/07 32Stephan Simons
Realizing a square root extraction (I)
Realizing a square root extraction (II)
-
8/12/2019 Lecture 19 and 20
33/54
Course Computer Based Automation WS 06/07 33Stephan Simons
C i f R l 32 bit DINT
-
8/12/2019 Lecture 19 and 20
34/54
Course Computer Based Automation WS 06/07 34Stephan Simons
Conversion from Real 32 bit DINT
Round (FBD & LAD) / RND (STL): Rounds to the next integer. When the fraction
of the number is exactly between an even and uneven result, the operation chooses
the even result. Examples: +1.49 +1; 1.5 2; 2.5 2; 2.51 3
Trunc: Round with truncation of the fraction part. The result is only the integer part
of the real data. Examples: 1.6 1.
Ceil / RND+: Round to the next highest integer. This operation rounds theconverted number to the smallest integer, that is greater than or equal to the
converted integer. Examples: +1.2 +2; -1.5 -1.
Floor / RND-: Round to the next lowest integer. This operation rounds theconverted number to the largest integer, that is smaller or equal to the converted
integer. Examples: +1.5 +1; -1.5 -2.
-
8/12/2019 Lecture 19 and 20
35/54
Course Computer Based Automation WS 06/07 35Stephan Simons
Rounding Modes for the Conversion of REAL numbers
Revolution measurement: transducer
-
8/12/2019 Lecture 19 and 20
36/54
Course Computer Based Automation WS 06/07 36Stephan Simons
Revolution measurement: transducer
10 V, 20 mA, 16 mA
1000 U/min
365
500 865 1500 rpm
0 10 V
0 20 mA
4 20 mA
10 V : 1000 rpm = 0,01 V/U/rpm
365 U/min 3,65 V
Internal representation of analog value in case ofbipolar measurement range
-
8/12/2019 Lecture 19 and 20
37/54
Course Computer Based Automation WS 06/07 37Stephan Simons
bipolar measurement rangeIncrements Voltage
measurement range
Current
measurement range
Range
dec. hex. 10 V 20 mA
32767 7FFF 11,851 V 23,70 mA
32512 7F00
32511 7EFF 11,759 V 23,52 mA
27649 6C01
27648 6C00 10 V 20 mA
20736 5100 7,5 V 15 mA
1 1 361,7 V 723,4 nA
0 0 0 V 0 mA
1 FFFF -361,7 V -723,4 nA
20736 AF00 7,5 V 15 mA
27648 9400 10 V 20 mA
27649 93FF
32512 8100 11,759 V 23,52 mA32513 80FF
32768 8000 11,851 V 23,70 mAUnderflow
Underrange
Rated range
Overange
Overflow
Internal representation of analog value in case ofunipolar measurement range
-
8/12/2019 Lecture 19 and 20
38/54
Course Computer Based Automation WS 06/07 38Stephan Simons
unipolar measurement range
System Voltage
measurement range
Current measurement range Range
dez. hex. 0..10 V 0..20 mA 4..20 mA
32767 7FFF 11,851 V 23,70 mA 22,96 mA
32512 7F00
32511 7EFF 11,759 V 23,52 mA 22,81 mA
27649 6C01
27648 6C00 10 V 20 mA 20 mA20736 5100 7,5 V 15 mA 16 mA
1 1 361,7 V 723,4 nA 4 mA + 578,7 nA
0 0 0 V 0 mA 4 mA
1 FFFF4864 ED00 3,52 mA 1,185 mA
4865 ECFF
32768 8000
Negative
values not
possible
Negative values
not possibleUnderflow
UnderrangeNegative
valuesnot
possible
Rated
range
Overrange
Overflow
Revolution measurement AD converter
-
8/12/2019 Lecture 19 and 20
39/54
Course Computer Based Automation WS 06/07 39Stephan Simons
Revolution measurement AD converter
0 27648
0 10 V
020 mA
4 20 mA
13824
12
10
5
Revolution measurement: transducer
-
8/12/2019 Lecture 19 and 20
40/54
Course Computer Based Automation WS 06/07 40Stephan Simons
Revolution measurement: transducer
10 V, 20 mA, 16 mA
1000 U/min
365
500 865 1500 rpm
0 27648 Incr.13824
1000
10092
Table for normalization
-
8/12/2019 Lecture 19 and 20
41/54
Course Computer Based Automation WS 06/07 41Stephan Simons
Table for normalization
System Voltage
measurement
range
Current measurement range Range
dez. hex. 10 V 0..10 V 20 mA 0..20 mA 4..20 mA
27648 6C00 10 V 10 V 20 mA 20 mA 20 mA0 0 0 V 0 V 0 mA 0 mA 4 mA
27648 9400 10 V 20 mA
Rated
range
Task: Reading and normalizing of an analog value
-
8/12/2019 Lecture 19 and 20
42/54
Course Computer Based Automation WS 06/07 42Stephan Simons
Task: Reading and normalizing of an analog value
Acquire an analog value in the range of 0V to 10V with an analog input
module in rack 0 (central unit), slot 6 (PIW288), map it onto the range 100 to
1000 as a REAL value and store the result as MD10!
L PIW 288 // Analog value input 0 to 10 V contains 0 to 27648 integers (16 Bit)
ITD // Value of integer (16 Bit) converted into integer (32 Bit)
DTR // Value of integer (32 Bit) converted into a real number
L 2.7648e+4
/R // Division with real number 27648 mapping value to range 0 to 1
L 9.000e+2
*R // Multiplication with real number 900 (1000-100) -> range 0 to 900
L 1.000e+2
+R // Addition with real number 100 (Offset) range 100 to 1000
T MD10 // Normalized value 100 to 1000 in real format
Analog value conversion and processing
-
8/12/2019 Lecture 19 and 20
43/54
Course Computer Based Automation WS 06/07 43Stephan Simons
Analog value conversion and processing
835 rpm 3,65 V 10092 Incr
10092(INT) 10092(DINT) 10092,0
10092,0 *2,2 22202,4
22202,4 22202(DINT) 22202 Incr
22202 Incr 8,03 V 1303 rpm
Transducer
A/D-Converter
L PIWn
ITD DTR
Programmed algortihm
RND T PQWn
ActuatorD/A-Converter
Jump instructions
-
8/12/2019 Lecture 19 and 20
44/54
Course Computer Based Automation WS 06/07 44Stephan Simons
Jump instructions
Unconditionally jumps: Are executed always no matter of a condition.
Conditionally jumps: Are executed only if the condition is fullfiled.
LOOP: instruction to call a program segment multiple times (only in STL)
Jump unconditional
-
8/12/2019 Lecture 19 and 20
45/54
Course Computer Based Automation WS 06/07 45Stephan Simons
Jump unconditionalLAD FBD STL
Jumps conditional
-
8/12/2019 Lecture 19 and 20
46/54
Course Computer Based Automation WS 06/07 46Stephan Simons
Jumps conditionalLAD FBD STL
All jump instructions in STL
-
8/12/2019 Lecture 19 and 20
47/54
Course Computer Based Automation WS 06/07 47Stephan Simons
All jump instructions in STL
Unconditionally jumps:
JU label Jump Unconditional
JL label Jump to Labels
Jumps based on RLO: JC label Jump if RLO = 1
JCN label Jump if RLO = 0
JCB label Jump if RLO = 1 with BR
JNB label Jump if RLO = 0 with BR
Jumps based on another bit in the status
word: JBI label Jump if BR = 1
JNBI label Jump if BR = 0
JO label Jump if OV = 1
JOS label Jump if OS = 1
Jumps based on the result of a
calculation:
JZ label Jump if Zero
JN label Jump if Not Zero
JP label Jump if Plus JM label Jump if Minus
JPZ label Jump if Plus or Zero
JMZ label Jump if Minus or Zero
JUO label Jump if Unordered
Loop instruction
LOOP label call a program
segment multiple
times
Jump distributor: JL
-
8/12/2019 Lecture 19 and 20
48/54
Course Computer Based Automation WS 06/07 48Stephan Simons
p
The jump distributor allows specific (calculated) jumping to aprogram section in the block conditional on a number of positions.
It works in conjunction with a list of JU jump functions followingimmediately the JL instruction.
The list can contain up to 255 entries.
The label of the JL instruction points to the end of the list.
L Number_of_jump;
JL End; // jump label points to the first statement after the list
JU L0; // jump to L0 if Number_of_jump = 0
JU L1; //jump to L1 if Number_of_jump = 1
JU Lx; // jump to Lx if Number_of_jump = x
End:
LOOP Jump
-
8/12/2019 Lecture 19 and 20
49/54
Course Computer Based Automation WS 06/07 49Stephan Simons
p
L NumberOffLoops;
Next: T ActLoopCountNo;
L ActLoopCountNo;
LOOP Next;
The loop jump LOOP allows a simplified programming of program loops.
When processed, LOOP first decrements the contents of ACCU 1 by 1.
If the value is not zero afterwards, the jump is executed to the jump labelspecified.
If the value is zero, the jump is not executed and the next statement isprocessed.
The start value in ACCU 1 thus corresponds to the number of program loopsto be passed. This value has to be stored in a loop counter.
Example: Using the jump instruction to
-
8/12/2019 Lecture 19 and 20
50/54
Course Computer Based Automation WS 06/07 50Stephan Simons
p g j p
restrict an analog value
(PIW288) (PQW320)
Internal representation of the limits:
Lower limit: 0V 0
Upper limit: 8V (8V * 27648) / 10 V = 22118
Restriction of an analog value: STL program
-
8/12/2019 Lecture 19 and 20
51/54
Course Computer Based Automation WS 06/07 51Stephan Simons
(PIW288) (PQW320)
Restriction of an analog value: FBD program (I)
-
8/12/2019 Lecture 19 and 20
52/54
Course Computer Based Automation WS 06/07 52Stephan Simons
Restriction of an analog value: FBD program (II)
-
8/12/2019 Lecture 19 and 20
53/54
Course Computer Based Automation WS 06/07 53Stephan Simons
Instruction contents of lecture
-
8/12/2019 Lecture 19 and 20
54/54
Course Computer Based Automation WS 06/07 54Stephan Simons
Bit logic instructions
Bit logic instructions with expressions in parenthesize
Edge triggered instructions
Memory functions: Setting / Resetting bit addresses
Timer instructions
Counter instructions
Load and transfer instructions
Comparison instructions
Integer and floating-point arithmetic instructions
Floating point mathematical instructions
Jump instructions
top related