|
Description With the scripts used here you can change the tag originally configured as data source of a trend during runtime.
Example
You have defined the "TagA" tag from the "TestArchive" process value archive as data source for the "Trend1" trend. Using the script now in runtime you can define the "TagB" tag as data source of the "Trend1" trend.
Instructions Proceed as follows to use a C script to assign a trend a different tag from the process value archive.
| No. |
Procedure |
| 1 |
Set the "TrendName" attribute, which corresponds to the name of the trend in the f(t) trend display, for the trend whose data source you wish to change.
Function: SetPropChar
Example: SetPropChar( "Trends", "Control_1", "TrendName", "Trend1" ); |
| 2 |
Set the "TrendTagName" attribute of the trend previously defined to the new tag required.
Function: SetPropChar
Example: SetPropChar("Trends","Control_1","TrendTagname", "TestArchive\\TagB"); |
| 3 |
Complete sample script:
SetPropChar( "Trends", "Control_1", "TrendName", "Trend1" );
SetPropChar("Trends","Control_1","TrendTagname", "TestArchive\\TagB"); |
Table 01
Proceed as follows to use a VB script to assign a trend a different tag from the process value archive.
| No. |
Procedure |
| 1 |
Create the "obj" object for the f(t) message display.
Dim obj
Set obj = ScreenItems("Control_1") |
| 2 |
Set the "TrendName" attribute, which corresponds to the name of the trend in the f(t) trend display, for the trend whose data source you wish to change.
obj.TrendName = "Trend1" |
| 3 |
Set the "TrendTagName" attribute of the trend previously defined to the new tag required.
obj.TrendTagName = "TestArchive\TagB" |
| 4 |
Complete sample script:
Dim obj
Set obj = ScreenItems("Control_1")
obj.TrendName = "Trend1"
obj.TrendTagName = "TestArchive\TagB" |
Table 02
Keywords
Change data source, Change trend tag
|