Wincc variable data archive (case)

Archiving is data storage, processing and saving on-site collection, monitoring and other data.

The schematic diagram is as follows

AS
DM
归档系统
DB

Case

Process flowInsert picture description here

Build variables

Use internal variables to create floating-point number variables (number)
Insert picture description here

Variable archive

Timer setting

The timer used in this example is 2s. Here is a special note:

  1. The name of the timer should be as clear as possible, such as 2s, which means the cycle time of 2s
  2. 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

Insert picture description here

Archive tag creation

  1. Select the variable, find the variable you want to archive in the variable table
  2. Select the acquisition cycle and archive cycle, this cycle is to choose the timer established in the first step
    Insert picture description here

Screen configuration

Trend chart, table, input and output fields
Insert picture description hereWhen setting trend chart and table, remember to select the variable you archived at the data source.
Insert picture description hereInsert picture description here

script

Create a global script, the script trigger frequency is 1s, the
Insert picture description here
Insert picture description here
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

Insert picture description here

Tips

Before running, remember to check whether the variable logging system is checked in the computer startup item
Insert picture description here

Guess you like

Origin blog.csdn.net/yue008/article/details/104569458