Retentive Variables and Statistical Data

You can use retentive variables when the project must store the variables' value after the project has been closed or the hardware platform turned off. The retentive variables can be specified for either the 'Shared' areas (Flag, Output, Input) or for those 'NOT shared'. To use the retentive variables you have to set their modes and quantities through the "Real Time DB Retentive Data Settings" for variables of 'shared' areas, and through the "Retentive not Shared" property (paragraph: "Variable General Properties") for variables of 'NON Shared' areas.

 

Any variables of the 'Shared' area declared retentive will start from the starting address to the ending address specified. It is also necessary to always check the congruency between the retentive variable area and the size of the established area. For instance, let's say 100 Outputs bytes are going to be used this means using the area from 0 to 99! The system will give warnings of any incongruities.

 

The retentive variable files not only keep current variable values saved they can also contain a series of statistical data about the variables. This statistical data  only gets saved when the variable's "Enable Statistic Data" property is enabled.

 

"NOT Shared" Retentivity  Area

Movicon will create a file in XML format for each variable defined as retentive belonging to the "NOT shared" area within which the value of the current variable will be saved. These files, which are found in the project's 'DATA' folder, will be named in the following way:

 

NameProject_NameVariable.var

 

for example the "VAR0001"  variable of the  "Project1" project will be in a retentivity file called:

 

Project1_VAR0001.var

 

"Shared" Retentivity  Area

However, variables belonging to the "Shared" area need their retentivity settings defined through the "Real Time DB Retentive Data Settings". In this case one retentivity file will be created for each area, Input, Output and Flag, within the "DATA" folder. These files will have the following names:

 

ProjectName.FLG: retentivity file for variables in the "Flag" area

ProjectName.FBK: Backup retentivity file  for variables in the "Flag" area

ProjectName.IN: retentivity file for variables in the "Input" area

ProjectName.IBK: Backup retentivity file  for variables in the "Input" area

ProjectName.OUT: retentivity file for variables in the "Output" area

ProjectName.OBK: Backup retentivity file  for variables in the "Output" area

 

 

Retentivity File and Statistical Data

The last value obtained by the variable and other statistical data, if enabled, are saved in the retentivity file of each variable. The information  available is:

 

Current Data

 

 

Statistical Data

 

 

The five Statistical Data items described above are calculated starting from the first project run and are zeroed only when the variable's "Reset Statistic" command is used.

 

Daily Statistical Data

 

 

The five Statistical Data items described above are calculated on a daily basis. This means that they will be automatically zeroed at midnight (passing over from the current day at 23:59:59 to 00:00:00 of the next day). The same zeroing will take place if the current day of the  project startup is different from when the project was last stopped.

 

Weekly Statistical Data

 

 

The five Statistical Data items described above are calculated on a weekly basis. This means that they will be automatically zeroed at midnight before the new week begins (passing over from Sunday at 23:59:59 to 00:00:00 of Monday). The same zeroing will take place if the current week of the  project startup is different from when the project was last stopped.

 

Monthly Statistical Data

 

 

The five Statistical Data items described above are calculated on a monthly basis. This means that they will be automatically zeroed at midnight before the new month begins (passing over from the last day of the month at 23:59:59 to 00:00:00 of the first day of the next month). The same zeroing will take place if the current month of the  project startup is different from when the project was last stopped.

 

Yearly Statistical Data

 

 

The five Statistical Data items described above are calculated on a yearly basis. This means that they will be automatically zeroed at midnight before the new year begins (passing over from the last day of the year at 23:59:59 to  00:00:00 of the first day of the next year). The same zeroing will take place if the current year of the project startup is different from when the project was last stopped.

 

 

Structure Variable Data Statistics

When the data statistics management is enabled in a structure variable, the statistics will be managed for each single member and data will always get saved in the variable's retentive file but in compressed format (and therefore unreadable with other text editors).  This solution has been adopted so that data can be exchanged in Networking without influencing performances that may be effected by structure variables containing a lot of members, where the main data bulk to be exchanged is usually quite extensive.

 

 

Array Variable Data Statistics

Data statistics is not support for Array variables, whether as a whole or for each of its single components.

 

 

See Also