read, change: Read and write parameters#
Correct handling of side-effects
To avoid difficult to debug race conditions, the following sequence of events should be followed whenever the ECS wants to initiate an action:
ECS sends the initiating message request (either
changeordo) and awaits the response.SEC node checks the request and if it can be performed. If not, SEC node sends an error-reply (sequence done). If nothing is actually to be done, continue to point 4.
If the action is fast-finishing, it should be performed and the sequence should continue to point 4. Otherwise the SEC node ‘sets’ the status code to
BUSYand instructs the hardware to execute the requested action. Also anupdatestatus event (with the new BUSY status-code) MUST be sent to ALL activated clients (if any). From now on, all read requests will also reveal a BUSY status-code. If additional parameters are influenced, their updated values should be communicated as well.SEC node sends the reply to the request of point 2 indicating the success or failure of the request.
Note
An error may be replied after the status was set to BUSY if triggering the intended action failed (communication problems?).
When the action is finally finished and the module no longer to be considered
BUSY, anupdatestatus event toIDLEMUST be sent, also subsequent status queries should reflect the now no longer BUSY state. Of course, all other parameters influenced by this should also communicate their new values.
An ECS establishing more than one connection to the same SEC node and which
may process the update event message from point 3 after the reply of
point 4 MUST query the status parameter synchronously to avoid the
race-condition of missing the (possible) BUSY status-code.
Temporal order should be kept wherever possible!