I tried stress testing my plc (by tuning the power off and on several times) and sometimes when turning back on the plc freezes (BF-D, Run,D lights stay on) then i cant ping to the plc and the lights of ethernet port do not blink. After setting the power off and on again or putting the ethernet port in and out the plc opperates back as usual and my program is up and running again.
Im using 1 mqtt client (iiot library) and several modbus clients
Does anyone know how to solve this?
Thanks in advance
Your observation can probably be explained by the behaviour of the boot loader on the PLC. If the operating system does not successfully boot - for example, if the power is cut to the device before the OS has completely started up - then this is counted as a failed boot attempt. After three failed boot attempts, the boot loader attempts to load the operating system from a second boot partition. If that boot partition contains an earlier firmware version, then it is likely that any PLCnext Engineer project on the device will not be executed correctly (since there is no guarantee that a PLCnext Engineer project developed for a specific firmware version will run on an earlier firmware version). That may explain the “freeze” condition that you describe.
The situation described above can be avoided by making sure the same firmware version is on both boot partitions. This is described in the [url="https://www.plcnext.help/te/Operating_System/Overlay_file_system.htm"]PLCnext Info Center[/url]:
[quote][b]Note[/b]: If the boot process failed several consecutive times, the inactive and the active boot partition will change their roles, too. This behavior has been implemented to keep the PLCnext Control device accessible even if the firmware update fails. The behavior can also occur when the boot process is interrupted e.g. by power loss. In this case you will observe that the controller boots with its previously installed firmware version.
[b]To prevent such unintended firmware downgrades, Phoenix Contact recommends that after a successful firmware update, the same firmware should be installed once again.[/b] This way both the active and the inactive boot partition contain the same firmware version.[/quote]
If you expect the power supply to switch frequently or otherwise be unreliable, you should include an uninterruptible power supply (UPS) in your system.