LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XYGraph cursor position (x-axis is absolute time)

Solved!
Go to solution

Hi Guys,

I am using XYGraph with X-axis (absolute time). When the Monitoring Start button is pressed, I need to put a cursor on the present time and Y value. I have created a property node for cursor position. How do I control the cursor position?

 

Thx

0 Kudos
Message 1 of 10
(211 Views)

Have you tried the Timing function "Get Date/Time in Seconds"?  [I tend to use Relative Time on my Graphs and Charts, since I usually deal with data that is collected "now", or "seconds since I started this program, which I saved as a TimeStamp "Start of Program", as opposed to "number of seconds since some time more than a century ago".]

 

Bob Schor

0 Kudos
Message 2 of 10
(166 Views)

Hi Bob,

 

My customer agreed to use sampling number as time instead of current time. Hence I switch to Waveform Graph instead of XYGraph.The cursors can be control and position.

 

But the cursor behave differently when I put Active Cursor as constant value. It works perfectly when I use it as Control.

When I put the 2 cursors as constant value of 0 and 1 respectively, both cursor is called and placed together. Why is it so? 

0 Kudos
Message 3 of 10
(149 Views)

Unfortunately, I'm using LabVIEW 2021 and cannot open LabVIEW 2024 VIs.  Also, your picture doesn't even show the X Axis, which makes it difficult to understand why cursor positions of 0 and 1, where your X Axis is sample number, are spread so many "samples" apart.  Also, why are you using a Graph instead of a Chart?

 

I have a colleague who has called on me to help figure out why his VI doesn't do what he wants it to do (I tell him it does what he told it to do).  He then starts telling me how he "did it", and I say "Stop -- don't tell me how you did it, tell me what you want to do".

 

I apologize for not going back and re-reading this entire thread, because maybe you answered the "What" already, but I suspect you need to go back and think about the "What" again.

 

From the "Cursors as Control" picture, I'm guessing something like the following:

  • You have a signal, probably an analog voltage sampled at some (unknown) frequency.
  • You take your sampled data (1D Array of Dbl, I'm guessing, or possibly represented by a Waveform) and want to place two cursors on it, either programmatically by clicking with a mouse or by specifying a value for the X axis (which could be Absolute Time, probably a bad choice, Elapsed Time since start of collection, or Sample #).
  • You want to do some processing based on the Sample and the Cursors.  What would that be?

Bob Schor

 

P.S. -- If you want to attach a VI, you would reach far more "long-time LabVIEW Users" by clicking "File", choosing "Save for Previous Version", and choosing something like LabVIEW 2019 or 2021.  It will create a folder for you with lots of stuff from the LabVIEW support libraries, but if you dive into the nested folders, you'll eventually find your VI, which you can drag out to your desktop and from there attaching it to your response.  If you open it with LabVIEW 2024 (which seems to be what you are using) and right-click its Icon (upper right-hand corner) to look at "Properties", you should see the version of LabVIEW that it has been "saved for", such as LabVIEW 2019.  Close it without saving it, and attach it for us to see.

0 Kudos
Message 4 of 10
(120 Views)

Sorry on the pictures as my focus is on the cursors and I have save my VI to a lower version (think is V13 and V14).

 

My application is to monitor pressure stability for a certain duration. I need to put 2 cursors on the graph to show start and stop pressure. Waveform Chart don't support cursor and so I use Waveform Graph as XYGraph is not necessary (customer agreed not to use relative or absolute time).

 

My issue is when I use the program the cursor as control, I can position the cursors on the plot. But if I were to program the cursor as constant, both cursors are called together.

 

Thanks for your advice.

0 Kudos
Message 5 of 10
(104 Views)

i think these 2 VIs are saved as LV 2019.

not sure the previous one I save it correctly. 

Download All
0 Kudos
Message 6 of 10
(90 Views)
Solution
Accepted by topic author indcon_wan

Hi wan,

 


@indcon_wan wrote:

My issue is when I use the program the cursor as control, I can position the cursors on the plot. But if I were to program the cursor as constant, both cursors are called together.


You need to set the ActiveCursor FIRST, then set its position:

(You could use two independent property nodes, if you would enforce DATAFLOW by using error wires…)

 

And one more important item:

When you use ValueChange events on those buttons then you should set them to "latching when released" instead of "switching until released". That switching behaviour creates two events!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(81 Views)
Solution
Accepted by topic author indcon_wan

Hi Gerd,

 

Thanks for the 2 pointers 

1. To set ActiveCursor FIRST

2. And use "latching when released"

 

The program is working now. Cheers and have a nice day.

0 Kudos
Message 8 of 10
(73 Views)

Hi wan,

 

Attached is an example of using relative time for Xscale (LV2020).

 

Don't forget to check the graph properties, it may ignore the waveform timestamp if you don't disable the option below :

 

PinguX_0-1741605474356.png

 

 

 

0 Kudos
Message 9 of 10
(58 Views)

thanks for your advice.

0 Kudos
Message 10 of 10
(45 Views)