LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fixed point 2D array allocates to much disk space!

Solved!
Go to solution

Hi,

I am trying to crate a 2D array file that will saved on a real time target. And has to be read by my real time application.

In order to create a file as small as possible I have saved it in fixed point format. (16 bit - 6 bit integer)

The array size is 1024X1024 data points which is ~1M of data.

If I save the file in DBL format i expect to get 8MB (every data point is represented by b Byte) file - and this is waht i get

If i save it a U16 format I expect to get 2MB file - and this is waht i get indeed.

I have expected to get a 2MB file with the fixed point format - but as you can see in the screenshot - I don't!

Any explanation why is the fixed point file so large?

Thanks

 

 

Download All
0 Kudos
Message 1 of 6
(3,323 Views)
Solution
Accepted by topic author Hazkel

All FXP is internaly 64 bit.

Message 2 of 6
(3,316 Views)

Thanks!

That solves the mystery indeed, though surprising. Because i thought the whole idea of fixed point representation is to reduce data size.

I have another question and be happy if you can share your insight.

My RT application VI takes about 13 Seconds (!) to read the 8MB file from the RT target flash drive (c:\ni-rt\...)

it lasts less than one second when I read the same file from my local hard drive.

 

What can be te reason? Is the flash drive so slow? (I am working woth sbRIO 9636).

Screenshot atached

 

 

0 Kudos
Message 3 of 6
(3,274 Views)

I can't speak on the speed of flash drives in hardware I don't have but I do see that you're starting the FPGA code in parallel to reading the file, this can of course impact the perceived performance.  Try testing code which only reads the file without doing anything else and then see what times you get.  That is more likely to be representative of the real read speed.

0 Kudos
Message 4 of 6
(3,268 Views)

Thanks again.

Well I have crated code that contains only the part that reads file. (excluded FPGA entirely)

Didn't help. Read time was still long (13Secs for 8MB file, 3Secs for 1.5MB file and 136mS for 60K file)

However what helped a lot was changing the file format to binary file. Time has decreased significantly to about 1 Sec. (instead of 13 secs!)

I guess using the "read from spreadsheet file" VI was not the best approach for this task.

 

 

0 Kudos
Message 5 of 6
(3,257 Views)

Spreadsheet files (delimited text files) have the advantage that they are human-readable.

 

Binary is certainly more efficient though so if the timing is critical, that would be a good choice.

0 Kudos
Message 6 of 6
(3,246 Views)