06-27-2014 04:45 PM
I am doing continuous data acquisition for potentially hours on end. I am currently set up so that every time I click my "data record" button, a new file is created and written into. I have incorporated a timestamp as part of this file name, but it continuously updates with the computer clock, so a new file is created every second. How do I just grab the timestamp when I click "data record", and not have it continuously update? Attached is a snapshot of my code.
07-01-2014 08:18 AM
Hey Mgonzo,
The behavior you're describing is happening because the string with the timestamp is changing every second. So when the "Write to Spreadsheet File" VI receives the new value (incremented by a second), it checks to see if that file exists, then creates it if it doesn't.
What you want to do is capture the timestamp of when you click the button and keep passing that value to the "Write to Spreadsheet File" VI. Does that make since?
This isn't a very elegant way of solving the problem, but it should work for you. If you go to the LabVIEW forums, you should be able to get some more help from there. Please see the attached screenshots...
If you are not familiar with shift registers here are a couple pages that could help...
http://www.ni.com/video/3235/en/
https://decibel.ni.com/content/docs/DOC-6264
Good luck!
Jeff S
07-01-2014 09:54 AM
Hi Jeff.St,
Thanks for your reply. I actually solved it a different way. My method was to place the routine that updates the filename with the current timestamp in the false case of my case structure, storing the name to a shared variable. Then, when I change my boolean to true, it reads the shared variable, which has the up to date filename.
Thanks.
07-01-2014 12:09 PM
Glad to hear you got it working!
Just to let you know, I think you'll typically receive a faster response for questions like this in the LabVIEW forums.
Good luck with the rest of your application!
Best,
Jeff
09-02-2018 09:58 PM
I've also encounter the same problem and haven't been able successfully utilize your solution. Do you mind to share your vi ?