Startup state-machine

Following steps are taken to complete the communication and download the last recipe data to the PLC variables on the machine startup:

  1. On the startup the PLC does not have any recipe data because the HMI may start a session later. The PLC will set the DataRequestPLC flag to TRUE and the DataValidPlc flag to FALSE.
  2. The HMI client will read DataRequestPLC variable on initialization and set DataRequestPLCActiveHmi to TRUE to indicate it has received the request.
  3. The recipe that is saved as the active temporary recipe will be activated from the HMI and will set the values to all the related PLC variables.
  4. The HMI client will write FALSE to DataRequestPLCActiveHmi and TRUE to DataRequestPLCQuitHMI to indicate the complete activation.
  5. The PLC will remove the request by resetting DataRequestPlc to FALSE.