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 |
#21
|
|||
|
|||
Hi, I have looked into the WPF and the 2 processors. In fact, your code was fine in releasing and having the flowitem fulled into the processor. However, at time 525 after the flowitem was pulled into the processor the flowitem was not hold by the processing time and end of processing was not fired. Subsequently, the flowitem went back to the WPF queue. Very strange!!!
Flexsim experts, any input on this??
__________________
Advent2 Labs David |
#22
|
|||
|
|||
David,
What you said describes part of that problem. In fact if you look closer, P105007.007 should have been batched together with P105007.005. But is not batched. Partly because of the label Batch flag I suppose. Chieng |
#23
|
|||
|
|||
Chieng,
I have further checked. The part 007 is called into WPF21 one after another. But the funny thing is that 007 was not forced to stay for the processing time and the processfinished trigger was not triggered. Therefore the process stage was not increased to the next and hence it is returned back to WPF. David
__________________
Advent2 Labs David |
#24
|
|||
|
|||
At 515 when the item entered WPF P105007.007 was given a return 0 in the SendTo. So this item was already released when you released it with releaseitem() in the WPF OnMessage at 525.
|
#25
|
|||
|
|||
You're right. So P105007.007 SHOULD be batched together with P105007.005. and they ARE batched together. but somehow, P105007.007 skipped proccess time and onProcessFinish trigger..
|
#26
|
|||
|
|||
Don't release an item more than once
Quote:
Make sure your code returns -1 in the SendToPort at time 515, then the problem will not occur because your OnMessage at 525 will release the item for the first and only time. Last edited by Kris Geisberger; 08-29-2011 at 10:17 PM. |
#27
|
|||
|
|||
How do you know there's a return 0 in sendTo at 515? The codes at WPF/onMessage says not to continue with the batching codes when "sendto" is not equal to 0. and at that time "sendto"!=0. There is already an existing batch P105009.006 and P105009.002, so P105007.007 shouldn't return 0 at 515.
|
#28
|
|||
|
|||
Quote:
return 0 tells Flexsim to release the item to the first available port, subject to any downstream PullRequirements. Even if the item cannot leave immediately, it is in a released state. At time 515 your "sendto" label is 2, so the code returns 0. I added some prints to the output console to your SendToPort code below. Code:
if(getlabelnum(current,"sendto")!=0) { pf(time());pt(" WPF SendToPort on item ");pt(getname(item));pr(); pt(" sendto label = ");pf(getlabelnum(current,"sendto"));pr(); if(comparetext(getname(item),"P105007.007")==1 && time()==515) { colorwhite(item); //return -1; //do not release item } return 0; //release to first available port } else return -1; //do not release item Quote:
pf(time());pt(" WPF Case1: release ");pt(getname(pilotitem));pt(" and ");pt(getname(item2));pr(); I'm not sure which of the 2 releases you want to avoid based on how you think your logic should work. But you should not release an item that is already released. Maybe getitemstate() might help you, look it up in the command help. fyi: next time don't name your label "sendto", because that's how many users refer to the SendToPort picklist code... it won't cause errors, just confusion when reading your posts. Last edited by Kris Geisberger; 08-29-2011 at 11:01 PM. |
The Following 2 Users Say Thank You to Kris Geisberger For This Useful Post: | ||
Jörg Vogel (08-30-2011) |
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 |