Showing results for 
Search instead for 
Did you mean: 


I have to plot 4 different variables in a single graph/chart.. .all are real time.. so cant be stacked up and plotted. One of the variables is time and must be X axis.. ant the three others are Y axis variables.. I am unable to assign the time to X axis in W-form chart.. and also cant plot this in a XY/ W-form graph. Any suggestions?
0 Kudos
Message 1 of 9
First thing to do is to set the X Scale>Formatting to Absolute Time. Then, use Get Date/Time in Seconds, convert the output to a DBL, and wire that to the chart's XScale.Offset property. The Xscale.Multiplier should be set to the time between acquisitions. Besides the attached example, see the shipping example called Real-Time Chart. It uses relative time on the x-axis but the principal is similar.

Message Edited by Dennis Knutson on 04-28-2005 03:10 PM

Message 2 of 9
Hi, Mr.Knutson
I cant open the vi as it is in 7.1.. Can you provide me wiht the 7.0 version vi if its not much of a trouble?
0 Kudos
Message 3 of 9
0 Kudos
Message 4 of 9
Thanks , that really helped.. I have one more question.. Suppose I want to take the mean and standard deviation of a real time plot.. take mean for every 2 secs of data using data from the graph... is it possible?.. in real time?..
0 Kudos
Message 5 of 9
There's a couple of ways. You can use the Chart's property History Data. Reading this will get you an array of all values in the history buffer. You can retrieve the last x number of elements to use for your calculations. If you have at least the full version of LabVIEW, just wire the latest value into Mean PtByPt or Standard Deviation PtByPt. You set the sample rate equal to the number of samples that would be acquired in the time frame you want.
0 Kudos
Message 6 of 9
I tried to wire the output to Standard deviation PtbyPt... and I used it for calculating mean and std deviation for 250 samples.. But it updates for every sample.. I mean.. it gives mean and Sd for samples 1 to 250.. then it gives it from 2 to 251... Is there any way to get mean and sd for first 250 samples.. then for the next 250 samples?.. I also want to write it to an output file..
0 Kudos
Message 7 of 9
As I said, the chart history is an array. Use the index array functin to get elements 0 to 250. Wire this to the regular mean function which requires an array input. Then, index 251 - 500, repear as necessary.

There's several functions for file output such as Write to Spreadsheet file, Write Characters to File, Write LabVIEW Measurment File, etc. There's several shipping examples on file I/O.
0 Kudos
Message 8 of 9
I actually tried that.. I set the history buffer size but I could not get the array out from the chart. can you tell me how do I get the values from the history ?..Is the data compatible for wiring it into the mean and sd vi?.. I tried some way to get the histoy data but it didnt let me wire it into the sd vi.
0 Kudos
Message 9 of 9