Add method of Pens collection

Member of the Pens collection.
Creates a pen and adds it to the Pens collection. The return value is the new pen. A single trend chart can hold up to 100 pens.
All of the parameters except DatalogModelName are required, but the description and engineering unit parameters can be empty strings.
Syntax
Pens.Add(Name, Desc, EngUnits, Min, Max,
[
DatalogModelName
], [
Historian
], [
LoadModelData
], [
LogScale
])
As Pen
where
Pen
- is a Pen object to hold the new pen
Pens
- is the Pens collection to which the new pen is to be added.
Name
- is a parameter of the type String that specifies a tag name for the new pen. The tag must be unique.
Descr
- is a parameter of the type String that specifies a description for the pen. The description can be displayed in the line legend on the left side or the bottom of the chart.
EngUnits
- is a parameter of the type String that specifies the engineering units for the pen. The engineering units can be displayed in the line legend on the left side or at the bottom of the chart.
Min
- is a parameter of the type Single that specifies a single precision floating point. The value represented by the bottom of the chart. Depending on the MinMaxOption and ScalingOption properties, the Min and Max parameters of a pen may have no effect.
Max
- is a parameter of the type Single that specifies a single precision floating point. The value represented by the top of the chart.
DatalogModelName
- is the name of the data log model to add. Optional.
Historian
- is a parameter of the type Boolean that specifies that the pen being added is a FactoryTalk Historian pen (True) or not (False). Optional.
LoadModelData
- is a parameter of the type Boolean that indicates if the historical data for the pen should be loaded when the pen is added to the trend. If the parameter is True, the historical data will be loaded. If the parameter is False, the historical data will not be loaded. If the parameter is not specified, the historical will be loaded. Optional.
LogScale
- a parameter of the type Boolean that indicates whether the pen is shown with the logarithmic scale to base 10. Optional.
Remarks
If the LoadModelData parameter is set to False when this method is called, the trend will not display the historical data for the pens. In the case, to load the historical data, do one of these:
  • Loan any trend template into the trend. The template can be empty.
  • Call the SetStartTimeAndSpan method of the XAxis object.
  • Add another pen and set the LoadModelData parameter to True.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal