Jump to content

Create a new spreadsheet file with header each time a button is pressed

Recommended Posts

Hi, i'm fairly new to Labview and i'm currently stucked in a problem that i think is very simple but to which i can't find a simple solution.

I'm using a data acquisition device to get measured temperature, force, pressure and i would like to save those data (with header) on a spreadsheet file when i press a button (the "write to file" button in the Vi attached) and stop recording data when unpressed. I can now do this but if i stop and restart the recording the new data are just appended to the previous file without header, so i cannot distinguish when a new recording started.

Actually what i wanted to achive with this Vi was to automatically create a file with a specified name (with header wich is only present one time in it) that is changing to each press of the button and without asking for a new path for every new file.

Is there a way to simply do this?

thank you.



MVB.vi così.txt

Edited by Manuel Aiello
Link to comment
  • 2 weeks later...

Couldn't view your VI as I don't have LabVIEW 2020 installed on this machine but you want to basically detect that the boolean you use to find out if you want to write to the file has switched from false to true. An edge detector is very simple to do with a feedback register like this. Change the boolean inputs inversion to detect the falling edge.

When the rising edge boolean is true, write your header and then the data, otherwise only write the data.

rising edge detector.png

Edited by Rolf Kalbermatter
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.