LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a graph with a voltage input on each axis with a continous curve display

I need to make a graph that can display two voltages, with one of the voltages on each axis.  I have accomplished this by using an xy graph.  The problem is I need a curve to be displayed as the voltages change similar to the curve displayed in the waveform chart.  Currently, a line is displayed between the inital point and the final point but it then disappears.
0 Kudos
Message 1 of 7
(4,793 Views)

Hello Will and welcome to the community!

It appears that you have the XY Graph inside of a loop and each time the loop runs your previous data is being overwritten by the new data.  If you are only writing two points of data to the graph each time your code loops then you would only see pairs of connected points each time the graph updated.  You can make the XY Graph display all previous data as well as the new data each update by wiring a false Boolean constant to the "Reset" input of the Build XY Graph Express VI.

Another option would be to use a loop and a shift register and build an array with all of your data in it before passing it to the Build XY Graph VI as shown below.

If I have misunderstood your question please reply with more details so that I can provide a more relevant answer.

Brooks Campbell



Message Edited by Brooks_C on 11-29-2007 05:49 PM
Brooks
Download All
0 Kudos
Message 2 of 7
(4,780 Views)


Message Edited by chris.nelson@ni.com on 11-30-2007 01:47 PM
0 Kudos
Message 3 of 7
(4,754 Views)
I tired both ways you suggested.   When no voltage is applied to one channel, a horizontal line should result but instead a linearly increasing line is displayed.  It appears as though the same voltage is being displayed on each axis.  I have selected two channels when I insert the DAQ assistant.  Also for the array option, how do I erase the data after the test is complete so I can start a new test.
0 Kudos
Message 4 of 7
(4,746 Views)

Hello again.

I should have explained my example more.  I used the same signal for both the X and Y inputs of my XY graph, so the linearly increasing line is expected behavior.  In order to do what you want, you need to use a split signal VI after the DAQ Assistant express VI.  Once you place the split signal VI on the block diagram you can expand it so that it has two output nodes and wire them to the X and Y input terminals of the Build XY Graph express VI.

Similarly, for the array example, you can use the split signal and then use two build array VIs.   In order to reset the graph you can just initialize the shift registers with a zero to clear the graph each time it runs.  This will clear the graph at the beginning of each run (and not at the end).



Message Edited by Brooks_C on 11-30-2007 03:39 PM

Message Edited by Brooks_C on 11-30-2007 03:40 PM
Brooks
Download All
0 Kudos
Message 5 of 7
(4,727 Views)
Hi Will9843,

 I just wanted to add one thing to the excellent ideas that BrooksC posted. To have the array initialized each time then place another loop around the inner loop. Here is a screenshot that shows an example of doing this:
 

 I hope this helps!

 Have a great morning.

 Best regards,

 MatthewW
 Applications Engineer
 National Instruments
 


Message Edited by Matthew W on 12-03-2007 11:46 AM
0 Kudos
Message 6 of 7
(4,701 Views)
Hello again,
 
The solution worked great!  There is just one little problem.  When LabVIEW is making the graph, there are always straight lines from the point 0,0 to the input point. Is there any way to get rid of this added noise?
 
Thanks,
William 
0 Kudos
Message 7 of 7
(4,569 Views)