10-16-2018 01:13 AM
Thank you for your patience, and your great advices, Paul. Coming back soon....
Francesco
10-18-2018 10:34 AM - edited 10-18-2018 10:36 AM
Hi Paul,
I'm here with another question. Often I build application with a safety loop that monitor the states of a safety inputs connected to an emergency button, if the user press the button all the relè, power supply and any other dangerous device stop working.
Can I build this in the actor model? I was thinking of an "Emergency Actor", launched by Root Actor, that monitor the input for a fault; if its occur it send back to the Root Actor the Error Message that the Root Actor send to its direct childs and this, on cascading, to their respective childs until the message hits the Device Actors involved.
Could this be a solution?
10-18-2018 03:52 PM
(If this is a safety E-Stop I hope there is a hardware circuit in place that is being interrupted and you arent relying on software for safety!)
But to answer the question, sure - although you are starting to get more into 'real' application design, where spending some time really thinking about how you want your actors to interact should start to come into play, and there are tons of different ways to approach it. If I was going to design an application like this, I would probably have a central controller, that handles interaction between actors - if it received an emergency stop message, rather than forwarding that message, I would just have it send a 'normal' device stop to the actor, rather than forwarding the message, so that the device actors do not need to be coupled in any way to the various emergency states of the system.
10-19-2018 01:07 AM
(Of course, these are redoundant actions on emergency press, we always have a certified security PLC that handle the security system. Still the software must standby if the button is pressed.)
So you will dinamically call and stopped the Actors involved when the test start and finish. Am i right?
10-19-2018 01:46 PM
You can - I meant more like sending a message to the actor to tell it to go into an idle/stopped mode, rather than stopping the actor completely. Generally I launch and keep most of my actors running through the lifetime of the application, but many others do not, and instead do what you said where actors are starting and stopping throughout the application.