LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help reading binary file

Solved!
Go to solution

Thanks for all the help.

 

At the moment it looks like it is consistant in that it reads correctly if i wire a 2 to the count and have it read as a DWORD then all of a sudden the parameter set labels and units spit out. Interestingly though it then appears that the trialer block reads as they have it (as a byte!). Am waiting to hear from tech support for the program to clarify if this should be consitant for all the other files.

 

Am now just reading the datablock and working out how to reshape the array.

 

Interestingly it has been bugging me about terminals appearing as icons - if it wasnt for you mentioning about changing that i would never have thought to even look into the options to see what i could turn off.

 

Thanks again for all your time and patience. 

0 Kudos
Message 21 of 22
(443 Views)

I had not looked that far down into the file, but yes, looking at the file(s) in Hex it appears that the trailer block header bytes are indeed written out as bytes.

 

For the data itself keep in mind that you need only have one single Read Binary File with the appropriate value wired to the "count" input. When you wire a data type to the  "data type" input and a value to the "count" input the function will return an array of that data type. Thus, in your case you want to wire an SGL constant to the "data type" input and the "count" should simply be (the number of parameter sets X the number of dimensions X the number of samples). Each of these value were previously read out in the header. Then you can just use Reshape Array to turn it into a 3D array with the dimension sizes being those same values. In other words, this should do it:

0 Kudos
Message 22 of 22
(436 Views)