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,
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!
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.
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…
You can use Boolean Crossing PtByPt VI to detect the rising edge of your shared variable signal.
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.
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…
Hello, I am using this VI, thank you
Hello, I am going to look into how I can do that. In the meantime, here is an image of the VI. Thank you.