Archiving is data storage, processing and saving on-site collection, monitoring and other data.
The schematic diagram is as follows
Case
Process flow
Build variables
Use internal variables to create floating-point number variables (number)
Variable archive
Timer setting
The timer used in this example is 2s. Here is a special note:
- The name of the timer should be as clear as possible, such as 2s, which means the cycle time of 2s
- Wincc provides a time reference, users can adjust the time factor and change the cycle time as needed, such as 2s cycle time: select the time reference as 1 second and the time factor as 2
Archive tag creation
- Select the variable, find the variable you want to archive in the variable table
- Select the acquisition cycle and archive cycle, this cycle is to choose the timer established in the first step
Screen configuration
Trend chart, table, input and output fields
When setting trend chart and table, remember to select the variable you archived at the data source.
script
Create a global script, the script trigger frequency is 1s, the
code is as follows
Dim number
number=HMIRuntime.Tags("number").Read
If number >=300 Then
number=100*Rnd
End If
HMIRuntime.Tags("number").Write number
If number < 300 Then
number=number+2
End If
HMIRuntime.Tags("number").Write number
effect
Tips
Before running, remember to check whether the variable logging system is checked in the computer startup item