LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write file and using database connectivty

Hello,
I am using LabView 7.1 with the Database Connectivity and DIAdem connectivity, both of them updated.
I want to make a selection of some data of a database and report it with DIAdem 9.0.
The problem is that when I use the DB Tools Select Data.vi the output is a Data Array that I am not able to write to a file.
 
So the question is: How can I write my data selection to a file in order to report it with DIAdem 9.0?
 
Thank you very much,
 
Núria
0 Kudos
Message 1 of 8
(3,160 Views)
Does anyone have any solution of this question? I don't know exactly how to do it correctly. I can't wire the Data Array output to any Write File VI.
 
Thank you,
 
Núria
0 Kudos
Message 2 of 8
(3,127 Views)
I have been unable to open your zip file. I get a message that it is corrupt. I don't understand what kind of problem you're having writing to a file. You can write any type of data to any type of file. What type of data (strings, numeric, array, size of array, etc.) are you getting from the database and what format do you need to write?
0 Kudos
Message 3 of 8
(3,122 Views)

Hello Dennis,

Here it is the correct zip file and you'll see which data I get from the database.

Thank you in advance,

Nuria

0 Kudos
Message 4 of 8
(3,112 Views)
Hello Dennis,
 
What I get from the Database is what is called "Resultat de la consulta" (you can see it in the image attached below) and I would like to write this data in .tdm format (if possible) because I would like to open this data in DIAdem 9.0.
 
Thank you!
Núria
0 Kudos
Message 5 of 8
(3,101 Views)
The data you read back is a variant. This is because you're reading multiple columns of different data types. You can use Variant to Data to convert columns to specific data types. I'm not sure of the best way to convert to the datatype that the write tdm functions require as I haven't used these. My best guess would be to create waveform data types and then convert those to signals. A waveform data type is a cluster with a t0, dt, and a y array. Maybe someone with more experience with tdm files can provide more details.
0 Kudos
Message 6 of 8
(3,091 Views)

Hello Dennis,

I didn't understand exactly what you explain about waveform data type...but anyway...I also could work with .xls files instead of .tdm.

And I also tried what you said about Variant to Data....but it gives me an error. I attach you the modified file.

Thank you,

Nuria

0 Kudos
Message 7 of 8
(3,086 Views)
Because the columns are different types, you first have use the Index Array or Array Subset on the 2D variant array to get the columns of a specific data type. For example, if column 1 is numeric, extract that column. Then you have to specify the data type for the Variant to Data. If you want to convert to a 1D numeric, wire a 1D numeric array constant to the type input. If you extract a 2D numeric from the variant array, wire a 2D numeric constant to the type input. To write to a spreadsheet file, you will also have to first convert the numeric arrays to string arrays. I'm not sure about the date/time columns in the database. I don't know whether you can convert those to a numeric array or if you can convert them directly to a string. I believe the toolkit has some special functions for date/time conversion.
0 Kudos
Message 8 of 8
(3,083 Views)