LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to record and plot only the zoomed portion of a Graph or Chart?

I'm using LabVIEW 8.6 and have problem plotting only zoomed part of a graph or chart onto other. Please help.

0 Kudos
Message 1 of 10
(3,987 Views)

 


@pradeep Patil wrote:

... onto other.


 

other what???

 

Once you are zoomed in, you only plot the zoomed data anyway.

 

If you want to graph the zoomed data on another graph, you can either zoom the other graph to the same axis ranges or you can use the axis boundaries to create a subset of the data.

 

Can you attach some simple code with data to show what you are actually trying to do?

0 Kudos
Message 2 of 10
(3,982 Views)

What I really need is only the co-ordinates of the zoomed section to be written to a .csv file. If I get that, I can manage to get it plotted onto other graph. Ill try to attach the code tomo. Thanks for help.

0 Kudos
Message 3 of 10
(3,974 Views)

You can get the plot bounds of a graph or chart using a property node. Look for "X-scale...range...minimum|maximum", same for Y.

0 Kudos
Message 4 of 10
(3,968 Views)

Its not much of a help for me. I'm uploading my VI. There i've used 2 charts in front panel, as soon as I zoom it, I want the same to be on other chart too. I'm still a beginner, and I even do not know is it possible or not. Thanks.

0 Kudos
Message 5 of 10
(3,943 Views)

Sorry, your VI makes absolutely no sense. First you slowly generate chart data, then you write it to a file, read it back from a file, do some exceedingly elaborate while loop that could be done with almost no code at all, then chart all data at once again. The stop button in the while loop makes no sense, because the while loop executes so fast that it is not possible to actually stop it while it is running, only if the button has already been pressed during the first FOR loop.

What is the purpose of the two arrays? They don't seem to serve any purpose. Why are you getting the array size with every iteration of the loop? Once, right before the loop should be enough. Index array is resizable, so only one instance is enough. Instead, array to cluster is probably all you need.

The sequence structure is only needed because you write, and then immediately read from the file. All you probably need is to write to the file and wire the 2D array to the seconds structure. Now we have a data dependency and the sequence structure is no longer needed.

 

Can you tell us a little more how you are zooming. Do you want to zoom any of the two graphs and automatically zoom the other accordingly?

 

As it currently stands, only the first chart gets data, so zooming the other one seems useless. Once the second chart has data, the VI stops and you can't do much either programmatically. Please explain how you are zooming.

0 Kudos
Message 6 of 10
(3,927 Views)

OK, as you said, it might be 'exceedingly elaborate'. But, I've tried this 'array to cluster' conversion and I feel it doesn't work for 2D array. Splitting might work, but I need 4 different plots in 2nd chart. Stop button is useless, I ve removed it. I'm getting row size b'coz I want while loop to run as many as no. of rows and Ill move it out of loop.

 

           And to make it simple, lets think there is no 2nd chart. Now I have the zoomed chart, and say ill press, 'send to file' button and I want those boundaries to be written to file at every Milli sec. Now, zooming is only restricted to x-axis and I use the graph palette. I tried your solution, it ll get me max and min boundaries only until FOR loop runs.

 

           Can it be done using extra while loop? This ll land me in another trouble, as chart is updated continuously. Since, I'm getting X's max and min, I think I'm near to solution, if I get rid of the necessity that the property node should be inside infinite loop. And I do not understand the purpose of u denying sequence.Even I'm in no mood to zoom second chart. Thanks for showing interest.    

 

 

 

 

0 Kudos
Message 7 of 10
(3,884 Views)

Here is code (bottom of image) you could substitute for the while loop. Simpler? Yes. Still useless? Maybe.

 

 

(Don't forget to set the cluster size).

 

Can you tell us a little more about the program logic and how it is supposed to be used? Doing the linked zoom needs to be done in an independent loop, whenever one of the scales change.

 

Message 8 of 10
(3,879 Views)

To be more precise, I want to acquire data from an instrument. This goes like, if I give a trigger some data ll be read and stored, then it keeps to wait for another trigger. In between this I want to zoom all 4 plots at once, and press 'send to file'. Ill take min & max at this point and ll write it into another file, thereby plotting it into another chart (deleting remaining datas). U think it works? I'm still scratching my head.

 

Also, I wanna know by any chance, if I can use 4 graphs with common X-axis and a single button zoom for all (I feel stacked plots cannot be used for graphs). 

 

Your previous suggestion was very helpful. thanks

0 Kudos
Message 9 of 10
(3,851 Views)

Can I get directly the datas from the zoomed chart? I ve used chart because I want all waveforms to be zoomed at one go.

 

Help needed please.

 

Attachment shows the zoomed waveform of its original.

0 Kudos
Message 10 of 10
(3,829 Views)