SetMinMax method (TrendPro object)

Sets the minimum and maximum values of a trace. The method supports the following scale types:
  • Automatic
  • Minimum
    and
    Maximum
    values
  • Use tag Min and Max properties
Syntax
TrendPro1
.
SetMinMax
(
tagName
, [
modelName
], [
traceType
], [
option
], [
minValue
], [
maxValue
])
where
TrendPro1
- is the name of a TrendPro object or an expression that evaluates to a TrendPro object.
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.
option
- is an optional parameter of the
MinMaxOption
constant.
minValue
- is an optional parameter that specifies the minimum value.
The parameter works only when the
option
is
MinMaxOptionValue
.
maxValue
- is an optional parameter that specifies the maximum value. The scale of the trace will not change if
minValue
or
maxValue
cannot be converted to numbers or if
minValue
is greater than
maxValue
.
The parameter works only when the
option
is
MinMaxOptionValue
.
Example
Private Sub SetTrendProMinMax() 'Sets the values as Automatic for CDT_158 from PIServer data. 'The following two lines of code are equivalent. TrendPro1.SetMinMax "CDT_158", "PIServer", TraceTypePIServer, MinMaxOptionAutomatic TrendPro1.SetMinMax "CDT_158", "PIServer", TraceTypePIServer, 0 'Sets the values as Minimum and Maximum value for Tag1 from datalog model Datalog1. 'The following two lines of code are equivalent. TrendPro1.SetMinMax "Tag1", "Datalog1", TraceTypeDataLog, MinMaxOptionValue, 10, 100 TrendPro1.SetMinMax "Tag1", "Datalog1", TraceTypeDataLog, 1, 10, 100 'Sets the values as Tag properties for Tag1 from Historian data. 'The following two lines of code are equivalent. TrendPro1.SetMinMax "Tag1", "Production Historian", TraceTypeHistorian, MinMaxOptionTagProperties TrendPro1.SetMinMax "Tag1", "Production Historian", TraceTypeHistorian, 2 End Sub
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal