FIFO dilemma

jakeemon

Member
Join Date
Aug 2013
Location
Christchurch
Posts
13
Hi guys,

I have a problem with setting up a FIFO register in RS500.

What I have is a pump that needs to supply 6 rooms with sprayed water at timed intervals but only 1 room at a time. I've got the timing and spraying side working correctly but I can't figure out how to ensure only 1 room sprays at a time.

This is where the FIFO comes in.....

I've tried to set it up so that each room is assigned a number, the FIFO pushes a number into a register as each room requests a spray.

eg. Room one timer is up so a 1 gets pushed into the FIFO
Room two timer is up so a 2 gets pushed into the FIFO
Room three timer is up so a 3 gets pushed into the FIFO

After the room requests have been set the FIFO unloads to an N:? register. This N:? register is then used in an EQU functions to determine which room sprays.

At the end of program I zero the N:? register ready for the next room.

My problem is I think I'm zeroing the register in the wrong way as the system doesn't work!!
 
Is this a class assignment?

Don't you want to zero the current room register when that room has finished spraying and then look at the next room on the FIFO stack?

Try posting your code snippets
 
i am not a code writing expert by any imagination , i also have more questions than answers and i am assuming that each room is identical.
Also that each sequence is proven as having been completed and accurately fulfilled , would the system cope with interruptions such as power loss and loss of water flow or a stuck solenoid valve .

The reason why i ask is that if the sequences are proven and there is no need to report data on further to a host system , then could the cycle not set and reset it self with logical proof and then just count the number of cycles per day and compare the number as a fault or pass situation .
I am sure there are a number of fault's that could occur and halt the system .

But in the end not knowing exactly even how i would try a logical counting exercise , counting from 1 to 5 and scoring the number of times the number 1 or any other number appears and then having to display the results might require a little bit of modeling and testing for me though .

My point is, if the system is sound and you only need to count completed rotations of a cycle , might it be not better just to count completed cycles and compare the number to a predefined daily count or weekly count and a pass of fail could halt the system or allow it to run as normal .

Instead of proving each step in the system and then executing the the next step until all is completed .
:)As you pointed out that each room is only allowed one spray and each cycle consists of five rooms . And then it is reset to do it all over again . I would be interested in how this pans out cheers and good luck
 
It is an actual system for my work, not a project. I'm not using the FIFO for count reasons, my pump is not big enough to handle more than one room spraying. I CANNOT have more than one valve open at any one time. As all the spray times can vary, there will be times where the rooms will overlap. If this happens I need the FIFO to manage which room sprays next.

Cheers
 
I can't cut and paste code at moment but here is what I'm doing.

]spray timer1 done[----]ONS[------[FIFO load 1 to N7:8]
]spray timer2 done[----]ONS[------[FIFO load 2 to N7:8]

----------------------------------[FIFO unload N7:8 to N7:9]

--------]EQU N7:9 = 1[------------[start room 1 cycle]
--------]EQU N7:9 = 2[------------[start room 2 cycle]

----------------------------------[MOV zero to N7:9]

I don't have any trigger for FIFO unload or to zero N7:9 as I want program to just keep continuously moving bits through register as the spray times finish.
 
]spray timer1 done[----]ONS[------[FIFO load 1 to N7:8]
]spray timer2 done[----]ONS[------[FIFO load 2 to N7:8]

IF CYCLE N7:9 IS DONE-------------[FIFO unload N7:8 to N7:9]

--------]EQU N7:9 = 1[------------[start room 1 cycle]
--------]EQU N7:9 = 2[------------[start room 2 cycle]

SHOULDNT NEED THIS. FIFO WILL BE ZERO WHEN EMPTY----------------------------------[MOV zero to N7:9]

Try that and see if it helps
 
I've got the timing and spraying side working correctly but I can't figure out how to ensure only 1 room sprays at a time.
. . .
My problem is I think I'm zeroing the register in the wrong way as the system doesn't work!!
Based totally on your description, you really don't need a FIFO. I think if I started this from the beginning, I would probably use one timer and 1 counter (assuming that each room needs to be sprayed for the same time period). Logic: When the Counter Acc = Room number, turn on spray for that room.

Okay, I see that the room spray times are variables. In which case, use 5 timers, each with a Preset that can be changed from the control panel. But still use the Counter to control which room gets sprayed. I will try to post an example later.
 
Last edited:
Here is an example that does WHAT YOU DESCRIBED (sprays 6 rooms for variable times, but in the same sequence 1 to 6). If the room sprays are instead random events that happen in different sequences, then you would need a FIFO.
 
Last edited:
Thanks for the help Lancie, only problem with your solution tho is that it is possible for two room timers to finish at the same time and request a new spray. So yes this does make it random and I will need a FIFO or similar.

Thanks
 
Unless....... I reset the counter at the end of each scan, that way the higher numbers would have preference and the counter would drop by one each scan. BTW 90% of the time the rooms will be out of sequence but I HAVE to allow for the timers finishing at the same time as the liters sprayed per room HAS to be consistent.I cant have the flow drop off when more than one room sprays.
 
Thanks for the help Lancie, only problem with your solution tho is that it is possible for two room timers to finish at the same time and request a new spray.
No, my version sprays the rooms in sequence just as I said. No timer can finish at the same time as any other timer (because only 1 timer is started for each Counter count, and the next timer CAN NOT start until the previous room timer is DONE).

It seems that there may be some other controlling factor that you have not told us about. My timers control the time for each room spray. If the rooms "become available" for spraying due to some other factor, then that factor should be used to trigger the counter (or a FFU register).

The key for using a FIFO is to let the "room available for spraying" trigger the FIFO Load, but the "previous room spray timer finished" control the FIFO Unload.
 
Last edited:
BTW 90% of the time the rooms will be out of sequence...
Good enough, but please tell us WHAT determines WHEN a room is ready for spraying?

If the 6 rooms cannot always be sprayed in sequence (Room 1, then 2, then 3, and so on), then what factor sets when each room CAN be sprayed? Is it when some process or operations finishes in each room, or what? That is the critical factor that you have not mentioned.
 
Last edited:

Similar Topics

I am not sure if this is possible but if there is a way, you guys would be the ones to know. I am currently working on a project where we are...
Replies
7
Views
213
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
956
Hello! I have a network of conveyors bringing raw product to 4 machines. A sensor in the hopper of each machine calls for more product. I'm...
Replies
15
Views
5,844
Hello everyone, has anyone out there ever made a FIFO using an FFL and FFU instructions on a Micro800? I have tried setting it up just as I would...
Replies
9
Views
3,110
I have a bottle capper that is using an encoder and FIFO logic to track the free standing bottles passing through a bottle capper. I have checked...
Replies
31
Views
11,661
Back
Top Bottom