Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:01-mervis:variable-backup-hidden [2023/12/07 22:35]
avsetula
en:sw:01-mervis:variable-backup-hidden [2023/12/20 13:47] (current)
avsetula
Line 27: Line 27:
 ---- ----
  
-In many cases, it is not necessary to periodically ​store all variables. When it is necessary to back up values that the operator has set during the program run, such as time programs, specific settings, etc., it is useful to **back up variables by trigger variable (BOOL)**. In this case, the periodic saving of all variables can be disabled and they are saved only when a request occurs. ​+In many cases, it is not necessary to periodically ​save all variables. When it is necessary to back up values that the operator has set during the program run, such as time programs, specific settings, etc., it is useful to **back up variables by trigger variable (BOOL)**. In this case, the periodic saving of all variables can be disabled and they are saved only when a request occurs. ​
  
 When backing up by a trigger variable, it is very important to know the approximate number of writes per day/month and compare it with the number of writes of periodic saving. When developing a program, it is therefore necessary to compare whether it is more storage friendly to mark selected variables with the retain flag with more frequent backups, instead of frequent requests to backup all variables. When backing up by a trigger variable, it is very important to know the approximate number of writes per day/month and compare it with the number of writes of periodic saving. When developing a program, it is therefore necessary to compare whether it is more storage friendly to mark selected variables with the retain flag with more frequent backups, instead of frequent requests to backup all variables.
Line 110: Line 110:
 ==== Disabled variable backup ==== ==== Disabled variable backup ====
  
-Even basic modifications ​will reduce the total amount of data written, but if it does not affect the program, it is possible to disable the backup of variables.+Any increasing of the save interval ​will reduce the total amount of data written, but if it does not affect the program, it is possible to disable the backup of variables.
  
 ---- ----
Line 155: Line 155:
 The local variable button is connected to the CLK input of the R-TRIG block.The R_TRIG block at the rising edge at the CLK input sets the output Q to the state TRUE for the length of one program cycle.The BD13 block and the F_TRIG block are used to delay the signal by the set time (pushTime). After the set time has elapsed, the "​button"​ variable is set to FALSE using the "​SEL"​ block. The local variable button is connected to the CLK input of the R-TRIG block.The R_TRIG block at the rising edge at the CLK input sets the output Q to the state TRUE for the length of one program cycle.The BD13 block and the F_TRIG block are used to delay the signal by the set time (pushTime). After the set time has elapsed, the "​button"​ variable is set to FALSE using the "​SEL"​ block.
  
-** This block requires control ​from the HMI, the variable button is controlled directly ​** +**This block is controlled by its internal variable '​button',​ and its value can be changed only from the HMI!** 
 </​WRAP>​ </​WRAP>​
  
Line 184: Line 184:
 === Backup for multiple events === === Backup for multiple events ===
  
-The disadvantage of the previous solution is that if there is a need to monitor more than one value, or the value needs to be changed multiple times, the solution is no longer suitable and the logic needs to be extended.+If there is a need to monitor more than one value, or it is necessary to change ​the value more than once, the previous options are no longer suitable and the logic must be extended.
  
 Both of the above mentioned variants can be used simultaneously and their outputs can be connected to the inputs of the OR function. The output of the OR function is connected to the IN input of the backupTrigger block, which ensures that the backup is triggered after the set delay interval from the last pulse on the IN input has elapsed. If another pulse arrives at the IN input in the meantime, the interval is reset to the default delay value. Both of the above mentioned variants can be used simultaneously and their outputs can be connected to the inputs of the OR function. The output of the OR function is connected to the IN input of the backupTrigger block, which ensures that the backup is triggered after the set delay interval from the last pulse on the IN input has elapsed. If another pulse arrives at the IN input in the meantime, the interval is reset to the default delay value.
  
-The program with any number of pulseButton,​ changeChecker and other blocks is supplemented with OR function as pulse concentrators and the mentioned backupTrigger block:+The program with random ​number of pulseButton,​ changeChecker and other blocks is supplemented with OR function as pulse concentrators and the mentioned backupTrigger block:
  
 {{ :​en:​sw:​01-mervis:​variable-backup:​variable-backup_14-program-backupTrigger.png.png?​direct |}} {{ :​en:​sw:​01-mervis:​variable-backup:​variable-backup_14-program-backupTrigger.png.png?​direct |}}