LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

byte stream file for string

I'm writing in a byte stream file a strings, but when I try to read then from the file I can´t. I have some problems whith the byte stream type parameter in the read file function. Could anybody expalin me how can I read my file?
0 Kudos
Message 1 of 4
(3,223 Views)
hi,

i'm not sure: you are using the "read file"-function? and you have troubles with the "byte stream type"?

"byte stream type" is wired to your datatype you want to read... imagine: you've written "U32"-values in a file, now you have to wire a "U32"-constant to 2byte stream type". the "read file"-function starts at "pos offset" and reads "count"-times the value as datatype you've set with "byte stream type".... did you see?

best regards koni
0 Kudos
Message 2 of 4
(3,223 Views)
yes, I´m using read file. My problen is when I want read strings from a stream byte file. When I read numbers ther is no problem. I think, it's the stream byte parameter, in function read file, do yo know what value i have to introduce there?
0 Kudos
Message 3 of 4
(3,223 Views)
lidia wrote:

> I'm writing in a byte stream file a strings, but when I try to read
> then from the file I can´t. I have some problems whith the byte stream
> type parameter in the read file function. Could anybody expalin me how
> can I read my file?

When you write variable sized data such as arrays or strings to a file
as binary stream make sure you have the "write header" boolean input set
to true at the Write File node. This tells LabVIEW to write an int32
containing the number of elements in the string or array before it
writes the actual flattened data.

With the Read File you then just wire a String or according Array to the
bytestream type input and everything goes fine.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 4
(3,223 Views)