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 |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 } |
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 |