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-05-2008
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 171
KelvinHo will become famous soon enough
Default can "do not release item" commend be used in source?

Hi all,

Can "do not release item" commend be used in source?

In the attached file

source 1 "send to port" is "don not release item"

"on entry" to sink 5 will trigger send msg to source 1 "releaseitem()"

but nth would run out from source 1, is it coz when source 1 receive msg then "releaseitem()", there is no item in source 1 so nth would come out??

If yes then "do not release item" commend seems can't be used in source.

Regards,
Kelvin
Attached Files
File Type: zip releaseitem.zip (41.6 KB, 389 views)
  #2  
Old 03-05-2008
Regan Blackett Regan Blackett is offline
Flexsim Consultant, Forum Moderator
 
Join Date: Jul 2007
Posts: 14
Downloads: 19
Uploads: 16
Thanks: 0
Thanked 14 Times in 6 Posts
Rep Power: 183
Regan Blackett will become famous soon enoughRegan Blackett will become famous soon enough
Default

Hi Kelvin a couple of things about your model. First of all, because of the inter-arrival times you chose for the two sources, sometimes an item will go to Sink5 when there is no item in Source1 to to be released. In those instances you would correctly see nothing happen because Source1 has yet to create it's flowitem. This will skew your inter-arrival times, if that is important to you.

Secondly, in your OnMessage trigger for Source1 you have the command releaseitem() with no parameters passed. The releaseitem() command needs to know what item to release such as releaseitem(item);. Also, note that calling release item causes Send To Port to fire. So in calling releaseitem() the Send to Port field is still being evaluated at -1, which means don't release. The releaseitem() command does allow you to specify a port as the second parameter to get around using the port specified in Send To Port.

The OnMessage trigger doesn't have its own reference to the keyword item, like some of the other triggers do. We'll have to make our own. Using the rank command we can quickly get a reference to the item inside the source waiting to be released. If you modify Source1's OnMessage trigger to look like the following, it'll work.

Code:
treenode current = ownerobject(c);
treenode item = rank(current, 1); // get a reference to the waiting item
if(objectexists(item)) // only release the item if the object exists
{
    releaseitem(item, 1); // release the item through a specific port
}
That works fine because the source only creates one item at a time when using an inter-arrival time. If your model were using an inter-arrival schedule, which *can* creates several items at once, you'd have to change it so that all the items got release not just the first one.
  #3  
Old 03-10-2008
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 171
KelvinHo will become famous soon enough
Default

Thanks for your detailed explanation, my problem soloved.

Previously I misunderstood the command "releaseitem".


Thread Thread Starter Forum Replies Last Post
Can I set inport 1 of a combiner is "pull" while inport 2 is push? KelvinHo Q&A 3 03-05-2008 01:55 AM
"Getting Started" and "Tutorial" models for v4.01 Cliff King Product Announcements 0 12-10-2007 07:34 PM
Fluid "Pallet" Flowitems Maurits Brandt Q&A 4 11-12-2007 12:37 PM
Canceling "Set Object Reset Position" AlanZhang Q&A 8 10-15-2007 12:04 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.