LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xy plot from serial connection

I have been trying and trying to get this to work using what is on the forum already (which i should be able to do) but I just can't figure it out and I can't waste much more time on it. I have a serial connection which is reading a pressure back as a string. I am converting the string to double and then i also have a timer which reads the value out as double. I need the time to be the x coordinate and the pressure to be the y coordinate on an xy graph. I have the real time going but I need it to store my points on the graph and connect them. I know there are some examples out there that do this but for some reason I just can't figure it out. Any help would be much appreciated.
0 Kudos
Message 1 of 3
(2,574 Views)

Have you tried simply wiring your pressure reading directly to a waveform chart? It's like a stripchart, and it already has time information. If you wish to use your own timestamps then you can use a waveform graph or an XY graph. For the waveform graph you need to create a waveform data type which involves setting the start time and your dt, and feeding your arrays of pressure readings for the Y. For the XY graph you just need to create separate X and Y arrays. You can use the Express XY Chart if you wish as a starting point.

 

Have you looked at the graph examples that ship with LabVIEW. There are several examples that show you how to create all sorts of graphs. 

Message 2 of 3
(2,567 Views)

I agree with smercurio.

You do not need an XY graph.

 

Instead, use a waveform chart, and it will automatically use time for the x-axis.

You are correct in turning the pressure string to a double, then all you have to do is wire that double to a waveform chart.

Put this procedure in a loop, and it will use the timing of the loop as the time for the x-axis.

(Note if the loop runs more frequently than 1 second, you must change the scaling of your x-axis accordingly) 

Cory K
0 Kudos
Message 3 of 3
(2,557 Views)