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
|
|||
|
|||
Measure value added time
Hi,
I would like to measure the value added time of a FlowItem (usually process times of processors or multiprocessors). In order to do so, I would like to put the time in a label when the process starts and when it ends. As far as I know, there is no trigger when the process starts. Let's assume an unfavorable case: There is a setup, and an operator is required to do the process, so there can be a delay between SetupFinish and when the process starts. Is there a simple way to mark the time when the process starts? A (as far as I know) "non recommended" solution to know the value added time is to put the process time in a label at the moment it is generated (Process Time code of a processor). Thanks! |
#2
|
||||
|
||||
Hi Stefan,
when a flowitem enters a fixed resource the process or setup starts. With >>getentrytime(item)<< you get this time. probably to simple Jörg |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Stefan Trabut (04-13-2011) |
#3
|
|||
|
|||
Hi Jörg,
Thanks for your answer. The problem is that setup takes time, too, and as soon as the setup is done (OnSetup trigger), the operator has to come to the processor to start the process - this takes also time. |
#4
|
|||
|
|||
If I understand correctly, you wish to store the cumulative value added time in a label on each flowitem. I'm assuming you have used some statistical distributions for process times otherwise the answer would be static for each part type... unless I guess they are routed to multiple machines that perform the same oepration and yet have different cycle times.
I suggest to create 2 labels on the flowitem: 1. TotalValueAddedTime 2. CurrentProcessTime The CurrentProcessTime label is for temporary storing of the current setup time or process time that the item is about to undergo. This approach is easier than recording time stamps... because as you said, the operator could be late, then maybe the processor breaks in the middle of the process, .etc. In the Setup Time and Process Time evaluations you can easily obtain the future duration of the activity before it is returned to Flexsim. This is where I would set the CurrentProcessTime label. Then, in the OnSetupFinish and OnProcessFinish I would get the value and increment the TotalValueAddedTime by its amount. Note: if your process time is a distribution, make sure you store it in a double variable, then use the double to set the CurrentProcessTime label and as the return value. (don't roll the dice twice) |
The Following User Says Thank You to Kris Geisberger For This Useful Post: | ||
Stefan Trabut (04-13-2011) |
#5
|
||||
|
||||
maybe an answer for those who are wondering if it possible to get the timestamp of the actual start. Yes it is possible by creating your tasksequence for the operator and let him send a message just before it starts the processor again.
|
#6
|
|||
|
|||
You can run this script in the script window to set it up for the entire model including conveyors and task executers. Change the first line's labelname to be the one you want (it gets created for you if it doesn't exist), and if you're managing the state yourself, then set any objects that are holding flowitems to STATE_PROCESSING when you want them to add value (using setstate() ). This doesn't look at nested flowitems as it is, or consider other states as value-added. It assumes you're not already using the OnStateChange nodes as it overwrites them if they already exist. It also relies on the state changing in order to register the time, so if your item leaves while the object is still in STATE_PROCESSING it will not register. Many of the default Flexsim objects should work as they are. For example the Processor enters state blocked at the process finished stage, so even if another item is ready to enter and all the Processor's time is allocated to processing, it will still register the value on the item.
Code:
string labelname="valueadded"; forobjecttreeunder(model()){ if (not(objectexists(OnStateChange(a))) && objectexists(eventfunctions(a))){ nodeinsertinto(eventfunctions(a)); treenode newnode=last(eventfunctions(a)); setname(newnode,"OnStateChange"); nodeadddata(newnode,DATATYPE_STRING); switch_flexscript(newnode,1); } if (objectexists(OnStateChange(a))){ sets(OnStateChange(a),concat("string labelname=\"",labelname,"\";if (getstatenum(c)==STATE_PROCESSING){\ntreenode item=first(c);\ntreenode itemlabel=NULL;\nwhile (objectexists(item)){\n itemlabel=label(item,labelname);\n if (not(objectexists(itemlabel))){\n addlabel(item,labelname,0);\n itemlabel=last(labels(item));\n } inc(label(item,labelname),time()-get(state_since(c)));\n item=next(item);\n }\n}")); } } buildall(); Last edited by Jason Lightfoot; 04-22-2011 at 11:04 AM. |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Stefan Trabut (04-14-2011) |
#7
|
||||
|
||||
Hi Stefan,
I´m not sure if it is the same hint as Kris gave, but I think the easiest way would be to get the Exittime and subtract the processtime. ;-)
__________________
Hemmi |
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 |
Inter Arrival Time by Time of Day Mod | Brandon Peterson | Tips and Tricks | 0 | 04-23-2008 11:13 AM |
Can transparent effect be added in the object? | KelvinHo | Q&A | 3 | 03-18-2008 10:12 PM |