LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a header with an array of u16 to a file with byte stream

Hello,

I have a header file and an array of u16.
The header file's size is fixed with 2048 bytes.
I need to add the header file at the beginnig of the array of u16. I'm trying to use 'header','pos mode' and 'pos off'terminals in the 'write file.vi', but I don't know how to use them.
Please give me help

Thank you in advance
0 Kudos
Message 1 of 6
(2,942 Views)
Hi,

there are several ways to do it.
In the example I attach the header is written at the beginning of the file in binary format, then it is written the array.
You find also the read.vi that shows how to read header and array from the file created.

Let me know if you need more explainations,

Alberto
0 Kudos
Message 2 of 6
(2,942 Views)
Alberto,

I can't open the example.
I saved the example in '~.llb' file, and
tried to open 'write.vi' and 'read.vi'.
I got an error message "couldn't find resource".
Thank you
0 Kudos
Message 3 of 6
(2,942 Views)
My example was in LV 6.1 version.
I attach here the 2 vis in LV 6 version.

Let me know if it works,

Alberto
Download All
0 Kudos
Message 4 of 6
(2,942 Views)
Alberto,

It doesn't work.
I'm Sorry, but I have LV 5.1 version.
Thank you.
0 Kudos
Message 5 of 6
(2,942 Views)
It's ok!
Here they are in LV 5.1

Good luck,
Alberto
Download All
0 Kudos
Message 6 of 6
(2,942 Views)