I have a little problem
I have a parallel process (OP_70), and I've created two observers for verify its state, as you can see in the programming, every three parts in buffer BF5, the sensor activates and move them to OP_70, but, if the number of Mu's is less than Capacity_OP70, BF5 don't move the parts, this happens when almost the totality of my production has finished and two parts stay there. I have attached an image
I hope you can help me...
when you say "observers", it might be good to tell us what attribute on which object they are observing, since you didn't upload the model. Also, there is no "sensor" in your model, because you have only place-oriented objects (there are "sensors" in Plant Simulation as well, but they are something else).
Regarding your problem, of course there will remain some parts on BF5 if your production quantity is no integer-multiple of 3. If you only have 1 MU-class, you may use getNo to get the MU-ID and compare it to the total-production quantity, which must be stored in e.g. a global variable-object, say v_totalNumMUs.
Then you could use something like
if (BF5.numMU = Capacity_OP70 OR BF5.cont.getNo >= v_totalNumMUs - (v_totalNumMUs mod Capacity_OP70) + 1) and ...
in your method.
Let me know if it helps, Alex
Thanks for your reply
Sorry I forgot to tell you some details, I was wrong when I said that I have added two observers, I created one more, numMU in BF5, an empty and operational state in OP_70. I attached a little model with a similar arrangement I'm working. I have a similar problem in a couple of stations, but I think if I can solve this problem, maybe is possible apply the same approach to other stations.
Before asking for help my idea was as you say, create a global variable with the total number of Mu's of a specific type and then compare it with the "StatNumIn" of BF5 when was equal move the parts to OP_70. I have four type Mu's if I use a table with a sequence the problem partially disappear because next parts make the programmed cycle works.
I have a professional license so I cannot open your model. But I expect that basically your problem will still remain, unless you use "Sequence Cyclical" in your source, because then you (probably) have an infinite amount of MU's and there won't be any "leftover" MU's.
Another frequent option would be a timeout:
(BF5.numMU >= CapacityX OR EventController.SimTime - BF5.myLastMU >= 300)
With such an approach, there will never be MU's that get stuck permanently.
Thank you so much for your reply, don't worry about the model...
I use a sequence of parts in the source but not cyclical, so I have a defined number of Mu's, and I already have a solution for the problem, I use the StatNumIn attribute of the buffer to compare the number of parts to have entered with respect to plan production.
Anyway I appreciate your help and your comments, with your reply I have learned another way to solve a problem
One note: if you use the statistics-reset after a warmup phase, StatNumIn will be reset, too, and no longer match the total production quantity. But since you are probably not using this feature, your approach should be safe.