ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
pull from rack using table
Dear Friends,
I have made a model for picking items from rack. I have used pull function and global table. The model works but it does not follow the global table sequence. Please find the model attached with this. Regards, Manoj. |
#2
|
||||
|
||||
Hello,
The Pull Requirement tests over all released items in the pulled objects. You should specify the exact item you want to pull. The loop is done from the flexsim engine. Pull Requirement Code:
// test label nextorderrow of existance treenode nextorderrow = label(current,"nextorderrow"); if(!objectexists(nextorderrow)) { addlabel(current,"nextorderrow",1); nextorderrow = label(current,"nextorderrow"); } if((getinput(current)==0) && (getvarnum(current,"nroftransportsin")== 0)) setlabelnum(current,"nextorderrow",1); // initialize number label > equal to OnReset-Trigger on reset //for (int row = 1; row <= gettablerows("order");row++) int row = getlabelnum(current,"nextorderrow"); int bay = gettablenum("order",row,1); int level = gettablenum("order",row,2); treenode itemtorelease = rackgetitembybaylevel(inobject(current,1),bay,level,1); // possibly pull item if(item == itemtorelease) { inc(nextorderrow,1); // set next order row return 1; } return 0; Last edited by Jörg Vogel; 12-18-2012 at 09:30 AM. Reason: error in condition initialize label nextorderrow |
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
Manoj Kumar (12-18-2012) |
#3
|
|||
|
|||
Similar Problem
I have a model that has 60 different itemtypes going into racks like an ASRS system. I'm trying to pull a group of items by their item type and label so that when an "order" is complete it comes out of the racks together. The number of items of each itemtype changes and is checked with a global table. Here is the code I have written in my queue's "Pull" section. Any help would be appreciated.
/**Custom Code*/ treenodecurrent = ownerobject(c); treenode item = parnode(1); int val = 1; while (val < 61) { string valstr = numtostring(val); string trackedvar = concat("Source", valstr, "Count"); double valcount = gettrackedvariable(trackedvar); int row = val; int col = 1; string tablename = "ItemCount"; int itemnum = gettablenum(tablename, row, col); if (valcount == itemnum) { int port = parval(2); int type = val; return getitemtype(item) == type; string labelname = "WaveNumber"; return getlabelnum(item,labelname); } else { val = val + 1; } } |
#4
|
||||
|
||||
Hello Kurt,
Quote:
The Pull Requirement is a long lasting function. It is repeated over all items to be released from the inobjects of your object. That means after the first executed return-command, the function ends. Flexsim calls the Pull Requirement function again for the next item that an inobject can release. The Pull Requirement ends again and flexsim calls the Pull Requirement on the next Item that an inobject can release, and so on. The Pull Requirement tests only the items of the inobjects, which you allowed to test on in the Pull Strategy. This loop is a single Event in Flexsim, the simulation time is the same as on the first call of the Pull Requirement. Please try it on your own. You can write a code in the Pull Requirement, which tells you which item, which rank the item owns, from which releasing object, is currently tested: Code:
pt(getname(item));pt(" "); pd(getrank(item));pt(" "); pt(getname(up(item))); The Pull Requirement tests if the tested item should be pulled or not. The return values are true or false (1 or 0). I commented your code a bit. Quote:
Jörg Last edited by Jörg Vogel; 07-25-2013 at 01:36 AM. Reason: add Pull Strategy |
#5
|
|||
|
|||
Pulling specific batch
I've gotten the queue to pull when an order is complete, but it seems that once one order is complete it pulls every order whether or not it is complete. Here's the code.
Code:
/**Custom Code*/ treenodecurrent = ownerobject(c); treenode item = parnode(1); double value = 0; string labelname = "WaveAndItem"; int val = 1; while (val < 61) { string valstr = numtostring(val); string trackedvar = concat("Source", valstr, "Count"); double valcount = gettrackedvariable(trackedvar); int col = 1; string tablename = "ItemCount"; double itemnum = gettablenum(tablename, val, col); if (valcount == itemnum) { int port = parval(2); value = getlabelnum(item,labelname); break; } else { val = val + 1; } } return getlabelnum(item,labelname) == value; |
#6
|
||||
|
||||
Hi,
in PullFromRack_JV.fsm the Engine does the loop. If the Rack contains an amount of 3 flowitems with the same Labelvalue the queue starts to pull these items. Jörg Last edited by Jörg Vogel; 12-03-2014 at 03:36 AM. |
#7
|
|||
|
|||
They don't have the same label value though. I even put breaks in the code so that when the queue should start pulling items it would stop to show the code, but it started pulling items before.
Last edited by Kurt Ehlers; 07-30-2013 at 08:21 AM. |
#8
|
|||
|
|||
So the queue will correctly pull boxes when the order is complete, so that part is ok. The problem is that only that queue will pull, so if other boxes in the order are in different racks, they won't get pulled. The new model is attached.
|
#9
|
||||
|
||||
You can set a flag to indicate, which batch can be pulled. If you check the amount of pulled Items belonging to the batch, you can unset the flag, when the last Item is pulled. This method can you write at the beginning of your Pull Requirement.
Jörg |
#11
|
||||
|
||||
You can add second column in your global table "ItemCount"
When the batch size of an itemtype is stored over all your racks, change the value in the second column from 0 to the value of the batch size. Each time you pull an item from that batch you reduce this value by one. In the Pull Requirement you check if the item, that is currently tested, belongs to an itemtype with a number greater than 0 in the second column in your table"ItemCount". If that is true you reduce the value in the second column and call "return 1" on that item. Jörg |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Kurt Ehlers (08-06-2013) |
#12
|
|||
|
|||
Still doesn't work
I tried what you recommended, as well as some other fruitless ideas, but it still will not work. The two attached files have slightly different pull codes in the exit queues. Any more ideas?
|
#13
|
|||
|
|||
Search the forum for releaseitem and make a small test model to practice using releaseitem.
1. Abort the Pull Logic approach 2. On all your racks, set the SendTo to "Do No Release Item" pick option (or just return -1) 3. Create a User Command that gets called just before the return -1; in the SendTo. This command will act like a central brain for the entire ASRS. It is responsible for updating your inventory count (in a table or TVs like you have) for the item that just entered. Then it should check whether the order is complete. If the order is complete, you loop through all the appropriate racks to find the items belonging to the order and call releaseitem(<theitem>,1) on each of them (and maybe decrement your count). You might have to send a message in zero time to an object of your choice and perform the search-and-releaseitem there to be safe. That said, might as well center connect a single object to all racks so that you have easy references to them. So, if you are uncomfortable with user commands, just use the OnMessage of that central object instead (senddelayedmessage in 0 time from the SendTo before the return -1). I would use a Dispatcher just because it looks like a controller and has an OnMessage. |
The Following 2 Users Say Thank You to Kris Geisberger For This Useful Post: | ||
Kurt Ehlers (08-06-2013) |
#14
|
||||
|
||||
if you still want to stay on the pull strategie, here is small model PullFromRack2_JV.fsm without a while-loop but a for-loop
Jörg Last edited by Jörg Vogel; 12-03-2014 at 03:40 AM. |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Kurt Ehlers (08-06-2013) |
Tags |
pull from rack |
Thread | Thread Starter | Forum | Replies | Last Post |
Rack number from global table | Manoj Kumar | Q&A | 1 | 05-31-2012 03:40 AM |
Pull Specific Flowitems from Rack using Message | Christian Norregaard | Q&A | 2 | 04-04-2012 07:28 AM |
Pull rule | Alan Pope | Q&A | 4 | 04-15-2010 07:46 AM |
Can I make a column of a global table to type table? | qin tian | Q&A | 0 | 10-01-2008 09:27 PM |
Pull items out of a rack | BenjaminBuecklein | Q&A | 1 | 09-22-2008 03:59 AM |