ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default Batching, max wait time

Hi,

In this model, I need the items to be batched by recipe. I'd also need the maxwaittime condition for the batching. Please help.

Chieng

To clarify, The situation is this. I have items entering queue with labels: priority and recipe. Items are batched in fours and sent to downstream processor. I first sort the items in the queue by priority. 2nd rule is to batch by recipe with max wait time 200. The thing that makes this difficult for me is that the batch option in queue batches all flowitems regardless of labels. I'll further explain upon request.
Attached Files
File Type: fsm batching.fsm (28.9 KB, 172 views)

Last edited by Chieng Kai Seng; 08-16-2011 at 01:15 AM. Reason: clarification
Reply With Quote
  #2  
Old 08-16-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default Just a thought

I thought it would be nice to have features like batch by itemtype or batch by labelname for the "use batching" in queues. The present one allows one to set only the batch size and max wait time, which doesn't really suffice.. imo.
Reply With Quote
  #3  
Old 08-16-2011
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 683
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Why don't you sort your item in different queues? That way on every queue you can set the batchsize and max wait time just as you like. If your amount of labels are limited use fixed queues, otherwise make some code that makes it dynamicall (like check if your label is already present in a queue and send it to there. If not find an empty queue etc..)
Reply With Quote
  #4  
Old 08-16-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default

What if the number of recipes can't be known or is just too many to create a queue for each of them? I get what you mean but from your experience, is it a better practice to code the behavior of an object or to use a lot of objects to "imitate" that behaviour? the model will look kinda messy in the end I think.. haha!
Reply With Quote
  #5  
Old 08-16-2011
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 683
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

The answer on your question depends on how complex the code is going to be. But whatever you are going to program it will contain some kind of internal queueing system to keep track of what is going on.

So I see at least 2 programming mechanisms here:

Don't send out the items of the queue but use the command "releaseitem" and use 1 or more global tables to store the pointers to the items in the table. The moment you have four, you send them out manually. So actually just do the bookkeeping outside the object.

Other option might be to really create a queue dynamically. You can make a queue containing all the right settings and store it in a user library. If you get a product in that doesn't have a matching queue, you simply create it and when you are done you destroy it again. This will be getting slower if you have to create a lot of queues and in that case you could move them in and out of a queue store, just like the recycling of flow items that Flexsim has build in.

There are probably other ideas possible out there, but these are the ones that come to my mind first and although the second one might not be as fast or elegant as the first, validation might be easier. Anyway see what you can do with it.
Reply With Quote
  #6  
Old 08-17-2011
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 318
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

Because it sounds like as if you only got one Processor and this way there only can be one itemtype used, I´m just thinking about this solution:

Use one queue behind Source and one in front of Processor both connected. The first holds all items. Second got a Batch of four and a max wait time. If second is empty the outputport of first is open and any Item goes to second queue. From now only items with same type can go through the second queue. After releasing all items in second queue, input is again open for every type.

Could this be a way?
__________________
Hemmi
Reply With Quote
  #7  
Old 08-17-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default

Steven,

I learnt that the number of recipes in the production line might go up to hundreds or thousands so i think using queue for each recipe is out. Your 1st idea fits better. And I tried it out. So I have this queue with "do not release item" and with codes that "release item" when the batch is met. But thing is, "release item" requires port num. What if I have multiple processors downstream to choose from? I implemented the "pull" system as discussed in previous thread. If there's something that allows me to release item but let downstream processor to pull it'd be great. If you get what I mean. haha.. and seriously, is there no way to batch by labelname or by itemtype while having the "target batch size" and "max wait time" feature in?? This would make a great feature..

Regards
Reply With Quote
  #8  
Old 08-17-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default

Hi Sebastian,

That would be a way if the number of recipe in line is really little. But thing is, that's not the case. haha.. anyway, thanks for the input.

Cheers, Chieng.
Reply With Quote
  #9  
Old 08-17-2011
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 683
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Quote:
Originally Posted by Chieng Kai Seng View Post
But thing is, "release item" requires port num. What if I have multiple processors downstream to choose from? I implemented the "pull" system as discussed in previous thread. If there's something that allows me to release item but let downstream processor to pull it'd be great. If you get what I mean.
First off all the releaseitem does not require port num. Have you checked the user command list? Then you would have read that the port num is an option and that with releaseitem you trigger the sendtoport trigger again. And as long as that returns -1 your item will stay put. So you can change the sendtoport. For instance get the entry time (getentrytime) and check if that equals the current time (meaning this is the first time the item wants out) then you return -1 and else you return 0 in which case the pull rule works fine. (this might lead to a problem with the last item of a batch so somewhere make sure that there is a very small time before you call releaseitem on the last of a batch)

