Vous êtes sur la page 1sur 5

PUMP ROUTINES.

RSS
LAD 3 - ALTERNATOR --- Total Rungs in File = 7

0000

Beginning of pump alternator logic. This routine controls the lead / lag pump selection for installations of 2 to 8 pumps. The total number
of pumps is entered in C12:0.PRE. The lead pump is identifiedted by the value in C12:0.ACC. This value is zero based, first pump is pump
0. The value in C12:ACC may be externally manipulated to change the lead pump selection, for example a selector switch could be used to
manually select a lead pump. Set bit B10:1/15 to disable automatic lead pump rotation. The desired number of pumps to call is selected by
setting bits in B10:1. If a pump is out of service for any reason, manually sellected to 'OFF' or failed, the corresponding bit in B10:2 should
be set to cause another pump to start in sequence. This rung controls automatic lead pump selection. A new lead pump is selected each
time the lead pump is called for.
SBR
Subroutine

Enable Lead
Pump
B10:1
0

Auto Select
Next Lead Pump
One Shot
B11:6
OSR
0

Disable Auto
Lead Pump
Selection
B10:1
15

Pump Alternator
Counter
CTU
Count Up
Counter
Preset
Accum

CU
C12:0
4<
1<

Pump Alternator
Number of Pumps
GRT
Greater Than (A>B)
Source A C12:0.PRE
4<
Source B
8
8<

Pump Alternator
Number of Pumps
MOV
Move
Source

Pump Alternator
Number of Pumps
LES
Less Than (A<B)
Source A C12:0.PRE
4<
Source B
2
2<

Pump Alternator
Number of Pumps
MOV
Move
Source

Pump Alternator
Count
Complete
C12:0

Dest

Dest

DN

8
8<
C12:0.PRE
4<

2
2<
C12:0.PRE
4<

Pump Alternator
Counter
C12:0
RES

DN

Page 0

Wednesday, October 25, 2000 - 11:34:39

PUMP ROUTINES.RSS
LAD 3 - ALTERNATOR --- Total Rungs in File = 7

0001

The pump call bits are routed to the correct pumps by bit shifting these bits a number of positions based on the selected lead pump. Rather
than use a BSL instruction, this routine shifts bits by multipling bu powers of 2. For example, to shift a the call bits 4 position to the left,
multiply by 2^4. This rung calculates the required 'powers of 2' multiplier in B11:0. An input / output bit mask is generated in B11:0
based on the total number of pumps in C12:0.PRE. The call bits are masked out of B10:1 into B11:2. Pumps that are called for but
unavailable for any reason are identified in B11:5
Powers of 2
Multiplier for
Pump Call Bit
Shifting
DCD
Decode 4 to 1 of 16
Source
C12:0.ACC
0001h<
Dest
B11:0
0000000000000010 <
Pump Input /
Output Bit Mask
CPT
Compute
Dest
Expression

B11:1
0000000000000000 <
( 2 ** C12:0.PRE ) - 1

Masked Pump
Call Bits
AND
Bitwise AND
Source A
Source B
Dest

Pumps Required
but not
Available
AND
Bitwise AND
Source A
Source B
Dest

Page 1

B11:1
0000h<
B10:1
0000h<
B11:2
0000h<

B10:0
0006h<
B10:2
0000h<
B11:5
0000h<

Wednesday, October 25, 2000 - 11:34:43

PUMP ROUTINES.RSS
LAD 3 - ALTERNATOR --- Total Rungs in File = 7

0002

Pump Lead / Lag call bits are shifted to the correct pumps by multipling the call bit word, B11:2, by the lead pump 'powers of 2' multiplier,
B11:0. If a required pump is unavailable the next pump in the sequence is called by bit shifting B11:3 one position to the left then ORing it
back onto the unshifted value.
Bit Shifted
Call Bits #1
MUL
Multiply
Source A
B11:2
0000000000000000 <
Source B
B11:0
0000000000000010 <
Dest
B11:3
0000000000000000 <

Pump 0 Required
But Not
Available
B11:5
0

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Pump 1 Required
But Not
Available
B11:5
1

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Pump 2 Required
But Not
Available
B11:5
2

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Pump 3 Required
But Not
Available
B11:5
3

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Page 2

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

Wednesday, October 25, 2000 - 11:34:43

PUMP ROUTINES.RSS
LAD 3 - ALTERNATOR --- Total Rungs in File = 7

Pump 4 Required
But Not
Available
B11:5
4

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Pump 5 Required
But Not
Available
B11:5
5

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Pump 6 Required
But Not
Available
B11:5
6

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

Pump 7 Required
But Not
Available
B11:5
7

Bit Shifted
Call Bits #1
CPT
Compute
Dest
Expression

0003

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

B11:3
0000000000000000 <
( B11:3 * 2 ) OR B11:3

When fewer than 8 pumps are used, an additional bit shifting and ORing is required to get the correct pumps selected.
Bit Shifted
Call Bits #1
CPT
Compute
Dest
B11:3
0000000000000000 <
Expression B11:3 OR ( B11:3 * ( 2 ** ( 8 - C12:0.PRE ) ) )

Page 3

Wednesday, October 25, 2000 - 11:34:43

PUMP ROUTINES.RSS
LAD 3 - ALTERNATOR --- Total Rungs in File = 7

0004

When bit shifting the call bits in the above rungs, bits from the low byte of B11:3 will shift into the high byte. In order to recover these lost
bits, the high byte is ORed into the low byte. The result is masked moved into the output word B10:0.
Bit Shifted
Call Bits #2
MOV
Move
Source
B11:3
0000000000000000 <
Dest
B11:4
0000000000000000 <
Bit Shifted
Call Bits #2
SWP
Swap
Source
Length

#B11:4
1

Bit Shifted
Call Bits #2
OR
Bitwise Inclusive OR
Source A
B11:3
0000h<
Source B
B11:4
0000h<
Dest
B11:4
0000h<
Alternator
Output Word
MVM
Masked Move
Source
B11:4
0000000000000000 <
Mask
B11:1
0000h<
Dest
B10:0
0000000000000110 <
Reset the overflow trap and return.
Overflow
Trap
S2:5
U
0

0005
RET
Return

0006

Page 4

END

Wednesday, October 25, 2000 - 11:34:44

Vous aimerez peut-être aussi