LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS crashes LabVIEW 2020 when file size is zero.

TDMS will crash LabVIEW 2020 when it encounters a file of size zero. I am not sure how our test system generated a zero length file. We now check for a zero length file and delete it. I was able to simulate a zero length file with the following code.

 

Bill2021_0-1614362439812.png

 

I do not need a response. I wanted to mention it in case others have an issue with TDMS.

0 Kudos
Message 1 of 7
(1,422 Views)

You are "mixing" incompatible functions in your example code. Not sure why it is crashing for you. If you have a completely empty file, it means the TDMS header is not being written.

 

mcduff

0 Kudos
Message 2 of 7
(1,390 Views)

I am aware that the functions are incompatible under normal circumstances and that there is no header in the file. The point of the example is to show that if, somehow, the header is not written such that the file size is zero, functions that expect the file to have a header will crash the system. I do not know how we ended up in that situation. Normally, we have never had an issue. I have fixed tour code to check for a file size of zero to make sure that LabVIEW does not crash our test station.

Message 3 of 7
(1,366 Views)

Not convinced about the 0 file size. The following creates an empty file and does not crash LabVIEW 2020 64bit; your other file though did crash it.

 

snip.png

 

mcduff

0 Kudos
Message 4 of 7
(1,333 Views)

When I look file size after your function executes, I see that the file size is not zero and has the header in it. My example shows a TDMS file with a file size of zero. Not another file type that you created.

 

NO Kudos for you !

0 Kudos
Message 5 of 7
(1,301 Views)

@Bill2021 wrote:

TDMS will crash LabVIEW 2020 when it encounters a file of size zero.


The following snippet will create an initial file of 0 bytes; when using the TDMS Open it automatically adds a header to the 0 byte file.

¯\_(ツ)_/¯

 

snip.png

 

LabVIEW did not crash when it "encountered" a 0 TDMS byte file; it actually "fixed" the TDMS file and added a header.

 

Check out this one, makes a 0 byte file. ¯\_(ツ)_/¯

 

snip2.png

 

Snap57.png

 

Hmmm....

 

Still think you have other issues.

 

mcduff

 

0 Kudos
Message 6 of 7
(1,290 Views)

I experience the same thing.

A 0 Byte TDMS file was somehow created and the TDMS List Contents leads to a crash to desktop.

LV 2020

 

0 Kudos
Message 7 of 7
(744 Views)