10-20-2015 02:56 PM
hello,
I am trying to know what is the offset when i configure the starting point(t0) of a waveform graph to be current time.
I want to create a smart zoom and I need the x axis, where it start to print the data.
If there is a way to know what is the last x axis point what new data is printed it will be better
thanks
10-20-2015 02:57 PM
You can use a property node to pull the axes' min and max values.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-20-2015 03:50 PM
thanks for the quick respond
I did tried it but the problem is i don't get the point of the new data.
I tried to put new data into the graph after that set the graph to autoscale get the min value and the max value subtract them and divide by 2 and after that i add the min value with the divided value but it didn't work because the new data with the autoscale don't print the data in the middle.
i don't know why but when I set the autoscale by code the min value is 2003 and the max value is 2026, And the new data is not in the middle of graph.
10-20-2015 03:55 PM
If you have a waveform, there's a VI in the waveform palette called Get Waveform Time Array. You could use this on the new data to get the start and end, or you could just calculate the end using t0+(Size-1)*dt.
It sounds like there may be something else going on if auto-scale isn't working right. If you share your code, we can get to the root of the problem.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-21-2015 03:14 AM
I looked at the subvi "Get Waveform Time Array" but I didn't understand how it can help me
I upload my code
10-22-2015 12:01 PM
Hey there,
It looks like your graph is currently printing slightly left of center. If you can determine what that offset is, you can scale that as well and just add that to make it print in the center. Why is it so imperative to have the graph printing in the center? Either way, this application is really neat and a very cool use of zooming on a graph.
Good luck!