AddPen
- Last UpdatedJan 10, 2020
- 1 minute read
The AddPen method adds a named pen to the trend.
Examples
dim b as boolean;
b = Trend1.AddPen("MyPen01","UserDefined_001.Value", "InSQL01","UserDefined_001.Value", 1);
b = Trend1.AddPen("MyPen02","InTouch:$Second", "InSQL01","$Second", 1);
b = Trend1.AddPen("MyPen03", "MyContainer.InletPump1+MyContainer.InletPump2","","",1);
Syntax
[Result=] AddPen(string PenName, string TagName, string HistorySource, string HistoryTagName, int HistoryTagType);
Parameters
PenName
The name of the pen to add.
TagName
The name of the tag associated with the pen being added.
HistorySource
The history source for the pen being added.
HistoryTagName
The name of the history tag for the pen being added.
HistoryTagType
The type of history tag for the pen being added: 1 for Historian or 3 for LGH.
Return Value
Returns TRUE if the pen was successfully added; otherwise, returns FALSE.
Recommended Usage
Whenever the AddPen method is used in a script, such as the Predefined Script OnShow on a symbol, we strongly recommend that you add a corresponding call to ClearPens. This can be added in a Predefined Script OnHide on a symbol. AddPen creates resources inside the InTouch view application that are not cleaned up when a window is closed during a view.exe session. To clean up these resources, you must use a call from a script to the ClearPens method, or close the view.exe session and end the runtime application.