The on-board LED -Pin 13- is reserved for the presentation of some basic behaviour of the MEGA and DUE board. In case of the ESP32,  pin GPIO13 can be attached to a LED to visualize the described behaviour. See also the table below. Keep in mind that the mentioned frequency for blinking, can be influenced by the use of e.g. the function delay() in the main loop. As earlier mentioned, delay() could be used for easier debugging the code, but the use of delay() in the main loop is not preferable. Use the available timer functions instead!

PinBehaviourStatus
13Blinking 500 mSNormal behaviour during run
13Blinking 500 mS with 20mS flashNormal behaviour during run and link with HMI[1]
13Blinking 2000 mS after restartFailure, check configuration of pins
13Blinking 1000 mSFailure, State name look-up failure, check main loop
13Blinking 50 mSFailure, Tagname look-up failure, check configuration
13Constant Off/OnProbable software problem (infinite loop)

When communication between the FSM and the HMI is enabled (UseHMISerial = true), the board sends a watchdog message to HMI every two seconds. If the HMI does not responds with a watchdog message within four seconds, a watchdog failure is detected by the board.
The boolean variable HMIWatchdog can be used within the sketch to monitor or indicate a watchdog failure. If the sketch does not process the HMIWatchdog variable, LED 13 (Behaviour) provides a visual indication of its status. Under normal operating conditions, LED 13 blinks with a period of 500 ms. When an active connection with the HMI is present, LED 13 additionally generates a short 20 ms pulse during its off-time to indicate successful communication with the HMI.

Variable HMIWatchDogMeaning
trueThere is an active link between FSM and the HMI
FalseThere is no link between the FSM and the HMI
Translate