12-14-2015 11:17 AM
Hi, I receive data of 50 sensors from a microcontroller. Sensors' data are stored in LabVIEW in an array of cluster, each cluster containing info of a single sensor. I need to display in a graph the curve trends of Value 3 of all the sensors, so that every sensor should be represented by a color. Data are updated every minute. Can someone help me please?
Solved! Go to Solution.
12-14-2015 11:54 AM - edited 12-14-2015 11:55 AM
First of all, I'm pretty sure you want a Chart, not a Graph. A chart keeps a history. A graph just shows the last thing you wrote to it.
Secondly, do the building of the waveforms inside of the FOR loop. Makes things A LOT simpler.

12-14-2015 12:21 PM - edited 12-14-2015 02:01 PM
If you update every minute, dt should be 60. The dt of a chart is 1 by default, so it you want units of minutes, you don't need to do anything.
To chart multple values (yes, use a chart, not a graph!), all you need ot convert the array output from the FOR loop to a cluster (array to cluster, don't forget to set the cluster size!)
There is no need for waveforms or dynamic data.
The above assumes that the number of sensors is known at compile time (clusters are fixed size!). If they are not there are other solutions. For example you could built the output of the FOR loop into a 2D array with one row and set the graph to transpose.
You have 95% too much code!
12-14-2015 01:23 PM
@altenbach wrote:
If you update every minute, dt should be 60. The dt of a chart is 1 by default, so it you want units of minutes, you don't need to do anything.
To chart multple values (yes, use a chart, not a graph!), all you need ot convert the array output from the FOR loop to a cluster (array to cluster, don't forget to set the cluster size!)
By going with an array of waveforms as I showed, then the X axis will just use the timestamp that you put into T0. No need to mess with dt. It will also be fully expandable to however many waveforms is needed.
12-14-2015 02:00 PM
Yes, there are a lot of unclear things so I kept it simple. The OP did not mention timestamps at all.Your solution would make sense if the x-axis were formatted with absolute timestamps or if the update rate is very uneven. I think with an update rate of 1/minute, it is easy to keep the rate software-timed and equally spaced within sufficient accuracy.
I am not sure how much additional internal data structures are needed for your solution, but if each point contains a DBL and a timestamp, we are talking about 3x more data that needs to be kept and rotated by the chart.