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

  #21  
Old 08-27-2011
David Chan David Chan is offline
Flexsim Distributor
 
Join Date: Sep 2007
Posts: 326
Downloads: 74
Uploads: 0
Thanks: 217
Thanked 73 Times in 44 Posts
Rep Power: 218
David Chan has a spectacular aura aboutDavid Chan has a spectacular aura aboutDavid Chan has a spectacular aura about
Default

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  
Old 08-27-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: 109
Chieng Kai Seng is on a distinguished road
Default

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  
Old 08-28-2011
David Chan David Chan is offline
Flexsim Distributor
 
Join Date: Sep 2007
Posts: 326
Downloads: 74
Uploads: 0
Thanks: 217
Thanked 73 Times in 44 Posts
Rep Power: 218
David Chan has a spectacular aura aboutDavid Chan has a spectacular aura aboutDavid Chan has a spectacular aura about
Default

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  
Old 08-28-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: 451
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

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  
Old 08-29-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: 109
Chieng Kai Seng is on a distinguished road
Default

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  
Old 08-29-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: 451
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 Don't release an item more than once

Quote:
but somehow, P105007.007 skipped proccess time and onProcessFinish trigger..
...because you released it a second time. The item was allowed to enter WPF21 at 525 because it was in a released state, given by the return 0 in the SendToPort code at 515. Then your OnMessage code released it again while it was already in WPF21, thus causing the strange behavior.

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  
Old 08-29-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: 109
Chieng Kai Seng is on a distinguished road
Default

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  
Old 08-29-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: 451
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

Quote:
There is already an existing batch P105009.006 and P105009.002, so P105007.007 shouldn't return 0 at 515.
Your WPF/SendToPort code says return 0 when the "sendto" label is not equal to 0.
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:
The codes at WPF/onMessage says not to continue with the batching codes when "sendto" is not equal to 0.
At time 525 your "sendto" label is 0, and P105007.007 is released as item2 in your code using releaseitem(). I added the following code at line 28 of WPF/OnMessage to print to the output console:
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


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.