Upload
armando-nuth
View
226
Download
1
Embed Size (px)
Citation preview
302/24/97 3
Advanced Instructions
MathAddSubractMultiplyDivide
ComparisonGreater ThanLess ThanEqualNot EqualGreater Than or EqualLess Than or Equal
Data MovementMoveCopyClear
402/24/97 4
Math Instructions - ADD
Source A + Source B = Dest
N7:010
N7:1 5
N7:215
10 + 5 = 15
ADDSource A N7:0
Source B N7:1
Dest N7:2
ADDI:1
0
502/24/97 5
Math Instructions - ADD
Source A + Source B = Dest
N7:0 1
N7:1 5
N7:1 6
1 + 5 = 6
ADDSource A N7:0
Source B N7:1
Dest N7:1
ADDI:1
0
Application: Running Total
602/24/97 6
Math Instructions - ADD
Source A + Source B = Dest
N7:0 1
N7:1 5
N7:1 6
1 + 5 = 6
NOTE: This instruction executes every scan that the rung is true, therefore use a One-Shot OSR.
ADDSource A N7:0
Source B N7:1
Dest N7:1
ADDI:1
0
B3
0OSR
Application: Running Total
702/24/97 7
Math Instructions - SUBTRACT
Source A - Source B = Dest
N7:010
N7:1 5
N7:2 5
10 - 5 = 5
SUBTRACTSource A N7:0
Source B N7:1
Dest N7:2
SUBI:1
0
802/24/97 8
Math Instructions - MULTIPLY
Source A x Source B = Dest
N7:010
N7:1 5
N7:250
10 x 5 = 50
MULTIPLYSource A N7:0
Source B N7:1
Dest N7:2
MULI:1
0
902/24/97 9
Math Instructions - DIVIDE
Source A ÷ Source B = Dest
N7:010
N7:1 5
N7:2 2
10 ÷ 5 = 2
DIVIDESource A N7:0
Source B N7:1
Dest N7:2
DIVI:1
0
S:13 0 remainder
S:14 2 unrounded quotient
MathRegister{
1002/24/97 10
Math Instructions - DIVIDE
Source A ÷ Source B = Dest
N7:029
N7:110
N7:2 3
29 ÷ 10 = 2.9
DIVIDESource A N7:0
Source B N7:1
Dest N7:2
DIVI:1
0
S:13 9 remainder
S:14 2 unrounded quotient
MathRegister {
1102/24/97 11
Comparison Instructions >
GREATER THANSource A N7:0
Source B N7:1
GTR 0:3
0( )
IF Source A > Source B THEN TRUE ELSE FALSE
N7:029
N7:110
29 > 10 TRUEtherefore Output isEnergized
1202/24/97 12
Comparison Instructions <
LESS THANSource A N7:0
Source B N7:1
LES 0:3
0( )
IF Source A < Source B THEN TRUE ELSE FALSE
N7:029
N7:110
29 < 10 FALSEtherefore Output isde-Energized
1302/24/97 13
Comparison Instructions =
EQUALSource A N7:0
Source B N7:1
EQU 0:3
0( )
IF Source A = Source B THEN TRUE ELSE FALSE
N7:029
N7:110
29 = 10 FALSEtherefore Output isde-Energized
1402/24/97 14
Comparison Instructions
NOT EQUALSource A N7:0
Source B N7:1
NEQ 0:3
0( )
IF Source A Source B THEN TRUE ELSE FALSE
N7:029
N7:110
29 10 TRUEtherefore Output isEnergized
1502/24/97 15
Comparison Instructions
GRTR THAN OR EQUALSource A N7:0
Source B N7:1
GEQ 0:3
0( )
IF Source A Source B THEN TRUE ELSE FALSE
N7:029
N7:110
29 10 TRUEtherefore Output isEnergized
1602/24/97 16
Comparison Instructions
LESS THAN OR EQUALSource A N7:0
Source B N7:1
LEQ 0:3
0( )
IF Source A Source B THEN TRUE ELSE FALSE
N7:029
N7:110
29 10 FALSEtherefore Output isde-Energized
1802/24/97 18
Data Movement - Copy
COPY FILESource #N7:0
Dest #N7:5
Length 4
COPI:1
0
Source Dest
N7:010
N7:120
N7:230
N7:340
N7:4N7:5
10N7:6
20N7:7
30N7:8
40
}
}
2002/24/97 20
Advanced Instructions
ANY QUESTIONS???
MathAddSubractMultiplyDivide
ComparisonGreater ThanLess ThanEqualNot EqualGreater Than or EqualLess Than or Equal
Data MovementMoveCopyClear
2102/24/97 21
Timer Addressing and Parameters
Preset T4:0.PRE How long the timer should time for.
Accumulated T4:0.ACC How long the timer has timed for already.
Done T4:0/DN Set to “1” when accumulated value > preset value.
Timer Timing T4:0/TT Set to “1” when accumulated value < preset value.
Enable T4:0/EN Set to “1” when the rung containing the timer is true.
T4:0
File Type
File Number
Timer Number(0-255)
4Timers
File contains 256 timers
Preset Value
Accumulated Value
15 14 13
EN TT DNWord 0
Word 1
Word 2
2202/24/97 22
The Timer’s “done bit” turns the motor off after a 10 second time delay.
TIMER ON DELAYTimer T4:0Time Base 1.0Preset 10Accum 0
Stop Start Motor
]/[ ] [
] [
( )I:1/0I:1/1
M1O:3/0
O:3/0
] [
M1O:3/0
]/[T4:0/DN
(EN)
(DN)
Timer Done
Timers
TON