RSLogix 5000 FIFO
RSLogix 5000 FIFO
(OP)
I have to get four pumps which are dedicated to one tank each to start first on first off. Even though the demand may fluctuate. I am having some major writers block figuring this out..... Every other system I have done uses first on last off.
If anyone can give me an example or even write in text an example, I would greatly appreciate it.
If anyone can give me an example or even write in text an example, I would greatly appreciate it.





RE: RSLogix 5000 FIFO
For our example let's create five tags (DINTS would be fine). call them Reg1, Reg2, Reg3, Reg4, and Reg5.
Do this for each of your four pumps:
If pump 1 is energized and Reg5 = 0, then load a "1" (using a oneshot) into Reg 5. '(However, you will have to wait to energize pump 1 until Reg5 is = 0 otherwise you will lose track of which pump came on first).
If pump 2 is energized and Reg5 = 0, then load a "2" (using a oneshot) into Reg 5. '(However, you will have to wait to energize pump 2 until Reg5 is = 0 otherwise you will lose track of which pump came on first).
If pump 3 is energized and Reg5 = 0, then load a "3" (using a oneshot) into Reg 5. '(However, you will have to wait to energize pump 3 until Reg5 is = 0 otherwise you will lose track of which pump came on first).
If pump 4 is energized and Reg5 = 0, then load a "4" (using a oneshot) into Reg 5. '(However, you will have to wait to energize pump 4 until Reg5 is = 0 otherwise you will lose track of which pump came on first).
'BTW, the "wait" period for any motor (if necessary) will always be no more than one scan.
'The only reason why Reg5 would not be set to 0 would be if two pumps tried to come on during the same scan.
'This next bit of code will have to be done for each register from Reg5 to Reg 1.
If Reg5 <> 0 and Reg4 = 0, then copy Reg5 into Reg4, and 0 out Reg5.
If Reg4 <> 0 and Reg3 = 0 then copy Reg4 into Reg3, and zero out Reg4.
If Reg3 <> 0 and Reg2 = 0 .... And so on until you get to Reg1.
'Notice that by doing your "bubble up" from the highest register to the lowest, your program will move your newest entry up the entire stack in one scan.
'Now, when it comes time to shut off a motor, look at the value in Reg1 (which should be either a 1, 2, 3, or 4), and shut that motor off. You can then turn that motor back on and it will take it's position at the bottom of the stack.
'Note that you really don't need five registers, four would do the trick, but I would provide for five because it should prevent any gremlins from popping up.
I would of coded this for you in RSLogix, but I don't have RSLogix on this PC. Sorry.
RE: RSLogix 5000 FIFO
T.J.
RE: RSLogix 5000 FIFO
I exported it to a L5K file (open it in RS5k and save it as FIFO Example or whatever).
I didn't pick any particular processor, or I/O, etc. But you shouldn't have any trouble editing it.