05-31-2017 05:13 PM
Hi
I am trying to produce a graph that displays the force and position read from a DAQ device (USB-6211). I would like the graph to keep all the data until I start the program again. I would also like to write it to a file, but that is problem for later. The goal is make a stress-strain graph in the end. The force is read from a load cell and then ran through a filter. The position is read from a rotary encoder that measures in counts. I have tried multiple ways of adding the graph, but the mix of data seems to not allow it to work. I either get the graph to produce very small Y values using the build XY express VI, the graph only produces a single point or the data doesn't work at all.
I attached a snipet of the code I have developed. It is half way through me trying to decide a solution.
Any thoughts or solutions would be very appreciated
Thanks
06-01-2017 12:42 PM
Hello,
I am sorry that graphing is proving challenging.
It appears as though you are using the iteration terminal as a x value, I was able to get the XY graph to work by pulling it out of the loop, setting the tunnel mode to indexing and bundling the two signals together without the iteration data.
Below is a link to a great resource covering charts and graphs in LabVIEW.
Types of Graphs and Charts
From <http://zone.ni.com/reference/en-XX/help/371361N-01/lvconcepts/types_of_graphs_and_charts/>
06-01-2017 01:50 PM
Thanks for replying Anthony
I tried your solution, and it does work just not the way I wanted. I forgot to mention in my post that I want the graph to continuously update, and contain all of the data in said graph for the entire test. It is part of a much larger program that involves me controlling the hydraulic with a PID and taking the force measurements.
If you have any other thoughts on how I can get the graph to work while it continuously updates that would be amazing!
Thanks
06-02-2017 09:38 AM
In that case I would advise using a chart.
For update modes of charts look at the post below.
Chart Update Modes in LabVIEW
From <http://digital.ni.com/public.nsf/allkb/29353B4D8E4CC95C86256B9F007D1AD2>
For detailed information on charts and incorporating them into code, look at the section below.
Waveform Charts
From <http://zone.ni.com/reference/en-XX/help/371361N-01/lvconcepts/types_of_graphs_and_charts/>
06-05-2017 11:40 PM
I'm attaching a VI that I hope does what you want - your problem lay in trying to add a single index value (from i) to a waveform with multiple elements. I've resampled the timestamp to make it match the increase in 'i' with even spacing, this won't match your actual times and sampling rate if the loop doesn't run at 1Hz, but hopefully this is what you want. You can probably edit it to fit a different requirement if needed.
The VI is backsaved to 2013 but I'll attach the 2016 version too in case the backsaving was upset about missing controls. Apologies that they both have the same name.