LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a Position Force graph using two different DAQ read VI's

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

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

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/>

 

Anthony M.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(2,723 Views)

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

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

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/>

 

Anthony M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(2,702 Views)

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.


GCentral
Download All
0 Kudos
Message 5 of 5
(2,690 Views)