Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write 8-bit integer format data to a binary file

The VI's I found for writing binary data to a file require the data to be 16-bit integer, single precision floating point (SGL) or double precision floating point. My data is a 1D array of 8-bit integer values from an 8-bit wide digital I/O port on my PCI-6534 card. It seems like there should be a way to write 8-bit integer data to a binary file. Must I convert my 8-bit integer data to 16-bit integer data and then write a binary file that is half full of zeros? Or is writing 8-bit integers to a binary file possible, but only if I write my own VI?
Please help before I pull out the rest of my hair.
Thanks,
Ted
0 Kudos
Message 1 of 3
(3,196 Views)
To write a 1D array of I8 or U8, all you have to do is wire the array to the data input of the Write File function. If you were to looking at the VIs inside Write to I16 File, you'd see that is all that's being done. The binary file VIs are some high level examples that open, write, and then close a file. They're also designed to write either a 1D or 2D array. But, you don't have to use these but if you want, you can easily modify them to handle any data type. In the entire hierarchy of Write to I16, there are exactly four locations where the data type is I16. Two are in the main VI and two are in Write File+[I16]. Change these to a different datatype and save both as a new name and in a new location.
0 Kudos
Message 2 of 3
(3,195 Views)
Thanks a lot. I changed the VI to use U8 instead of I16 data. I knew there had to be an easy way.
0 Kudos
Message 3 of 3
(3,172 Views)