LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 channel x-y plot

I am using LabVIEW 6.1. Does anyone have a program that produces an x-y plot which plots 1 analog input channel versus a second analog input channel?
0 Kudos
Message 1 of 9
(3,535 Views)
Hi nexgen1,

I don't understand the problem.

simply connect one Array (that you got from first anlog input) to the X array, at the cluster bundle (to create a XY graph), and the same procedure to second Array, to the Y array, and 'walla', it works fine.

Hope it Helps ...
0 Kudos
Message 2 of 9
(3,535 Views)
I appreciate that you responded so quickly. Your answer makes sense, however, I am brand new at LabVIEW, so I don't know where to begin to get the x array and y array. In the end I want to plot one voltage from an analog input channel versus another voltage from a second analog input channel. I hope you can help. Thank you again for your time.
--Greg
0 Kudos
Message 3 of 9
(3,535 Views)
How are you acquiring the data and what functions are you using? If you acquire both channels over time, the AI function will automatically create a 2D array. You can use an index array function to get channels 1 and 2 data. Each of these should be a 1D array that you use for the x and y inputs to the xy graph.
0 Kudos
Message 4 of 9
(3,535 Views)
Hi Greg,
Here is an example VI, because you are using LabView Ver. 6.1 and I'm using Ver 7.0. I can't save the Analog Input VI, but I wrote you the name of the VI, that you can use.

Hope it Helps ....
0 Kudos
Message 5 of 9
(3,535 Views)
I appreciate the response once again. I will try the file you sent me tomorrow. Is it just the Plot XY.VI? or is it more than that? I am just curious.
Thanks again,
Greg
0 Kudos
Message 6 of 9
(3,535 Views)
I have a NI-DAQ and an switch. two channels (4 pins) are being used. The correct voltages are coming out because I am able to get the data to excel using the built in data logger.vi. I just really need to get the x and y data to plot on an x-y plot in labview while the voltages are being sampled. I don't know what functions are to used to be honest in order to acquire the two separate channels into two separate arrays. Thanks again.
Sincerely,
Greg
0 Kudos
Message 7 of 9
(3,535 Views)
Hi Greg

The above example is OK but it won't give you live updates. Take a look at the diagram attached.

Using build array like this is not efficient memory use but it depends on how much data you will be collecting. I've used this technique at 20 scans a second for several minutes without any problems.

By the way the switch used for the reset needs it's Mechanical Action set to Latch When Released.

Hope this helps.
0 Kudos
Message 8 of 9
(3,535 Views)
Look at the shipping example called XY Chart if you wnat to display data real time. The normal XY graph takes arrays post-acquisition and displays them but the example should do what you want without needing to build arrays.
0 Kudos
Message 9 of 9
(3,535 Views)