I will send you the beta via mail download link.
At the end it was easier as expected and we had an error in the signal override stuff what caused some problems.
At the end now it should work like you expected at the beginning. You can register to Signal change events by:
var com = GetComponent<PLCInputBool>();
com.SignalChanged += SignalChangedRuntime;
public void SignalChangedRuntime(Signal signal)
Debug.Log("Signal Changed Runtime " + signal.ToString());
Or you can use as an alternative UnityEvents in the Inspector:
You can see how it can be used in the Script TestSignalChanged attached to CanConveyorSensor in the Demo model.
The signal changed events should now be also emitted if you use Simit as an Interface.
Please check if everything works if expected. We are going to release this officially next week.
... and please give Game4Automation a positive feedback in the Asset Store Reviews - this is really helpfull!
Simit would need to be in this case the OPCUA server. Game4Automation is only able to be the client. Are you using Simit for modelling the logic or is it more acting only as an interface. If it is just an interface you could connect to the OPCUA server in the PLC directly from Game4Automation.
Please send me your Game4Automation Invoice number (i would need this to check your license).
You will get the Beta this afternoon.
And yes - this solution works for all Signals - independent from the Interface type.
I think I found a flexible way. We could implement Unity Events on the Signals.
This seems to be a very flexible and transparent way for the user:
Could you please check this if this fits your needs. If everything works for your side we would release. I will send you a beta version today or on Monday. Does that fits for you?
1000 - 20.000 is a lot. I am expecting more the Interface itself to be a bottleneck. By design - because of the SHM interface - Unity needs to loop through all the variables each cycle and to update them. In relation to that, I think that the mentioned update method is not costing much additional resources. For providing the change event I would need to implement a setter for the Structs StatusBool, StatusInt.... And this setter will be called each cycle (because of the necessity to loop through all SHM Variables) and will do more or less the same as the proposed update method. So I don't see so far a big advantage in implementing this.
Are the variables changing very fast in your application? Did you consider using OPCUA because there the variables are watchable and you can implement an event which is called when they are updated. Or is it necessary to use Simit?
I checked. The PLCOutPutBoolChanged Events should not be used. They are very limited and they only work if PLCOutPutBool.Value is changed via script. Most probably we are going to remove these events in the next release for preventing misunderstandings.
I assume that you might want to detect if the value is changed and then start something which consumes some computing time. In this case I would recommend to detect in the behaviour model script update method (in your case the script Verkeerslicht3) if the value of the Signal is changed. If it is changed you can call your computing time consuming method - in your case I assume it is a network communication which will be started.
Hope that helps - best regards
Hi, I tried to reproduced the problem but in my test the Signal Changed event worked as expected. Can you please send us with a private message a model where it is not working.
Customer support service by UserEcho