John Lokanis Posted July 20, 2010 Report Share Posted July 20, 2010 Having not used graphs or charts in a very long time, I waswondering if someone could give me some tips on how to solve what is probably avery easy problem. I need a waveform chart (not graph, because I only want todisplay a certain number of recent points and will be continuously accumulatingdata) of temperature readings. Where itgets complex is I need to timestamp each reading. Also, the time between datapoints is notfixed. There is no ‘sample rate’ so t0and dt will not work for me. I need to feed this chart a starting time (timestamp) when Iinitialize the display and then at any random times later, feed it a y value andtimestamp. I expect it to plot the yvalue at the appropriate point on the chart and draw a line from the previousvalue to it. Also, if the y value is anarray, then each datepoint in the array is for a different plot, all with thesame timestamps. As the history is filled, I expect the oldest data to disappear off the left side of the chart. I also would like to set the history length wheninitializing. This sounds like a job for an X control to me, but I am notsure where to start. Anyone know of agood example to look at or have something to share? Thanks, -John Quote Link to comment
xtal Posted July 20, 2010 Report Share Posted July 20, 2010 I needed something similar and ended up using the Variable-Time Chart XY example that ships with LV. I made a few modifications to make it do exactly what I wanted, but this should give you a good start. Let me know if anything more elegant or flexible comes along. Quote Link to comment
John Lokanis Posted July 21, 2010 Author Report Share Posted July 21, 2010 Thanks for the tip. That did the trick. I must comment however, that the example code did not conform to good style. Wish they would clean it up sometime! Quote Link to comment
xtal Posted July 21, 2010 Report Share Posted July 21, 2010 Thanks for the tip. That did the trick. I must comment however, that the example code did not conform to good style. Wish they would clean it up sometime! :yes:Agreed! That's why I had to modify it. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted July 22, 2010 Report Share Posted July 22, 2010 :yes:Agreed! That's why I had to modify it. Yes late to the game but for the sake of completness, all of the above can be done with a Waveform Chart except setting history legth at run time. See this thread on the dark-side for an example. http://forums.ni.com/t5/LabVIEW/How-can-I-update-the-x-axis-to-match-a-time-reading-in-a/m-p/160205#M95365 The trick is to only have a single value in the "Y" array and the chart will plot the point determined by the t0 of the wf data type. updates do not have to be periodic but you can NOT plot backwards in time (all to's must be increains or the chart resets). Ben 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.