06-04-2021 02:11 AM
Hi,
I Use coordinate type curve to mark local maximum/minimum on curve in report. The coordinate type curve is bound to channel and set Position to Local min/max. How to get exact coordinates of that point in vbs? X and YCoordinate return approximate point . VeloMax = sh.Objects("Velo").Curves2D(3).Shape.XCoordinate.Reference
thanks for help,
Michal
06-04-2021 05:22 PM
Hey Michal,
The Shape.XCoordinate.Reference property does not appear to reflect the display-time maximum and minimum of the curve you right-clicked on, which is presumably Curve1 in your graph. I recommend you grab the Xchannel and Ychannel references from the original curve instead of trying to read info from the extrema curves. Assuming that your Curve1 has both an Xchannel and a Ychannel, this should work:
Set Sheet = Report.Sheets(1)
Set Graph = Sheet.Objects("Velo")
Set Curve = Graph.Curves2D(1).Shape
XchanRef = Curve.XChannel.Reference
YchanRef = Curve.YChannel.Reference
Ymax = CCh(YchanRef, 2)
Ymin = CCh(YchanRef, 1)
YmaxRow = PNo(YchanRef, Ymax)
YminRow = PNo(YchanRef, Ymin)
Set XChannel = Data.GetChannel(XchanRef)
Xmax = XChannel(YmaxRow)
Xmin = XChannel(YminRow)
Call LogFileWrite("[ " & Xmax & " , " & Ymax & " ]")
Call LogFileWrite("[ " & Xmin & " , " & Ymin & " ]")
Brad Turpin
Principal Technical Support Engineer
NI
06-05-2021 03:00 AM
Thank You, for idea,
I'm going to try.
m.