LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic question TDMS

Hi,

 

i build a small datalogger. It works now fine.

 But i have a strange effect at tdms datalogging. It always stops at around 3h. Sometimes with error 6, sometimes not.

Samplerate is 100 and samples 100,too. So should be 100Hz.

0 Kudos
Message 1 of 13
(3,315 Views)

What version of OS (32/64?)
File size after stopping?
And what file system?
You may have reached the file size limit in your environment.

 

upd:

Also show your source code if it is really small. Maybe there is some kind of mistake

0 Kudos
Message 2 of 13
(3,305 Views)

I´m using windows 10 64bit professionell. Filesystem is NTFS?

Labview is 2016 32bit.

Filesize of tdms is ~15mb after ~3h

0 Kudos
Message 3 of 13
(3,285 Views)

Hi Hulk,

 


@Hulk1978 wrote:

But i have a strange effect at tdms datalogging. It always stops at around 3h. Sometimes with error 6, sometimes not.


You are constantly opening the TDMS file, but you are never closing the file!

 

Open the file once on "start logging" and close it once at "Stop logging", but use the file reference in between!

 

Btw. is there a reason to have a space at the end of the filename of "create path " VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 13
(3,279 Views)

Hi Gerd again,

You are seeing all, the space was not wanted.

---


Open the file once on "start logging" and close it once at "Stop logging", but use the file reference in between!

I´m sorry but i didn´t understand 

0 Kudos
Message 5 of 13
(3,236 Views)

Hi Hulk,

 


@Hulk1978 wrote:

Open the file once on "start logging" and close it once at "Stop logging", but use the file reference in between!

I´m sorry but i didn´t understand


Right now you open a new file ref with each iteration, but NEVER close all those references. Both is bad: no need to open so many references, and each reference you open should be closed too.

 

Simple solution: open the file once when you start to log data, and close the file once you stop the logging!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 13
(3,226 Views)

references.png

 

Note that you could use a shift register in the second loop, but since it's a reference it shouldn't matter for this case.

Message 7 of 13
(3,218 Views)

As a quick further note on references and shift registers:

  • While loops will always execute at least once. So a tunnel is fine provided you wire it through
  • For loops can execute zero times (depending on the way their iteration count is controlled - e.g. empty array set to autoindex). This means that the value out of tunnels is the "default default" for the type, which for a reference is invalid. So use a Shift Register with a For loop even with references if the number of iterations can ever be zero (even if you don't expect it to be zero).

GCentral
Message 8 of 13
(3,197 Views)

Hi guys,

 

i tested the version with permanent open and close the tdms file. That´s not possible. System performance is going down.

The second solution is not possible because i need to open the file inside of while loop. I´m sending the path from the event struct.

Any other solutions? 

0 Kudos
Message 9 of 13
(3,154 Views)

@Hulk1978 wrote:

i tested the version with permanent open and close the tdms file. That´s not possible. System performance is going down.

The second solution is not possible because i need to open the file inside of while loop. I´m sending the path from the event struct.

Any other solutions? 


Naturally, it is crazy to open and close the file at every step.
It is very possible to open the file “before” the cycle, for this you need to learn two simple mechanisms: a state machine and a shift register.
Here are three cases in ONE loop. You do not need to do three separate cycles, I showed them only to understand what is happening in hidden cases.

sm.png

Message 10 of 13
(3,151 Views)