I've made a resume of the actual situation:
as you can see from the image, and the file attached, i've two problems i can't figured it out.
The most important ones is about the "vibratura" frame where the MUs who came from the previous station (CNC) just stay in buffer without going further.
After some try i have taught that maybe the problem is with event controller who is not working with the frame in question but it's just an idea.
The other question, less important, is about "graphics"; why the frame CNC opened from the class library is not displaying any MUs' movement and the one opened from the main frame (factory) shows everything?
And eventually, How can i show the movement of MUs to both?
Thank you in advance.
Solved! Go to Solution.
your problems are related.
As general rules, don't use the frame in class library as active simulation objects!
As you have correctly done, you have to create instances of the class objects. These instances must stay into your root frame.
The problem is in your method you use the command move sending the mu's in the class object rather then in the istances.
For instance, I pick the line 8 of the method "Materiale_in".
Your version --> ?.cont.move(.Phd_Lean.Factory.CNC.CNC_Buffer_IN_1)
Correct version --> ?.cont.move(CNC.CNC_Buffer_IN_1)
In this way you will send the mu in the frame CNC (instance) and not in the frame .Phd_Lean.Factory.CNC (class).
When you reset the model, the mu's stay in the class frames because they don't have an event controller. The event controller in the root frame controls the instances.
Actually looking from your picture, they are both the same issue and it is due to how you are expecting Plant Sim to work and how it actually works.
The event controller will control the frame it is in and objects within that frame, including other frames. For there to be any time then there must be an event controller. Due to how Plant Sim works then you can only have 1 event controller working at a time (to keep everything running in sync) so if you start another event controller then all others are paused automatically.
The classes in the class library can be seen as your masters, they are the template of what you want, when you insert them into a frame then you create a copy of them which will follow how the template works and if you have kept the inhertiance active then will also change when the version in the class library dose as well. Due to this, when you insert a frame into another frame then you create a copy and not create a link to it, so there is no way to get the MU's to move in both of them, as the frame in controll must have the event controller and this cannot be applied to the frame in the class library, only the sub frame copy of it.
This is why your 'vibratura' frame is not working, as it is sending the MU's to the class library copy and not the copy on the 'Factory' frame that has the event controller, so the class library copy has no time so nothing moves. To fix the issue you got to use the sub frame inside the 'Factory' frame, at which point then it can see the event controller and can run. Do not expect your templates to work in the class library, they are just templates.
Hope this explaination has made things more clear.
thanks for you help; now it's more clear why event controller it's not working.
I've made some corrections in the model addressing, like Alessio suggests, the instance "Vibratura"
instead of frame "Vibratura"
but it's not working; the method "Telai_legatura" that is pretty the same
it's perfectly working; maybe i had some problems on that particular frame?
i think i finally got it;
The instance is:
The frame (from the class library) instead is:
In fact my root is .Phd_Lean.Factory as you already noticed Alessio.
One last question; within the method it's better to write "root.Vibratura.Vibratura_Buffer_IN" or ".Phd_Lean.Factory.Vibratura.Vibratura_Buffer_IN"?
If you, for some reason, change the name of the root it will automatically update if you use the root command?
When you write the method in the class library for what you know will be a sub frame, then using root is better.
The reason for this, is you reuse it, so you make 2 instances of it inside different control frames, then root will always point to the correct location reguardless, so where possible try to use dynamic paths and not full paths to help to assist with any future editing that might occure.