LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Graph from 2D Query Array

Solved!
Go to solution

Hi everyone.

 

With the DB connection Toolkit i created a 2d array with 2 column:

-the first rapresenting different Temperatures

-the second with the related Date and Time

 

the current array is in String format because in DBL format i could not represent properly Date and Time

 

How can I can create a Chart where Temp=y and DateTime=x ??

 

I attached you the VI and a photo with the 2d array that comes from Running the query.

Thankyou for your help!!!

Download All
0 Kudos
Message 1 of 14
(3,016 Views)

I use Transpose 2d Array to change column and field and then Index array to create two 1d array!

 

The nex step was to convert the two 1d array into numeric arrays! 

For the Temperature one is OK

But for the Date/Time array if i use the fract/exp string to number i get only the first number (for example 9/12/2010 ---> 9 )

How can i solve that?

Thanks!

0 Kudos
Message 2 of 14
(2,991 Views)

So you want something like this?


GCentral
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 3 of 14
(2,979 Views)

I wasn't familiar with Scan From String so I opened up a BD to wire it up. That VI should have a broken run arrow, right?

0 Kudos
Message 4 of 14
(2,970 Views)

@Gregory wrote:

I wasn't familiar with Scan From String so I opened up a BD to wire it up. That VI should have a broken run arrow, right?


Weird. The wire dissappeared when creating the snippet.  But dropping the snippet onto my block diagram and everything is there.  There should be a wire going from the autoindexing tunnel to the Input String on the Scan From String.


GCentral
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 5 of 14
(2,962 Views)

I figured, the reason I wanted to "investigate" was because I couldn't think of a good reason to leave that auto-index tunnel disconnected

0 Kudos
Message 6 of 14
(2,959 Views)

Here is another snippet that appears to have worked properly.


GCentral
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 7 of 14
(2,954 Views)

Croosrulz thanks so much.

Just 2 thinks:

 

1)the Vis gives me Error in the Scan from String

I atteched you the photos.

 

2)Is it possible to have a Bar graph instead of the normal one?

 

Download All
0 Kudos
Message 8 of 14
(2,940 Views)

You indexed the Row.  You should index the Colum (which is the second index input on the Index Array)


GCentral
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 9 of 14
(2,937 Views)

ok, last thing:

 

How can i change the scale of X and Y in the Graph in the front panel? cause now it's hardly impossible to see the Temp values

0 Kudos
Message 10 of 14
(2,934 Views)