LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file size monitoring on loggig using TDMS

hello NI,

                    i am doing data logging using TDMS file, i want to monitor the file size while i start logging. could you test and reply me? that will be the better solutions to me.

Regards,
Balaji DP
0 Kudos
Message 1 of 8
(3,243 Views)

There's a "Get File Size" function on the "Advanced File Functions" palette, that should be all you need.

 

You can also calculate the file size from the number of channels and their "NI_ChannelLength" properties, but that is more work and less accurate. 

 

Herbert 

0 Kudos
Message 2 of 8
(3,241 Views)

i done by coding as per you said... can you check this code..

 

please, read my mail before reply, i asked this question several time.

Regards,
Balaji DP
0 Kudos
Message 3 of 8
(3,234 Views)

Not sure what mail you're referring to. Code looks ok.

Herbert 

0 Kudos
Message 4 of 8
(3,227 Views)
please dont looks my code, just run this code, then check the error after give me a right solutions.................
Regards,
Balaji DP
0 Kudos
Message 5 of 8
(3,223 Views)

This is a bug in TDMS in LabVIEW 8.6.1. Sorry I didn't see it right away - I was running your VI in a LabVIEW version that hasn't been released yet. The bug will be fixed in the upcoming LabVIEW release. As a workaround, you can approximate the file size by either:

  • Multiplying the number of values you write with 8 (size of DBL) and the number of channels
  • Flattening the waveforms you write and accumulate the length of the flattened strings.
Both will give you the approximate file size in bytes. The first option will give you a number that is a little bit smaller than the actual size, but overall it's pretty accurate. The second option will give you a size that is a bit larger than the actual file. It is less accurate, but it might be safer, depending on what your application will do based on the size.

 

Sorry for the inconvenience.

Herbert 

0 Kudos
Message 6 of 8
(3,210 Views)

oh God,

               actually i am doing datalogging of 16 channels from strain inputs, that will be 1000samples/second, even i can logg the data of 30mins, actually i must monitor the filesize if its exceed some certain limits, i can create newfile then start logging ,for this only i am using TDMS file format, i almost experience that only TDMS file format for very suffecient and userfriendly, also retrivel time too large, for that i can open even 30mb file also....

 

do you have any other idea then suggest me...?

Regards,
Balaji DP
0 Kudos
Message 7 of 8
(3,197 Views)

16 channels * 1000 samples * 8 bytes = ~128kB/s = ~7.68 MB/min = ~230 MB/30min

 

You can easily write a TDMS file with 230MB, so no need to split it up. However, if you do want to spread your data throughout multiple files, you can simply count how many seconds worth of data you have already written and multiply that with 128000 to get your file size in bytes. While I agree that using the Get File Size function would be even better, this seems like a reasonable workaround to me. Unless I'm overlooking something.

 

When you say reading speed is slow, are you reading the whole file at once? In that case,you might get performance problems just because of the amount of memory LabVIEW uses. It might be better to read the file in smaller chunks. You can use the offset and count terminals on TDMS Read for that.

 

Opening the file in the TDMS File Viewer might give you an idea of what reading speed on a portion of the file is.


Balaji DP wrote:

 

oh God,

[...]


Call me Herbert Smiley Wink

 

0 Kudos
Message 8 of 8
(3,188 Views)