SetMinMax method (XY Plot 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
XYPlot1
.
SetMinMax
(
xTagName
,
yTagName
, [
xOption
], [
yOption
], [
xMinValue
], [
xMaxValue
], [
yMinValue
], [
yMaxValue
], [
xModelName
], [
yModelName
], [
xTraceType
], [
yTraceType
])
where
XYPlot1
- is the name of an XY Plot object or an expression that evaluates to an XY Plot object.
xTagName
- is a parameter of String that specifies the x tag of the trace.
yTagName
- is a parameter of String that specifies the y tag of the trace.
xOption
- is an optional parameter of the
XYMinMaxOption
constant for the x-axis.
yOption
- is an optional parameter of the
XYMinMaxOption
constant for the y-axis.
xMinValue
- is an optional parameter that specifies the minimum value for the x-axis. The parameter works only when the
xOption
is
MinMaxOptionValue
.
xMaxValue
- is an optional parameter that specifies the maximum value for the x-axis. The scale of the trace will not change if
xMinValue
or
xMaxValue
cannot be converted to numbers or if
xMinValue
is greater than
xMaxValue
. The parameter works only when the
xOption
is
MinMaxOptionValue
.
yMinValue
- is an optional parameter that specifies the minimum value for the y-axis. The parameter works only when the
yOption
is
MinMaxOptionValue
.
yMaxValue
- is an optional parameter that specifies the maximum value for the y-axis. The scale of the trace will not change if
yMinValue
or
yMaxValue
cannot be converted to numbers or if
yMinValue
is greater than
yMaxValue
. The parameter works only when the
yOption
is
MinMaxOptionValue
.
xModelName
- is an optional parameter of String that specifies the historical model name. The parameter is required if the
xTraceType
is
TraceTypeAF
,
TraceTypeDataLog
,
TraceTypeHistorian
, or
TraceTypePIServer
.
yModelName
- is an optional parameter of String that specifies the historical model name. The parameter is required if the
yTraceType
is
TraceTypeAF
,
TraceTypeDataLog
,
TraceTypeHistorian
, or
TraceTypePIServer
.
xTraceType
- is an optional parameter of the
XYTraceType
constant. The parameter can be omitted if the trace type is live data or data log.
yTraceType
- is an optional parameter of the
XYTraceType
constant. The parameter can be omitted if the trace type is live data or data log.
Example
Private Sub SetXYPlotMinMax() 'Sets the values as Automatic for TagX from the PI Server PIServer1 and TagY from the PI Server PIServer2. 'The following two lines of code are equivalent. XYPlot1.SetMinMax "TagX", "TagY", MinMaxOptionAutomatic, MinMaxOptionAutomatic, "PIServer1", "PIServer2", TraceTypePIServer, TraceTypePIServer XYPlot1.SetMinMax "TagX", "TagY", 0, 0, "PIServer1", "PIServer2", TraceTypePIServer, TraceTypePIServer 'Sets the values as Minimum and Maximum value for Tag1X from datalog model Datalog1 and Tag1Y from datalog model Datalog2. 'The following two lines of code are equivalent. XYPlot1.SetMinMax "Tag1X", "Tag1Y", MinMaxOptionValue, MinMaxOptionValue, 10, 100, 50, 200, "Datalog1", "Datalog2", TraceTypeDataLog, TraceTypeDataLog XYPlot1.SetMinMax "Tag1X", "Tag1Y", 1, 1, 10, 100, 50, 200, "Datalog1", "Datalog2", TraceTypeDataLog, TraceTypeDataLog 'Sets the values as Tag properties for Tag2X and Tag2Y from Historian data. 'The following two lines of code are equivalent. XYPlot1.SetMinMax "Tag2X", "Tag2Y", MinMaxOptionTagProperties, MinMaxOptionTagProperties, "Production Historian", "Production Historian", TraceTypeHistorian, TraceTypeHistorian XYPlot1.SetMinMax "Tag2X", "Tag2Y", 2, 2, "Production Historian", "Production Historian", TraceTypeHistorian, TraceTypeHistorian End Sub
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal