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
Downloads

Q&A Using Flexsim and building models

  #1  
Old 03-09-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default Batch production (Batch size for processor)

I have a very simple production line with a source, a sink, and a buffer between two machines on which different products are produced.

First of all I want to do batch production with different processing times for the products. The batch production offered in the menu process time doest work the way I expect. Batch production to me means: the production at a machine only starts if my queue can offer the batchsize of a product (Pull control and FIFO). Then the machine processes the whole batch (Either at the same time or one after the other, doesnt matter). For example products A, B, C with batchsizes 2, 3, 4 for machine 1, batch sizes 4,6,8 for machine2 and process times ta1,tb1, tc1, ta2, tb2, tc2. After the production of a batch, the batch shall be released to the queue. I emulated this with a source with releases my products in the wished batch sizes. Between the machines is a queue for each product with the batch sizes of machine 1 which releases the products to the buffers (I need the data of the buffer). The buffers have the batch sizes of machine 2.



Problem with this kind of simulation is, that it is a push control. Once the batch size for machine 2 is reached the buffer will release the products will to the intermediate queue and the data for the buffer will not correspond to the data with a pull control (Because a batch may be released to the intermediate queue although machine 2 is still working on another batch)

The combination with process time according to cases should not be too difficult, if the batch production once works proper.


Secondly I use recorders with standard data, I will only need simple data like this. How can I export the data from the recorder as fast as possible (automatically)? Is it possible to export it to Excel directly? I need the content time graphs for the single products and the accumulated ones...

Best regards from China

Patrick Cap
Attached Thumbnails
Click image for larger version
Name:	Bild1.jpg
Views:	427
Size:	186.6 KB
ID:	595  
  #2  
Old 03-18-2009
Jeff Nordgren's Avatar
Jeff Nordgren Jeff Nordgren is offline
Technical Support Manager
 
Join Date: Jul 2007
Location: Orem, UT
Posts: 65
Downloads: 79
Uploads: 0
Thanks: 40
Thanked 21 Times in 17 Posts
Rep Power: 233
Jeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really nice
Default

Patrick,

Attached is a model that I hope does what you are describing. Take a look at the model and see if it will work for you or at least give you some ideas as to what you can do.

As far as the recorders go, I'm not real sure what you are wanting them to do. Anything that writes directly to Excel is going to be SLOW. It would be better to write it to a global table and then when the model is finished, export that to Excel for processing.
Attached Files
File Type: zip BatchProduction.zip (53.9 KB, 484 views)
__________________
Jeff
Flexsim Support
The Following User Says Thank You to Jeff Nordgren For This Useful Post:
Patrick Cap (03-19-2009)
  #3  
Old 03-19-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default

okay i see. seems pretty much the same what i did. i will check out if it is enough to solve the problem...thanks!
The Following User Says Thank You to Patrick Cap For This Useful Post:
Jeff Nordgren (03-23-2009)
  #4  
Old 03-23-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default

i had some time to work on my studies and i gotta admit, its pretty different to my newbee solution Thanks for your help, I think this brought me a lot closer.

Some problems remain:

1st: The objects in the right queue will not be in my statics of the buffer, although they are not being processed when they are pending. One buffer for each item would be better (a real pull control of the machine)
2nd: i changed the global table. the maximum contents in the right queues are changed, but not the batch size...Furthermore the production stops after the first 2 batches (that means after the production of one batch of product 1 and one batch of product2) I tried to figure out why, but because i have some problems understanding the triggers i couldnt find the problem. In the appendix you find the data I used.
3rd: All I need is the content data of each buffer in an excel file. I know how to get this data with the flexsim chart model but i am still struggling to get only this graph with this data to excel. I tried to use a recorder with standard data and it records what I want but the help file doesnt explain how to export it to excel (Or do I have to use user defined data to get it?)

I would be really thankful if you could have a closer look at it again!

Greets Patrick
Attached Thumbnails
Click image for larger version
Name:	queue6.JPG
Views:	385
Size:	37.8 KB
ID:	611   Click image for larger version
Name:	global table.JPG
Views:	330
Size:	30.6 KB
ID:	612  
  #5  
Old 03-23-2009
Jeff Nordgren's Avatar
Jeff Nordgren Jeff Nordgren is offline
Technical Support Manager
 
Join Date: Jul 2007
Location: Orem, UT
Posts: 65
Downloads: 79
Uploads: 0
Thanks: 40
Thanked 21 Times in 17 Posts
Rep Power: 233
Jeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really nice
Default

Patrick,

#1 - Deleted one set of queues so that you now only have one queue per item type. (I'm still not using a pull).
#2 - That global table does not include maximum contents. Only batch sizes and process times. But I changed my global table to match your anyway. Because it really doesn't matter.
#3 - Yes, you do have to use User Defined Data to get the data to be written to a table. I've included one Recorder for Queue4 in the attached model. If you look in the Properties window of the Recorder, you will see that I am recording every 10 seconds (Length of intervals). You can change the interval or uncheck the "Check values at set intervals" check box to have it record only when the data changes. On the Output tab of the Recorder is where you will see the data being written. When the model has finished, you can press the Export button (bottom left of screen on Output tab) to export that table data to Excel.
Attached Files
File Type: zip BatchProduction2.zip (114.9 KB, 335 views)
__________________
Jeff
Flexsim Support
  #6  
Old 03-23-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default

The conveyer is a great idea, makes visible, that it is a batch production

1st: thanks, now it looks the way i thought it might work, but running the simulation leads to growing stocks of item3. I am trying to understand the triggers and I think the problem the following:

if (ItemType != 3)
{
NextPort = ItemType + 1;
}
else
{
NextPort = 1;
}

If I get it right, the production of processor 2 is in the item order 1,2,3 (same as processor 1) but the production of processor2 should be according to the FIFO pinciple.(Items(in batch size) that are waiting the longest time should be produced first, this is why I thought of a pull control by the machine which takes the items with the longest waiting times). Actually I dont know how to solve this.

2nd: I thought this was the reason why the production stopped as the batch size was bigger that the maximum content. whatever...most important is that it works

3rd: I think thats what I need...thanks!

I am really sorry I am taking so much of your time, but I didnt expect this problem to be that difficult.

Thanks again for your help!
Attached Thumbnails
Click image for larger version
Name:	problem.JPG
Views:	297
Size:	134.8 KB
ID:	615  
  #7  
Old 03-24-2009
Jeff Nordgren's Avatar
Jeff Nordgren Jeff Nordgren is offline
Technical Support Manager
 
Join Date: Jul 2007
Location: Orem, UT
Posts: 65
Downloads: 79
Uploads: 0
Thanks: 40
Thanked 21 Times in 17 Posts
Rep Power: 233
Jeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really niceJeff Nordgren is just really nice
Default

Quote:
Originally Posted by Patrick Cap View Post
1st: thanks, now it looks the way i thought it might work, but running the simulation leads to growing stocks of item3.
Then that should tell you that the process time for itemtype3 may be too long.
Quote:
Originally Posted by Patrick Cap View Post
I am trying to understand the triggers and I think the problem the following:

if (ItemType != 3)
{
NextPort = ItemType + 1;
}
else
{
NextPort = 1;
}

If I get it right, the production of processor 2 is in the item order 1,2,3 (same as processor 1)
It is. It processes itemtype1, itemtype2 and then itemtype3 and then repeats itself. That is what the code above is doing. I am not using a pull from the processor. I am opening and closing the output ports of the three queues in the above order. The code above is checking to see where the flowitems should come from next. Or rather which input port of the processor (NextPort). So, if the itemtype of the current and last flowitem to leave the processor is not itemtype3, then I just add one to the current itemtype to get the next output port of the queue that should be opened. If it is itemtype3, then I start back over again at port 1. This should be simple stuff.

Quote:
Originally Posted by Patrick Cap View Post
but the production of processor2 should be according to the FIFO pinciple.(Items(in batch size) that are waiting the longest time should be produced first, this is why I thought of a pull control by the machine which takes the items with the longest waiting times). Actually I dont know how to solve this.
If your saying that the processor should choose which itemtype to pull next based on which itemtype is has been in its respective queue the longest, then that is a detail you left out and no it doesn't work that way. It works FIFO by itemtype. Of course it can be fixed again to do longest waiting. But may be beyond your current skills.

Quote:
Originally Posted by Patrick Cap View Post
2nd: I thought this was the reason why the production stopped as the batch size was bigger that the maximum content. whatever...most important is that it works
To change it to what you wanted to do, I changed all the maximum content amounts to 1000 in all the queues.
__________________
Jeff
Flexsim Support
The Following User Says Thank You to Jeff Nordgren For This Useful Post:
Patrick Cap (03-25-2009)
  #8  
Old 03-25-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default

i think all you did is beyond my current skills although I understand what you did I think I didnt make myself clear enough...

The three queues will be one storage area in reality. In my first model I introduced 3 queues to have the single data for each item(might be possible with one queue as well) and to collect the items until they build the new batchsize for processor 2 because I didnt know how the batch production in flexsim works. I emulated the batches with queues. When they reached the batchsize for processor 2, they could wait until processor2 had processed the batches that reached batchsize before this one and then it coul be processed.

