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!

Pin

Behaviour

Status

13

Blinking 500 mS

Normal behaviour during run

13

Blinking 500 mS with 20mS flash

Normal behaviour during run and link with HMI[1]

13

Blinking 2000 mS after restart

Failure, check configuration of pins

13

Blinking 1000 mS

Failure, State name look-up failure, check main loop

13

Blinking 50 mS

Failure, Tagname look-up failure, check configuration

13

Constant Off/On

Probable software problem (infinite loop)

   

[1] When communication between the FSM and HMI is selected (UseHMISerial = true), the standard HMI is sending every 2 seconds a watchdog message to the board. When a watchdog message is not received by the board in 4 seconds, this is signalled as a watchdog failure. The boolean variable HMIWatchdog can be used by the sketch when the software has to monitor or signal a watchdog problem. When there is no need for processing the boolean HMIWatchdog, LED 13 (behaviour) is also visualizing the value of HMIWatchdog; when everything is properly working, LED 13 is blinking by a frequency of 500mS and when there is an active link with HMI there is a short blink of 20mS in the off time of LED 13.

 

Variable HMIWatchDog

true

There is an active link between FSM and the HMI

False

There is no link between the FSM and the HMI