====== Master Watch Dog (MWD) ====== {{ :files:img_warning-line_b.png?nolink |}} {{ :en:hw:09_safety-instructions_pseudo-ISO-7010-attention.png?nolink |(!)}} **Important:** \\ In Firmware versions 6.26 and older any valid communication will start MWD and refresh the timeout on that section. From version 6.28 reading the configuration will not start the MWD on that section. Master Watchdog present on Unipi controllers and extensions modules has non-traditional specialized implementation. It is used for unwanted situations, where the program lost communication with inputs and outputs. This function ensures a safe configuration is set in case of emergency situations (unit failure, communication error or software issues) to prevent damage to controlled devices or any hazards to personnel. {{ :files:img_warning-line_b.png?nolink |}} {{ :en:hw:08_safety-instructions_pseudo-ISO-7010-info.png?nolink |(i)}} **Note:**\\ You can find the addresses of Modbus registers mentioned in this article in your device's [[en:files:products:00-start|Modbus map]]. ===== Description of Master Watchdog ===== Every [[en:hw:size-of-unipi-hidden|section]] in controller and every extension have an independent MWD. After section microprocessor start, the MWD will start (if enabled) after first read from inputs or write to outputs. From that moment the timer for watchdog is started and every time action is performed that timer is reset. If the timer reaches a time greater than predefined MWD timeout the microprocessor will reboot. After the section's microprocessor restarts, default configuration is used. MWD is controlled by two bits in registers: * **MWD Enable** - enables the MWD for all inputs and outputs on that section. The MWD will not start until the first command is executed. * **Section MWD Timeout** - the maximum time between commands before the MWD reboots the section's (extension's module) procesor to predefined default configuration. You can detect if the last start was due to MWD. The **MWD reset indication** coil will show value //1//, if the section or extension was rebooted by MWD. Keep in mind, that this coil must be set to //0// after reading, if you want to have valid indication of MWD reboot. {{ :files:img_warning-line_b.png?nolink |}} {{ :en:hw:09_safety-instructions_pseudo-ISO-7010-attention.png?nolink |(!)}} **Attention:** \\ For Neuron units: When restarting a section, the default configuration will be used even for serial bus. Keep that in mind if you are using it with MWD enabled. After a section restarts the serial bus need to be configured again. For Patron units: Serial bus configuration is saved to non-volatile memory, so after section restart the saved configuration is used. ===== Defining the default configuration ===== If you want to use MWD you need to consider how the outputs will be set, when the MWD reboots the section. You need to set the section's or extension module's outputs to the safe state and then enable coil **Save current configuration and use on startup**. Following will be saved to default configuration: * States of AO, DO and RO * PWM, PWM_prescale and PWM_Cycle * Debounce, DS_enable, DS_polarity and DS_toggle * UART config