LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show multiple sensordata from SQL database onto a graph simultaneously

Hi,

I'm new in this community and instantly have a question.

I want to recall some datasets from a SQL-database by switching Boolean inputs to afterwards show them in a xy-graph.

It shall to be possible to show multiple (different) datasets in the graph at the same time. The datasets contains the following columns: SensorID, Value, Timestamp.

My question therefore is how to teach the graph that he has to draw for each SensorID a own chart. I don't know how to deliver this information to the graph because he already gets the cluster of (Value and TimeStamp).

In the attachment you can find the VI and the database. With the LED's in the frontpanel you can choose the different datasets. The startdate (Anfangszeitpunkt)  has to be set on 01.12.2010 and the enddate (Endzeitpunkt) on 10.12.2010 because only for this days data's exist in the database.

Best Regards
Dommes

0 Kudos
Message 1 of 4
(2,420 Views)

I don't have LV installed on this machine, so I can't look at your code.  But it seems like your question can be summarized as:

 

  How do I show multiple plots on the same graph?

 

I would reccomend an XY Graph for your situation because your plots contain unique X and Y data.  You will need to cluster your plots into X (timestamp) and Y (value) data.  And then build an array from your clusters.

 

Have a look at the examples for XY Graphs that come with LabVIEW:  labview\examples\general\graphs\gengraph.llb

http://www.medicollector.com
0 Kudos
Message 2 of 4
(2,402 Views)

Hi, thanks for the answer, but that isn't my question.

 

I have three parameters to plot a chart:

 

1. The SensorID

2. The values of this SensorID

3. The timestamps of the values form that SensorID

 

So the array look like this:

 

Sensor ID0 | Value | Timestamp0
Sensor ID0 | Value | Timestamp1
Sensor ID0 | Value | Timestamp2
Sensor ID1 | Value | Timestamp0
Sensor ID1 | Value | Timestamp1
Sensor ID1 | Value | Timestamp2
Sensor ID2 | Value | Timestamp0
Sensor ID2 | Value | Timestamp1
Sensor ID2 | Value | Timestamp2

 

All ID0 rows have to generate one own chart, all ID1 rows have to generate one own chart, and so on...

The amount of SensorID's in the array is variable, depending on how many LED's are activated. The amount of values is also variable.

 

Any ideas or additional questions?

 

Best Regards

Raphael

0 Kudos
Message 3 of 4
(2,383 Views)

In my opinion, the goal is still the same as my previous post:  You should use an XY mulyi-plot.  And to do that, you will need an array of clusters.  And each cluster conatins an X and a Y array.

 

However, in your case, you will need to build a little "pre-processing" routine that sorts through your 2D array and re-arranges it into an array of clusters.

http://www.medicollector.com
0 Kudos
Message 4 of 4
(2,374 Views)