DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Exact x, y for coordinate curve

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

0 Kudos
Message 1 of 3
(1,504 Views)

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

Message 2 of 3
(1,473 Views)

Thank You, for idea,

I'm going to try.

 

m.

 

 

0 Kudos
Message 3 of 3
(1,465 Views)