LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform graph of multiple sensors

Solved!
Go to solution

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?

0 Kudos
Message 1 of 5
(4,032 Views)
Solution
Accepted by topic author biomed87

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.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(4,013 Views)

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!

Message 3 of 5
(3,996 Views)

@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.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,978 Views)

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.

0 Kudos
Message 5 of 5
(3,971 Views)