SetUnit method (TrendPro object)
Sets the unit of a trace and shows the unit in the legend.
Syntax
TrendPro1
.SetUnit
(unit
, tagName
, [modelName
], [traceType
])where
TrendPro1
- is the name of a TrendPro object or an expression that evaluates to a TrendPro object.unit
- is a parameter of String that specifies the unit for the trace. The unit will display in the y-axis of the trend and in the Unit
field of the Tag list. You can also use extended tag property or tag value for the unit.tagName
- is a parameter of String that specifies the trace name.modelName
- is an optional parameter of String that specifies the historical model
name. The parameter is required if the traceType
is TraceTypeAF
,
TraceTypeDataLog
, TraceTypeHistorian
or TraceTypePIServer
. traceType
- is an optional parameter of the TrendTraceType
constant. The parameter can be omitted if the trace type is live data or data log.Example
Private Sub SetTrendProUnit() 'Sets the unit for Tag1 from Live Data. TrendPro1.SetUnit "unit_tag", "Tag1" 'Sets the unit for system\Second from the data log Datalog1. TrendPro1.SetUnit "unit_datalog", "system\Second", "Datalog1" End Sub
Provide Feedback