LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Huge binary file size difference LV 6.1 to LV 8.2

I have an application that was first developed under LabVIEW 4.2 and has been periodically upgraded as necessary.  It is normally run as a built application so LabVIEW version changes only come in when something in the application has to be changed.  That occasion occurred and we changed from LabVIEW 6.1 to LabVIEW 8.2 for the build environment.  No changes were made to any of the file handling vis (other than what LabVIEW did in the conversion, which I didn't check at all).

The problem is that this application writes a large structure (4320 elements in each of 13 single-precision variables) into a binary file once a day.  When I started the new version of the application the size of the files went from 242956 bytes to 775334 bytes.

The vi to read these files still works for the old files as well as the new files and a set of C routines that I use to read the files seems to also work correctly with the new files - at least the data looks like it is supposed to when it is plotted.

The change in file size is a concern since this application is supposed to keep writing these files every day for many years into the future.

Is there any known way to return to the original behavior with the smaller files?

0 Kudos
Message 1 of 4
(2,801 Views)
Further investigation of the file indicates that there is actually space allocated for 3.2 times as many elements per array than what I think is supposed to be allocated (13828 elements instead of 4320) so all the extra space is just zeros.  The arrays are preallocated to 4320 elements and all changes are made with rotates and insert elements to prefent the arrays from growing.  It is not clear yet whether the growth is in the arrays themselves or if the write file vi is allocating extra space "just in case".

0 Kudos
Message 2 of 4
(2,795 Views)
Hi Bryan,

you say: "all changes are made with rotates and insert elements to prefent the arrays from growing"!

You should use "replace array elements" to prevent array growth!!! Please check this with your application!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(2,779 Views)
Actually I was using replace and not insert.  And the problem was actually a programming error that was somehow masked by the behavior of LabVIEW 6.1.  The problem was solved after I actually assembled the intial array correctly (I read data from a file to start that array so that it has a running 3-day history even though all I really want is the last day in each file).  After correcting the error and cleaning up all the mess in the array it is now working fine.


0 Kudos
Message 4 of 4
(2,736 Views)