LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adjustable graph axes

The graphs I make are set to autoscale, which is necessary because of unpredictable data values. However, the data I record is prone to spike and I only need to see the "body" of the data. When these spikes occur on an autoscaled graph, the rest of the data gets flattened, and is often undiscernable.

 

Is there a simple way to allow the user to adjust the axes of a graph (as the vi runs) once they determine the specific range of values they wish to monitor?

 

Thanks!

0 Kudos
Message 1 of 13
(3,056 Views)

If they double click a number on the y axis, they can change it to the Max value they want, which will automatically scale the graph to that. But, you have to turn autoscaling off with a property node after all data has been plotted or it will keep redrawing the graph autoscaled.

 

 

0 Kudos
Message 2 of 13
(3,055 Views)

Ah, I didn't read the part about "during the run". You could detect when the user changes the scale (use the method I mentioned above for them to change it), and at that point turn auto scaling off.Thanks VI snippet, that should be a "chart.scalerangechange event

 

0 Kudos
Message 3 of 13
(3,044 Views)

@for(imstuck) wrote:

Ah, I didn't read the part about "during the run". You could detect when the user changes the scale (use the method I mentioned above for them to change it), and at that point turn auto scaling off.


...extending the previous...

 

The auto-scale property can be set for "once" always" never". So put a control on the GUI and apply the setting the user chooses.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 13
(3,040 Views)

Thanks for the quick response!

 

Will you please send that snippet to me as a .vi? There are some elements I'm not familiar with and I'd like to use the Context Help to learn more before I incorporate this idea (I haven't used Event structures before).

 

Thanks!

0 Kudos
Message 5 of 13
(3,029 Views)

hmm... now I'm lost. Using LV2009, I can only find a checkbox for Autoscale when I right-click on Properties for the graph.

 

Is the adustable option you mention something I can find using property nodes?

 

Thanks.

0 Kudos
Message 6 of 13
(3,027 Views)

Yes, it's via a property node. Then the user can reactivate autoscaling if they need to by right clicking the graph or chart. Please see the attached (saved it 2009) -- it's how i'd set it up and it's a template to get you started so-to-speak. Let me know if you are confused or have any questions.

 

Also, do a search for tutorials. There are a lot of links.

Message 7 of 13
(3,016 Views)

Yep, this is above my level of expertise. I don't understand how the vi understands the queued element. If I simply wanted to change the y-axis, could I eliminate the bottom loop? How are they unified?

 

What tutorials would you recommend on the website for me to begin understanding these functions? Dynamic events?

0 Kudos
Message 8 of 13
(2,967 Views)

Yes, you could eliminate the bottom loop, depending on how you are acquiring data. If data is continuously coming in, you do want a second loop. But if you are controlling the write and read (such as w/ many types of serial communication apps) you could probably do it in one loop with a queued state machine. If it is a stream of data, such as with TCP/IP you will want that second loop. If you post more details, I can give you a more detailed example.

 

See below, in the order I have posted

 

http://zone.ni.com/devzone/cda/tut/p/id/5247

 

http://zone.ni.com/devzone/cda/tut/p/id/3023

 

http://decibel.ni.com/content/docs/DOC-2145

 

 

Message 9 of 13
(2,929 Views)

Ok thanks, you are using local variables to link the loops. One loop queues the elements, and one reads the queue, and ending the queue itself requires both loops to complete, essentially forcing them to "wait" for one another, yes?

 

Attached is a truncated version of my code. I do accept a streaming data feed through Serial/USB (similar to TCP/IP). I pick out the correct data byte from the feed and plot it during each loop iteration. Hopefully the labels help walk you through the set-up.

 

So what I need to do is send my data (Hx, and the rest) into a queue that links two concurrent while-loops together via a local variable (which in this case is... the queue of data?). Then plot the data in one of the while loops, exit the loops and end the queue? This whole process will then take place the very next iteration of the "read-data-loop", correct?

 

I think I'm on the right track. Let me know what I'm missing?

 

Thanks!

0 Kudos
Message 10 of 13
(2,895 Views)