HTSetPenName() Function
- Last UpdatedFeb 22, 2017
- 1 minute read
The HTSetPenName() function assigns a different tag to a trend's pen.
Category
Historical
Syntax
HTSetPenName(Hist_Tag,PenNum,Tagname);
Arguments
Hist_Tag
HistTrend tag assigned the name of the trend.
PenNum
Integer tag or value representing the pen number (1-8) of the trend.
Tagname
Name of the new tag to assign to the pen.
Remarks
This QuickScript function is the only method to add tags from a distributed history provider during run time.
You can enter a maximum of 49 characters for a reference in a pen name.
You may see the following error message when you attempt to unassign a trend pen:
VIEW /UpdateData: Invalid DBS.TAGNAME handle – 0
This error occurs if you're trying to unassign a pen that was previously assigned to a remote tag in the form histprovider.tag_name. To resolve this error, create a local tag with the Log Data option selected. Then, use the following script to unassign the pen:
HTSetPenName( "HistTrend", 1, "localtag" );
{assigns the pen to a locally logged tag---localtag}
HistTrend.Pen1=None;
{unassigns the pen}
Where None is a TagID type tag.
Examples
The following statement assigns the OutletPressure tag to pen 3 of Trend1.
HTSetPenName("Trend1",3,"OutletPressure");
The following statement assigns the HistPrv1.Tag1 tag to TrendPen4 of Trend1.
HTSetPenName("Trend1",TrendPen4,"HistPrv1.Tag1");
See Also
HTSelectTag()