News:

  • June 11, 2026, 04:59:44 AM

Login with username, password and session length

Author Topic: Sequencing? Controlling Priority? I'm not sure?  (Read 10973 times)

Dean

  • Sr. Member
  • ****
  • Posts: 73
Sequencing? Controlling Priority? I'm not sure?
« on: November 30, 2015, 10:44:03 AM »
We have a vacuum powered resin transport system here at work. Its an older Motan system that is micro-controller based. We had a little scare a couple of weeks ago, in that we thought the control board had been blitzed by a power outage. Turns out it had just lost some of the configuration settings, and once the we put those all back, everything was hunky dory. It of course got me to thinking that this would be a good learning opportunity to try to replicate the controller function with ladder. Everything is pretty straightforward except the station sequencing, and for the life of me, I can't quite get what to do. Basically this system can control up to 6 receivers, (we only use 3) and it only allows 1 receiver at a time to fill. Basically if station 1 is calling for resin, then stations 2-6 have to wait. If station 3 is also calling then it gets a chance next, and so on. This sounds like it has to be some classic first year automation student problem that has been solved a thousand times to Sunday already, but it is giving me fits. Where do I need to be looking?
10 Lather
20 Rinse
30 GOTO 10

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Sequencing? Controlling Priority? I'm not sure?
« Reply #1 on: November 30, 2015, 12:21:37 PM »
I am doing something similar hear at work. I have 3 tanks that pump from a common source. But only one is allowed to pump at a time.
Start by writing down your criteria.
-only one can pump at a time.
-after a certain level, shut down, allow the other to pump if it needs too
-first in , first out
-Overflow alarms
-Main tank empty, hold
etc, etc
Once you see it on paper, start to construct you ladder.

I have lots of if and thens when all said and done. Has worked for years flawlessly. Lots of preventative measures built in.
Auto shut down sequences and much more, then I care to type. :)

It can be done.

Write it down first.


Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Sequencing? Controlling Priority? I'm not sure?
« Reply #2 on: November 30, 2015, 12:24:22 PM »
You need some kind of flag that says whether the system is already filling another station (or you might even have it say which other station is filling).

There are quite a few ways to to that.  You could have a register whose value says which station is filling.  When a station calls for resin, and no other station is filling, it starts filling and sets the register to its own station number.  When it's done, it resets the register to zero, which is how the next station calling for resin will know the system is available.  You could also use bits in a register.  Again, if the value is zero, set your bit and begin filling, clear it when done, and so on.  You could even just set a single bit as the busy/available bit if you have no need to know which other station has control.

I think you may also want to have a request queue, so that the station that's been calling the longest gets filled next, rather than the next station to gain control depending on the order in ladder or something like that.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Sequencing? Controlling Priority? I'm not sure?
« Reply #3 on: November 30, 2015, 12:59:14 PM »
I agree on writing out exactly what needs to happen. I will attach a couple of screenshots of a prioritizer layout that I use quite a bit. I have a different bits that I SET for each part of the process that needs to complete (First screenshot). This will in turn start a Program block that controls the additional Program/Task blocks that are required to complete each step. Inside this Program block I use stages to sort through the higher priority items to queue their completion (Screenshot 2).





Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: Sequencing? Controlling Priority? I'm not sure?
« Reply #4 on: November 30, 2015, 10:22:05 PM »
The JMPI (Index Jump) would do the shortcut of calling the staged code needed and use a small index first-in first-out buffer for the index of receiver numbers. When the receiver is full then shift the buffer up one buffering out the first and the next one in calling order will be next. Maybe with the MOVER instruction to shift the buffer.

Dean

  • Sr. Member
  • ****
  • Posts: 73
Re: Sequencing? Controlling Priority? I'm not sure?
« Reply #5 on: December 01, 2015, 06:50:58 AM »
Thanks everyone. Looks like I have a bit of work to do.
10 Lather
20 Rinse
30 GOTO 10