Normally the signal lamp of a machine will change its color automatically once it is working, or were you thinking about something different here like a specific message being shown?
@IgorKunjavskij Say for eg: MES sends a signal to activate one station. Then an alarm should display on that station to show the activation while simulating.
And my other query is, say there are two parts. One part is good(acceptable) and the other part is bad(unacceptable).
So when the good part comes to a station, a green light should display. And when teh bad part comes to the station, red light should display.
It would be great if you could help me out with this.
you can use e.g. a singleproc for creating a signal object
create some icons (red, green) and a user defined attribute (e.g. active, boolean). Then add an observer to this object (attibute active). if active is true --> change to icon green elso to red:
if self.~.active then
you should also include an init method into this object to set active to a startValue
At the end you can set your signal to active and the color will change automatically
freelance simulation specialist
attached is a model with an implementation of what you described. Would a setup like this work for your application?
I saw alot of codes in example models which contain "self.~" how you used in the example. I was wondering, if it is better to use "?" to acces the object directly. Is ther any difference between these two variables?
'?' stands for the caller of a method. If you have an exit control the caller of the method will be the object where a part wants to exit.
'self.~' is usually used if you have a method which is a custom attribute. 'self' is the method and '~' goes to the location. This way you reference the object where the custom attribute method is located.
Now if the exit control is a custom attribute method both of them are referring indeed to the same object.
In this case '?' is also slightly faster and therefore to prefer.
But in principal you could also call the exit control from another method. In this case the caller would be the other method.
@SS3 if you want to reset the color during the simulation, you can just insert this code
.Models.MES._3D.setGraphicMaterial(makeArray(1), 10789024, 2697513, 0, 0, 0, 0.199999996996301, "deco");
into the entrance control of the drain or the exit control of the station or any other station/method that could trigger this code after the light has shown the green/red color.