Reboot

hi! In my c++ program in some conditions i need to perform a reboot in order to update some settings. using: sync(); setuid(0); reboot(RB_AUTOBOOT); causes the firmware to trigger the hardware watchdog: this is discussed in: https://www.plcnext-community.net/en/discussions-2-offcanvas/how-to-reset-plcnext-device-on-admin-user-using-a-c-program.html#reply-4773 Disabling the hardware watchdog was my next move xml file: uploading the file in /opt/plcnext/appshome/ will result in the firmware to fail. no acces to the plc is possible, not using plcnext engineer nor accessing the wbm webpage current fw 2021.6 is something wrong in the xml file? is there a better way to perform a reboot from a c++ program? kind regards nick

Hi Nick, You can’t use the technique described in that old blog post with FW 2021.6. Instead, a new feature has been added to Web Based Management, that allows selected components to be disabled: https://www.plcnext.help/te/WBM/Configuration_System_Services.htm Unfortunately the system watchdog doesn’t appear in that list. I will need to check the current way (if any) to disable the system watchdog with FW 2021.6. .

hi martin, I would be more interested in a way to reboot without having to disable the system watchdog. Is there a way to reboot the system from c++ not having to disable the watchdog? if not than i’ll wait for a way to disable it. kind regards nick

Hi Nick, you can take a look here to the Restart function : https://api.plcnext.help/api_docs_2021-6/classArp_1_1Device_1_1Interface_1_1Services_1_1IDeviceControlService.html#af84e52fe0b027cc5c567c9d0fb6e64f9 More information on RSC can be found here: https://www.plcnext.help/te/Service_Components/Remote_Service_Calls_RSC/RSC_Remote_Service_Calls.htm Have nice weekend

That’s a great suggestion from Davide. If your C++ application can access RSC services, then this would probably be the best way to restart the device.