@sumitrishi wrote:
Hi everyone
I need help with reading the contents of a binary file into an array of clusters . Now this cluster has 5 members that have datatype u32 and a FIXED SIZE array of u8(SIZE of Array is 64).
There are so many thoughts on related queries, I thought if I can get specific I will get help on what is best for my case .
Also fixed size of the array is something about which I am concerned.
Thanking you all in anticipation.
Sumit
Best would be to create a VI which reads one record a time. First use a Read File node with the "byte stream type" input wired with an U32 constant and the "count" input with a constant 5. Depending what application wrote these data files you may have to pass the resulting U32 array trough the "Swap Bytes" and "Swap Words" function. LabVIEW always assumes that data is written in Big Endian format. If the application which wrote the file is a DOS or Windows app it is likely that the data is saved in Little Endian format.
A second Read File function with "byte stream type" input wired with an U8 constant and the "count" input with a constant 64 will read the fixed array.
Now just combine those two resulting wires into a LabVIEW cluster in whatever way you wish and then call this function in a loop to read all your records.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390