cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS files

KS200
Member

TDMS files

Message contains an image

Hello, I want to log data into a TDMS file every time I click a button, but the file is being created multiple times.

Thank you, 

KS200_1-1713529774111.png

 

 

13 REPLIES 13
GerdW
Knight of NI

Re: TDMS files

Hi KS200,

 


@KS200 wrote:

Hello, I want to log data into a TDMS file every time I click a button, but the file is being created multiple times.


Because that's what you do in your VI: create a new TDMS file using the timestamp in the filename…

 

When you want to log into one (1) file then you should create the file once before the loop!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
KS200
Member

Re: TDMS files

Thank you. If I want to create a new file each time I click a button, how do I do that? Because when I try to create it before the loop, only one file is created. If I click the button again, no other file is created.

GerdW
Knight of NI

Re: TDMS files

Hi KS200,

 


@KS200 wrote:

Thank you. If I want to create a new file each time I click a button, how do I do that?


Then you create a new file when you click the button (inside a case structure).

Hint: Use a latching button on your front panel…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
ZYOng
Trusted Enthusiast

Re: TDMS files

Message contains an attachment

You can use Boolean Crossing PtByPt VI to detect the rising edge of your shared variable signal.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
KS200
Member

Re: TDMS files

Hello, I tried both solutions and I can create a file each time I click the button, but the file only contains one value each time. How can I fix that? Thank you.

GerdW
Knight of NI

Re: TDMS files

Hi KS,

 


@KS200 wrote:

the file only contains one value each time. How can I fix that?


Write more data/samples to the file!

 

Maybe the more reasonable help would be to analyze your code. Unfortunately you don't show it to us…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Highlighted
KS200
Member

Re: TDMS files

Message contains an attachment

Hello, I am using this VI, thank you 

GerdW
Knight of NI

Re: TDMS files

Hi KS,

 

please downconvert your VI and attach again.

 

(Many of use don't use the latest LabVIEW versions due to license issues, so you should downconvert to LV2021 or older. I prefer LV2019.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
KS200
Member

Re: TDMS files

Message contains an image

Hello, I am going to look into how I can do that. In the meantime, here is an image of the VI. Thank you.

KS200_0-1713775549233.png

KS200_1-1713775563826.png