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
|
|||
|
|||
reservoir stops releasing
hi,
i've got a reservoir that releases an item that doesn't show as an outputed item and and inputed item on the downstream combiner. it is not the first item out of this reservoir or included in the first cycle on the combiner so it has node reason to stop outputting. it just dissappears from the reservoir at the correct point in time though. the model was built in a previous version of flexsim but the parts of the model have been replaced with v4.52 parts (although the coding is still the same). any ideas
__________________
How much can I get any with and still go to heaven? |
#3
|
|||
|
|||
here is the model.
the model's problem is when the output of the reservoir "UNSS_Day_Bin" reaches 6293.
__________________
How much can I get any with and still go to heaven? |
#4
|
||||
|
||||
I had a look into your model. Yes, at output 6293 it stops with the output because the Output of the object (closeoutput()) is closed. I can tell because of the little red square next to the output port.
If I do an openoutput(node("/UNSS_Day_Bin",model())) in a Script window, it starts emtying again. So the object's output is closed. I tried to figure out, where this happens and the only code I found which could do it is in the trigger OnFallThroughLowMark. But because the Low Mark is defined 1000 this is strange. I changed the Low Mark to 100 just to test it and it stops now at different output (6428), so it looks like that here is the issue. I don't understand, what is going on, but here is the point to have a look.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
Alistair Smitheman (08-05-2009) |
#5
|
|||
|
|||
further digging
I've done some digging on this issue around the reservoir and have found what looks like a more serious problem with the reservoir program itself.
When the program runs it fills and waits, once it begins to release items it does so correctly until gets to 4772 items released. At this point the window for the reservoir shows that the content of the reservoir is 15228 but when the reservoir is opened up in the tree view it shows a content of 9990.83 which is incorrect (see screen dump). Can anyone offer any advice, as I have imported new reservoirs and copied the code over several times times and even re-installed flexsim.
__________________
How much can I get any with and still go to heaven? |
#6
|
||||
|
||||
Alistair,
I built a sample model with a source, reservoir, and sink. The source creates 20,000 flowitems at time zero and the reservoir has an incoming delay time of 0 so all 20,000 items enter the reservoir immediately. The outgoing delay time is 1. I have the same max content, high mark, middle mark, and low mark as you do in your model. I could not duplicate your problem. This would suggest to me that you have something else going on in your model that is causing this issue. In your model the actual content is correct. It is the curcontent variable that is getting off. It seems to be happening during the openoutputs event for the reservoir. However, it doesn't happen every time and seems to be somewhat random. I would like to be able to narrow it down further for you but I don't have the time to go through your model that detailed. I am wondering though, why have you set your model up so that you have to compile? Is it a speed issue? Right now my guess is that there is code somewhere else in the model being executed when the flowitem leaves the reservoir, but I couldn't find anything on the combiner or reservoir. Brandon
__________________
thats not normal. |
The Following User Says Thank You to Brandon Peterson For This Useful Post: | ||
Scott Mackay (10-08-2009) |
#7
|
||||
|
||||
Alistair,
Curiosity got the best of me and I looked into it further. In the library object of the Resource the on send has the following code: double contentamount= frgetvar(item, 1); I do not know what node (if any) this function is looking at and I can not find it. I did find the following code in the On Recieve of the library object: frsetvar(item, 1, v_unitsinitem); v_curcontent+=v_unitsinitem; Because the curcontent variable of the reservoir is correct at the end of the filling of the reservoir, this suggests that the value should be correct on the flow item. So, it seems to me that the problem is occuring sometime after entry to the reservoir but before exit. Another interesting point is that when the value gets corrupted it seems to be corrupted with the last move time of the flow item. Good Luck, Brandon
__________________
thats not normal. |
The Following User Says Thank You to Brandon Peterson For This Useful Post: | ||
Scott Mackay (10-08-2009) |
#8
|
|||
|
|||
I have now been through the coding and I have found some answers but also more questions. The reservoir in questionis only referenced in the model by it's outobject and in this case the reference is a check on contents. However, if the problem could lay in the library code would this not affect all the reservoirs in the model and not just this one?
An Addition: Going through the model, what ever occurs occurs at the event count of 3222562 as the reservoir in question releases 5.6 items instead of just 1.
__________________
How much can I get any with and still go to heaven? Last edited by Alistair Smitheman; 08-14-2009 at 06:41 AM. |
Thread | Thread Starter | Forum | Replies | Last Post |
Releasing to a Combiner | Alistair Smitheman | Q&A | 7 | 05-15-2009 04:04 AM |
Problem holding, releasing, duplicate and destroy flowitems dynamically | Sebastian Dransfeld | Q&A | 1 | 05-14-2008 09:08 AM |