From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Standard Diretory and Binary files

I build a routine for create standards diretories (JOB NAME and AQUISITIONS) and binary files for each channel in VI diretory. But when I save data in binary files with component WRITE FILE of FILE I/O tab my data stay like ASCII String. I open files in explorer and the data is in ASCII mode. Why?
 
Observation.: create files and save data is separated because stay in diferents locals in main program, by this transform refnum in local variable.
 
Look for attacheds VI and JPG files.
 
Thx for clue.
Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
Download All
0 Kudos
Message 1 of 6
(2,683 Views)
Hello Leonardo,
in my opinion this VI does exactly, what it should do. When the start button is not pressed, the string "Teste 25" is stored into the files, 10 times/sec. But I noticed that you don't close the files after pressing START, that's why the four files sometimes can have different sizes.

Hope, this helped,
Dave
Greets, Dave
0 Kudos
Message 2 of 6
(2,670 Views)

Really Dave,

my VI don't close file....my problem is that the data isn't save in binary mode, is in ascii mode....This I don't understanding....why don't save in binary mode if I use vi to save in binary mode?

Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
0 Kudos
Message 3 of 6
(2,665 Views)
The Write File will write whatever type of data you wire to the data input and in frame 2, where you have the only Write File, you have a string wired to the data input. It's very unclear to me what you want to do and how you want to store the ASCII string 'teste 25'. If there is numeric data that you want to store at some point, you can wire that to the data input and that will be stored as binary.
0 Kudos
Message 4 of 6
(2,661 Views)

Very good Dennis,

I understand now...is true that I want save waveform data of several channels, one in each file...I was testing save for binary file, but with strings...not with numbers. I think store waveform data in binary files and configuration of aquisition in txt file (channels, rate, samples, minimum and maximum value, observations of aquisition, etc...). I dont know if this take me problem after.

Now i know that WRITE FILE store numeric data in binary and other kind (string) need conversion...is right?

Thx for all.

Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
0 Kudos
Message 5 of 6
(2,655 Views)
You can mix data types in a single file. Your header can be text and the numeric can be in binary. There's a shipping example called High Speed Data Logger you should look at. The first thing it writes is the size of the header. Then in High Speed Data Reader, this number is read and used to specify how many bytes to read for the header. The rest of the data is then read as binary.
Message 6 of 6
(2,652 Views)