The problem is, that I am observing the whole queue area, so I cannot release the batched items to another waiting queue as I did it in my first post because I would not get the data of the wohle storage area.

The model from my first posts acts the way I want, but i cannot collect the data I need because I have 3 stages of queues and in the last queue the items are mixed (See attached file Bild1.jpg from my first post). One possibility would be to make a blackbox somehow out of all queues and only monitor inflow before the first queue and outflow after the last queue of each item. Another possibility would be to collect the data of each queue (the one of the last queue would have to be seperated by item) and to combine them later to one.

I will summarize it: I need the content data of each item in the area between processor 1 and processor 2 while each item has a different batch size and a different process time on each machine. The production order of processor1 is 1,2,3, the order of processor2 is in the order the buffer can offer complete batches for processor2.

Maybe you can tell me what to do, as I think I took enough of your time so I will try it on my own. What do you think of the blackbox and the combine idea?
  #9  
Old 03-25-2009
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: 684
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

Patrick,

I haven't taken a look at your models, but just read through the posts.

To get data over multiple objects you can create the data by using the entry triggers on the first object and use the exit trigger on the last object and write the results in a global table. The triggers have several options to do that. In the onentry trigger for instance you can add a label to the item and fill it with the time. On exit you can calculate the staytime within your blackbox by doing time() - label. Then at the end you can export your table to Excel to do all kinds of other analysis.

Another option would be to use the Flexsim Chart program to generate the data. If you turn the full history on, all data is stored in a database and can easily be extracted from that database with Flexsim Chart. See the topic "Charting and Reporting" in the Flexsim user manual.

Steven
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Patrick Cap (03-25-2009)
  #10  
Old 03-26-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default

okay...

I tried to make up a model which I understand I think it doesnt make sense if I get a model from you and I dont understand. So I went on using queues to emulate the batch production.

I still have a problem with sending messages:

senddelayedmessage(obj object,0,current,1);

how do i get the term for "obj object"? I tried the name of it for example Queue12 but it doesnt work.

If this problem is solved I think the model will work as I expect.

Furthermore with my solution I still have to combine several queues. One main problem I see is that one queue contains several items while the other queues are dedicated to one item. In the help file I didnt find how to do it.

So what would you suggest? Go on with my solution or try to program the waitingtimes into your model(Your model is way better than mine, but how would it work there)?

Anyway your model helped a lot because I comprehended the triggers (been a while since I programmed).

Thanks again for your help
Attached Files
File Type: zip 20090306idee.zip (39.0 KB, 273 views)
  #11  
Old 03-26-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Patrick,

There are several ways to reference to objects (Global Variabel – treenode, by rank, by name, by ports, etc.)

What you are looking for, if you want to reference by name is the node() command. Please have a look into the command overview.

I guess the code you are looking for is:
senddelayedmessage(node("/Queue12",model()),0,current,1);

Keep in mind, that reference by name is slow compared with other concepts. If I am right, there have been some threads about this subject.
If you send messages very often, I would use a Global Variable as treenode or treenode array.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #12  
Old 03-26-2009
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: 684
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

Take also a look at "basic Modeling Functions and Logic Statements" in user manual, it gives a little bit more information about referencing.

Steven
  #13  
Old 03-27-2009
Patrick Cap Patrick Cap is offline
Flexsim User
 
Join Date: Mar 2009
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 136
Patrick Cap is on a distinguished road
Default

@tom: danke, genau das was ich brauchte
@steven: I tried to do it your way.

I did it your way with the onentry and onexit trigger, works quiet good...now I have to see how to work with this in excel...

For anyone finding this post by the search having the same problem I publish the triggers...

On Entry:

treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);

addtablerow("Staytimes");

settablenum("rowcounter",1,1,gettablenum("rowcount er",1,1)+1);

int row=gettablenum("rowcounter",1,1);

settablenum("Staytimes",row,2,time());

settablenum("Staytimes",row,1,getitemtype(item));

treenode newlabel = addlabel(item,"row",gettablenum("rowcounter",1,1)) ;


and on Exit

settablenum("Staytimes",getlabelnum(item,"row"),3, time());


Thanks a lot for your help!


Thread Thread Starter Forum Replies Last Post
Batch/Max Content Gavin Douglas Q&A 4 07-09-2008 12:28 AM
optimal size of a 3DS file David Chan Q&A 4 04-28-2008 08:05 AM
Is there any simple solution to support batch mean method in flexsim? qin tian Q&A 1 02-29-2008 01:19 PM
Start Flexsim and model from externally via a batch file Tom David Q&A 3 09-12-2007 03:17 PM
creating a batch trip task sequence Paul Dowling Q&A 5 09-11-2007 06:55 PM


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