LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sweep chart scrolling cursor coordinate?

How do I obtain the coordinate of the "scrolling cursor" in a Chart used in "Sweep Chart" mode?

In other words, and possibly as an alternate solution, how do I obtain the abscissa of the last updated point in a Chart?

0 Kudos
Message 1 of 5
(2,894 Views)

Hi,

 

If you are using a chart then the position of the scrolling curser will be of the "time stamp" data type. 

 

You want the position of the curser, which as I understand it is the time when the signal was last updated. This can be obtained using the "Get Final Time Value" VI which can be found in the functions pallette in Programming>Waveform>Get Final Time. Input the signal which is being charted and the "tf" output will give the time when the signal was last updated.

 

Hope this helps.

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 5
(2,867 Views)

Hi Joel,

 

thanks for the answer, but it does not address my question, for which I guess I did not provide enough detail.

Your answer applies to the case where:

- the data fed to the chart is a waveform

- you have access to the data

 

In my case, I use a regular array (in fact a 2D array as I am dealing with an Intensity Chart, but the question would apply as well to a 1D array fed to a regular chart). I have specified the X axis offset and multiplier, so that the "time" axis "(which is not necessarily a "time" coordinate) is updated by the Chart without me having to specify a X coordinate. I just provide the Y information. Therefore using the waveform tools is of no use in this case.

Secondly, my question is relevant to the case where you DON'T have access to the input data (in which case I have all the information I need - in principle - to compute the coordinate of the last point, although it represents some work that I may not want to do, since I left the job of updating the X axis to the Chart). Say, I provide a subVI with a reference to the Chart, and the the subVI needs to know the X coordinate of the last point. My question is: how do I do that in this specific case (or can I do that)?

 

0 Kudos
Message 3 of 5
(2,847 Views)

No problem,

 

I think I understand your problem better now, so you have an intensity chart being populated with data from an array. I've been looking at the available property nodes for the intesity chart as I'm sure you have too, but there doesn't seem to be one which gives the curser position.

 

All I could suggest is creating a peice of labVIEW code that updates a global variable each time the chart is updated, you can then use this global variable in your subVIs (instead of a reference to the chart) to give you the current position of the curser. This peice of code would have to increment the global variable by the number of samples since the last update every time it was updated. In other words, your code would actually genereate the x-values as the array was populated.

 

Hope that makes sense, let me know how it goes or if you have any trouble implementing it.

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 5
(2,839 Views)

Let's put it this way: this would be a helpful answer if I had no clue what I was talking about. So let's leave it for future reference (although the use of a global variable would be deemed an insanity by some of this forum's members and is certainly not the way I would go about this).

Off I am to the Suggestion Forum to suggest this as an additional read property for charts...

🙂

0 Kudos
Message 5 of 5
(2,823 Views)