Another solution, which in this case might be even better because you seem to want to make special things is to use the BasicFR. That one has no releaseitem so your releaseitem and subsequent sendtoport is the only one they will have. But here you also have to use receiveitem because the BasicFR doesn't receive items by itself.


Quote:
Originally Posted by Chieng Kai Seng View Post
haha.. and seriously, is there no way to batch by labelname or by itemtype while having the "target batch size" and "max wait time" feature in?? This would make a great feature..
You are creating some piece of code to combine orders based on some recipe, like an ERP system. Why do you think that is done exactly the same way some where else? I can think of 1000 different ways of combining, grouping, splitting, selecting orders, products or whatever. So if Flexsim would put 1 way in there will immidiately 10 people claiming that there way has to be in there as well. So this will not work. If you can work out a combining solution that works in all circumstances for a lot of people, please don't hesitate to take it up with Flexsim and they will most likely build it in. Or I can build it and sell it to you

Steven
Reply With Quote
  #10  
Old 08-17-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default Thanks for the input. I'm looking into that.

Steven,

Quote:
Originally Posted by Steven Hamoen View Post
You are creating some piece of code to combine orders based on some recipe, like an ERP system. Why do you think that is done exactly the same way some where else? I can think of 1000 different ways of combining, grouping, splitting, selecting orders, products or whatever. So if Flexsim would put 1 way in there will immidiately 10 people claiming that there way has to be in there as well. So this will not work. Steven
If they could include some common templates and write that users are free to build their own codes would be fine enough I believe. After all that's what will make Flexsim easier to use right? By providing common templates(such as mentioned by me. xD) and avoiding the need for users to code on their own.

Quote:
Originally Posted by Steven Hamoen View Post
If you can work out a combining solution that works in all circumstances for a lot of people, please don't hesitate to take it up with Flexsim and they will most likely build it in. Or I can build it and sell it to you Steven
Oww.. If I made the codes for that I'll sell it to Flexsim I tell you.. haha!

Cheers, Chieng.
Reply With Quote
  #11  
Old 08-20-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Exclamation Still stucked. Urgent help needed.

Hi,

I attach my latest model here. Please check that the maximum content for SRT01 is 4 before proceeding.

First, I'll explain what I'm working on. The minifab has tools(processors) connected to toolgroups(queues). Source generates flowitems according to schedule. Process flow is read into flowitems at Start/sendto. Processors pull flowitems according to their process flow table in the label table of each flowitem.

My main issue is batching at FUR. My code works by sorting flowitems in queue by CR(priority) onEntry. Message triggers by userevent causes FUR to decide the batch to release downstream. I use 'releaseitem' here and whether the batch flows by first available or not to be released is decided at FUR/sendto.

Stop simulation at time 230, you'll see a batch of green items(recipe b) already at FUR. I assume my codes works perfectly here so that batch of green items should be in the released state but cannot move out of FUR because the available downstream processor(FOX02) is processing. At time 231, a red batch(recipe a) comes in and is released also. meaning a total of 8 flowitems are released. and at that same moment they all move out of FUR. By right, what I need is that green batch appears at FOX02 and red batch appears at FOX03. But the simlation at time 231 gives me a mixture of both at FOX02 and FOX03.

