.Pen1-8 Dotfields
- Last UpdatedApr 11, 2022
- 2 minute read
The .Pen1-8 dotfields assign a logged tag to a historical trend pen.
Category
Historical
Usage
HistTrendTag{.Pen1 | .Pen2 | .Pen3 | .Pen4 | .Pen5 | .Pen6 | .Pen7 | .Pen8};
Parameter
HistTrendTag
HistTrend tag assigned the name of the trend.
Remarks
You assign tags to trend pens using the .Pen1-8 dotfields with the following format:
HistTrend.PenX = Tag_Name.TagID
Where X is an integer 1 to 8.
It is recommended that you use the HTSetPenName() and HTGetPenName() functions if possible.
Note: Only local tags can be assigned to a .PenX dotfield. The provider.tag notation cannot
be used. The provider.tag can be used only with the HTSetPenName() function.
A good reference to use when learning how these dotfields work is a historical trend
wizard placed on the screen and broken apart.
Data Type
TagID (read/write).
Valid Values
This dotfield data type is type TagID. This means only the handle of a tag can be assigned to the .Pen1-8 dotfields. You cannot directly assign the name of a tag to the .Pen1-8 dotfields. You must associate the associated .TagID dotfield of a tag to a .Pen1-8 dotfield using the following syntax:
HistTrendTag.Pen1=LoggedTag.TagID;
In general, a TagID type tag can be equated only to another TagID tag. It cannot be used with any other tag type unless the .TagID dotfield extension is added to the other tag.
Although the .Pen1-8 dotfields are considered read/write, their values cannot be directly shown on the screen.
Examples
The following example assigns a new tag to the .Pen5 dotfield of the historical trend associated with the Hist Trend tag. You must append the .TagID dotfield to the name of the logged tag in order to assign it to .Pen5 dotfield.
HistTrendTag.Pen5=PumpPress.TagID;
Working from the previous example, you can show the name of the tag assigned to HistTrendTag.Pen5. Creating a legend that shows the tag assigned to each trend pen is useful information for an operator.
You cannot show the tag assigned to HistTrendTag.Pen5 in a Message Display link. The actual value of the .Pen5 dotfield is an integer that represents a memory location within WindowViewer, which is not useful for display purposes. You need to create a new TagID type tag called Pen05. Place the following statement underneath the statement from the previous example:
Pen05=HistTrendTag.Pen5;
In the first example, the PumpPress tag is assigned to pen 5 of HistTrendTag. In this example, Pen05 is assigned the value of Pen5 of the HistTrendTag, which is the TagID of the PumpPress tag.
The .Pen1-8 dotfields are pointers to the tags that are associated with pens selected to appear in a trend. The .Pen1-8 dotfields are of a special data type, namely .TagID. After you make the assignment, you can use the .Name dotfield of the TagID tag to show the name of the tag.