1-second UPS (CX72x0)
Loss of data Only use TwinCAT to control the 1-second UPS and save only persistent data with a maximum size of 1 MB. Any other use may result in data loss or data corruption. |
The 1-second UPS is an UltraCap capacitor that continues to supply the processor with power in the event of a power failure. During this period persistent data can be saved, which are available on switching on again.
Since the 1-second UPS is designed for the entire service life, the holding time is considerably longer with new devices. The capacitors age over the course of time and the holding time decreases. Therefore a maximum of 1 MB persistent data can be reliably saved over the entire service life. Do not save any other data and do not use any other applications to control the 1-second UPS.
Please note that the 1-second UPS does not supply power to the K-bus or the E-bus and that their data may already be invalid when the 1-second UPS is activated. Also, the fieldbus system (or Ethernet) may not work or not work properly once the 1-second UPS was activated.
Configuration of the 1-second UPS
- Declare important data such as counter values in the PLC as VAR PERSISTENT. Then call the function block FB_S_UPS_BAPI cyclically in TwinCAT in order to control the 1-second UPS (see: FB_S_UPS_BAPI).
- Select the mode in the function block in order to specify what should happen in the case of a power failure. Specify, for example, whether persistent data are saved and a quick shutdown is executed (see: Data types).
Sample project:
ups_example.pro.
Saving and loading persistent data
The persistent data are saved in the Port_85x.bootdata file on the memory card. On starting the PLC the Port_85x.bootdata file is loaded from the memory card, backed up there as Port_85x.bootdata_old (backup) and then deleted.
Another current Port_85x.bootdata file is not written until the system is shut down or the 1-second UPS is activated.
If no Port_85x.bootdata file exists when starting the embedded PC, the persistent data are invalid and will be deleted (standard setting). The reason for this is that the 1-second UPS was activated before the TwinCAT PLC was started during startup of the embedded PC. In this case no persistent data were saved, since the system was unable to ensure sufficient buffer time for saving the data.
Always call the function block from the PLC and always use the fastest task to do so. In the case of a power failure Beckhoff recommends not calling the rest of the application in order to ensure that sufficient time remains for writing the data.
IF NOT FB_S_UPS_BAPI.bPowerFailDetect THEN
;//Call programs and function blocks
END_IF
The rest of the application influences the CPU load and the CPU load in turn affects the period during which the persistent data are written.
Loading a backup of the persistent data
It is also possible in TwinCAT 3 to specify on the left in the tree view under PLC whether the backup file is to be used or not. The backup file is used by default:
The backup files will be deleted if the option Clear Invalid Persistent Data is activated.