I suspect that it's the confusion at FUR when 8 flowitems are released but they are no longer batched but are released as seperate entities. I thought of two possible ways to solve this but I do not know how to implement them.
1. when there is a released batch in FUR(e.g. the green batch in this case), do not batch or do not release anymore batch.
2. mark the released batch(but haven't moved out of queue), and only release them in the way they are batched(same recipe) when downstream processor is available.

Please help the rookie here. Tell me if the way I wrote the codes is wrong or should be improved to avoid errors or any other comments. I'll try to use only ONE QUEUE if possible. I appreciate any input.

Suddenly hit me, can I create a node to store the batched items and then move the items stored in the node only when downstream processor is available? It works pretty much like a queue I think. Do tell me if this could work and how to implement it. Thanks!

Cheers,
Chieng
Attached Files
File Type: fsm minifab4.3.fsm (41.0 KB, 170 views)
Reply With Quote
  #12  
Old 08-21-2011
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 641
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

hi,

i haven't opened your modell, but you can prevent mixing if you write a special code at the Pull Requirement.
If the content of the processor is 0 the return - value is 1. If the processor has already some content, the itemtype must match (getitemtype(item)==getitemtype(last(current))).

Jörg
Reply With Quote
The Following User Says Thank You to Jörg Vogel For This Useful Post:
Chieng Kai Seng (08-21-2011)
  #13  
Old 08-21-2011
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 450
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

Jörg is right about your Pull Requirement. Also, you don't need to use the re-evaluate check box. Please read the user manual help on these to items.

I'm also concerned that your pull requirement will let you down if you have batches of the same type released close together... with the first not being a "full" batch cut short by time. But that depends on what your process rules are.

I have uploaded a MultiBatchingQueue here:
http://www.flexsim.com/community/for...ead.php?t=1871
Attached Files
File Type: fsm minifab4.3_KG.fsm (58.4 KB, 142 views)
Reply With Quote
The Following User Says Thank You to Kris Geisberger For This Useful Post:
Chieng Kai Seng (08-21-2011)
  #14  
Old 08-21-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default Thanks

Kris,

Thanks so much for the model! Took you 2 hrs, took me 1 week. You guys are the experts! Respect. I'll get back if I encounter problems with the code you provide. Do the members of the forum use private message much? If yes then I thought maybe I could make direct communication with some.

Cheers,
Chieng
Reply With Quote
  #15  
Old 08-21-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default

Quote:
Originally Posted by Kris Geisberger View Post
I'm also concerned that your pull requirement will let you down if you have batches of the same type released close together... with the first not being a "full" batch cut short by time. But that depends on what your process rules are.
I don't get what you mean. Are you referring to the pull req I wrote or the one you modified? Do you mean when the first is recipe A batched in 3 and second is recipe B batched in 4?
Reply With Quote
  #16  
Old 08-21-2011
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 450
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

The situation might not be possible based on your process and data but I'll explain anyway. What if you release a batch of say 3 items of recipe A because max time was reached, but then shortly after (within a FOX2 cycle), a number of recipe A items arrive such that you have another complete batch. When this second batch of recipe A is released, FOX2 still has capacity for 1 more item so the first item of the second batch will go to FOX2 and the rest will go to FOX3. I'm assuming you want to keep the batches together, so I suggest adding a BatchID label or something to differentiate each batch.

On line 14 of the Pull Requirement I wrote I made a comment saying "REPLACE THIS". In my code my condition compares itemtypes, but that really does nothing for you in your model. By comparing BatchID labels the Pull Requirement will make sure that a tool only processes items from the same batch at any given time.
Reply With Quote
  #17  
Old 08-21-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default

If all I need is for the same recipe to be batched together, regardless of how it was batched upstream, the code works right? I've replaced line 14 of Pull Requirement.
Reply With Quote
  #18  
Old 08-21-2011
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 450
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

So then your line 14 should read:
if(comparetext(getlabelstr(item,"Recipe"), getlabelstr(first(current),"Recipe")))
Reply With Quote
The Following User Says Thank You to Kris Geisberger For This Useful Post:
Chieng Kai Seng (08-21-2011)
  #19  
Old 08-22-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default WPF

This model has an additional group: WPF. I have some problem at this area.

WPF21 and WPF22 are capable of processing 2 items in a batch but has a capacity of up to 8(multiple batches are allowed at the same time on one tool). There is a time interval between each of the batches which is determined by the remaining process time of the last batch on either the processor vs the remaining process time of the batch waiting to come in from the upstream queue.

At time 417, there're 4 items in a batch on WPF21(shouldn't happen). How can I correct that? Yes, they are of the same recipe but one batch should only have 2 items. I'm thinking it's the way I code it to closeinput that might be causing the problem. Code is at WPF21/onEntry. The way I book-keep using labels on WPF,WPF21 and WPF22 also doesn't feel robust enough. The rookie needs help.

Cheers,
Chieng
Attached Files
File Type: fsm minifab4.6.fsm (73.1 KB, 145 views)
Reply With Quote
  #20  
Old 08-26-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 108
Chieng Kai Seng is on a distinguished road
Default URGENT.

This is the latest model. I have chunked down the problem. The problem occurs at time 525. At time 525.000, the flowitem P1005007.007 at queue WPF moves out of the queue, enters WPF21, exits WPF21, and enters WPF again. I've attached the screenshot of log event to show this. All at the same time. What happened? Why is the process time ignored?

According to the codes, what should have happened is that P105007.007 is batched together with P105007.005, leave WPF and be processed in WPF21 for 30 unit time.

Is there a loophole in the code or what? Please advise on how to correct this.
Thank you.

Chieng.
Attached Thumbnails
Click image for larger version

Name:	Untitled.jpg
Views:	161
Size:	99.9 KB
ID:	1485  
Attached Files
File Type: fsm fabmodel.fsm (76.5 KB, 131 views)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying the simulation time with the various date/time formats. Regan Blackett Tips and Tricks 12 11-12-2012 08:01 AM
What is the exact start time of dewell time? zhang xin Container Terminal (CT) Library 1 11-23-2009 10:56 AM
All time related values 0,0000001 time units delayed Patrick Cap Q&A 2 05-01-2009 01:50 AM
Call Two operators for Repair but wait until both are available Brandon Peterson Tips and Tricks 6 10-15-2008 01:12 PM
batching problem KelvinHo Q&A 9 06-25-2008 08:17 PM


All times are GMT -6. The time now is 12:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.