LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read binary file

Solved!
Go to solution

Hi coolhand,

 


@coolhandLV7 wrote:

Same vi that you created, all i did was pull the -1 values from the data set.


You should have heard of "autoindexing" before, so no need to determine ArraySize!

And when you set the NaN to SGL datatype then your VI requires much less memory (and shows one less coercion dot):

 


@coolhandLV7 wrote:

As far as i know, the data type is I16, data order is I16 and there is a 4-byte float after that (SGL)


Then it seems you don't know the full format description

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 16
(1,288 Views)

Exactly, i don't know the format, that's the reason for the post

 

 

0 Kudos
Message 12 of 16
(1,280 Views)

Binary file

Number of columns:  I16

Number of Rows:      I16

3*nrows*ncols:  X,Y,Z data  Float32

 

It can be processed in Matlab, correctly.  Labview seems to be clipping the data.  The size of the data is the same in Matlab, 1001x1001.

0 Kudos
Message 13 of 16
(1,266 Views)

Hi coolhand,

 

LabVIEW can do the same - after you provided the full format description now:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 16
(1,241 Views)

Great!  That's closer, the data is still being clipped.  By clipped it's actually offset by (4) pixels in (x), it acts almost like a carriage return, once the data set reaches pixel y = 1001 it offsets and places the remaining data at y = 0 and x + 4.  I cannot understand this phenomenon.

 

I've attached another example file and the image of what the code generates.  The Test1 data also does this but doesn't show up as obvious because the (Z) values are close to the intensity chart minimum (similar color)  This is not a true statement and the data for Test1 starts at y = 636. 

 

Why is the data building the chart this way?

 

Is it possible to change the start position of the data block so that we don't run over the limit?  For example the data starts at y = 639 and runs all the way up to y = 1001, overflows and starts over at y = 0.

0 Kudos
Message 15 of 16
(1,230 Views)

1D-Rotate.JPG

Looks like adding a 1D Rotate array will allow for the shift in Y direction.  I'm still puzzled as to why the offset happens.

0 Kudos
Message 16 of 16
(1,223 Views)