LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading binary data in labview

Does labview save a file as a binary file in the labview native format?
I have written a file containing random numbers and saved it in the labview native format. then im reading this file and storing this chunk of binary data in the SQL database as a binary datatype. I want to retrieve this chunk of binary data from the database and display it as an array of numbers but am unable to do this.
Is there any way in which i can save a waveform file in binary format then store it in the database as a binary datatype and retrieve it to display the waveform.
0 Kudos
Message 1 of 7
(4,649 Views)
Labview saves the data in any format you like. This is determined by the file vi's. Be sure you're using one of the write binary data to file vi's, not one of the ASCII ones. See the many examples in the help files.

Good luck!
Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 2 of 7
(4,649 Views)
As Eric said, there are some great example programs that are shipped with LabVIEW for reading and writing binary files. Search in the example finder for 'binary' and you should come up with Read Binary File.vi and Write Binary File.vi. In addition to these, there is an example program on the National Instruments website that shows how to create and read a binary file consisting of a 2D array with headers. Here is the link to this example program:

Creating and Reading Binary Files for 2D Arrays in LabVIEW


Hopefully these example programs can guide you in creating your program.

J
ohn M
National Instruments
0 Kudos
Message 3 of 7
(4,650 Views)
HI, thanks for the reply.
Actually, im able to create and read binary file, bt am unable to store the file in a sql database and retrieve it in the same format.
I also tried storing an array in the database. As mentioned in labview, to store an array we need to define "binary" as the datatype in the sql database, but when i retrieve this array, im not getting the same array, im getting some very wierd values. why is this happening. Also, if i have to store a binary file larger than 8KB, do i have to use the "image" datatype in sql database, how do i readthis "image" file in labview, what is the supported datatype in labview for the "image" datatype of sql database.
0 Kudos
Message 4 of 7
(4,649 Views)
What method are you using to store/retrieve the data between LabVIEW and the database? The Database Connectivity Toolkit has many examples of storing and retrieving binary data. However, if you are using some other method, you might have to deal with the data in a completely different way such as converting the variants or some string manipulation.
0 Kudos
Message 5 of 7
(4,649 Views)
Would you know what the freshest URL is for these programs? This one has expired.
0 Kudos
Message 6 of 7
(4,591 Views)
Hello cleat,

Attached to my post is the VI being referenced by John M 64.

Please let me know if you have any questions.

Regards,

Matt F
0 Kudos
Message 7 of 7
(4,575 Views)