LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting files

Hi,

how can I convert binary files to ascii files?
and ascii files to binary files?
0 Kudos
Message 1 of 6
(3,262 Views)
If you know the format of the binary and ascii file there is no problem.
But you have to code it yourself.
Read in the file by the file-read vi's.
Save the data (strings) with the file-write vi's.
It is wise to study the LV-manual on the string-formatting subject.
0 Kudos
Message 2 of 6
(3,261 Views)
Daar bestaan in C++ functies voor
Ik zou het dus in C++ doen, bekijk maar eens de MSDN...



Spastische kikker wrote:
>
> Hi,
>
> how can I convert binary files to ascii files?
> and ascii files to binary files?
0 Kudos
Message 3 of 6
(3,261 Views)
Hi,
to solve your problem you have to use VIs which are located in "Functios/File IO/" and "Functions/File IO/Binary File VIs/" palettes.
1. From binary to ascii
To read binary files there are "Read From I16 File.vi" and "Read From SGL File.vi" which can read I16 and Single binary files. These VIs return arrays of numbers (I16 or SGL). To write these arrays to ascii files you may use "Write to spreadsheet file.vi". If you don't need to have a table in your ascii file then you have to convert your numeric data to the string with "Format into string.vi" from Strings palette and the use "write characters to file.vi".

2. From ascii to binary
This is the opposite. First you have to read your ascii file with "Read characters from file.vi" or with "Read from spreadsheet
file.vi". The last returns the array of numbers and the first returns the string. To convert different parts of the string into numbers you have to use "Scan from String.vi" from Strings pallete. So now you have the array of numbers and you can save it in to the binary file with "Write to I16 file.vi" or "Write to SGL file.vi".

Hope it helps.

Oleg Chutko.
0 Kudos
Message 4 of 6
(3,261 Views)
By the way, heb hetgevonden, ma het is ni zo simpel als het lijkt...

Den header moet in ascii blijven, no matter wat ge doet, enkel de data moet
dus geconverteerd worden

Greetz,
Hans

"Spastische kikker" schreef in bericht
news:1013006068.976206@seven.kulnet.kuleuven.ac.be...
> Hi,
>
> how can I convert binary files to ascii files?
> and ascii files to binary files?
>
>
>
0 Kudos
Message 5 of 6
(3,261 Views)
Da is toch pokkesimpel. Gebruik gewoon C++, daar zitten functies in die
dat doen

Spastische kikker wrote:
>
> Hi,
>
> how can I convert binary files to ascii files?
> and ascii files to binary files?
0 Kudos
Message 6 of 6
(3,261 Views)