06-05-2024 07:25 AM
I first apologize for bad practices and inexperience, I'm not an engineer and everything I've learned is via YouTube, but there’s an issue I have with generating a file with timestamps and different input streams that I haven’t solved, and I’d appreciate any feedback.
Hardware:
VI:
The VI is used to do two things:
To do this, used a flat sequence structure, in which I first stablish the order of the stimulation and then the rest of the code executes.
The aim:
To generate a single .lvm file which has a timestamp, the value of the TTL pulse and the instantaneous speed of the disk rotating.
The issues:
I can’t figure out how to generate a single file, since the sampling rates of the two are different; furthermore, I can’t get the timestamps to work, since the first column of the output file (which is supposed to have the time in the unit of seconds) is completely empty and the only way I can record time is adding comments, which is something I can convert, but I’d rather learn how to program better. Example of the output files are in liked as images (header excluded).
Ideas:
I had the suggestion of using a producer/consumer architecture, so that I would constantly be generating an updated file, but I’m still learning how to use those, but this is what I’m doing now.
At the moment, this VI works well enough to do what I want to do; but I want to solve these issues, since I will be recording more variables in the future, and while doable, I’d rather not generate nine different file and write custom scripts to take all of them, when I’m sure there’s a better alternative.
Any comments are greatly appreciated.
06-05-2024 08:21 AM
Good morning, @Fer2401.
Thank you for attaching your LabVIEW code (as opposed to a "picture" of your code). Hoever, as you are a fairly new member of the LabVIEW Community, you might not realize that many of the "old-timers" are not running the latest version of LabVIEW, and cannot open a VI saved in LabVIEW 2023 (or 2024, or 2022, for that matter). However, doing a "Save for Previous Version" and specifying LabVIEW 2019 or 2021 will reach many more of us who would be more than willing to help.
Some comments (since I can't see the code).
Bob Schor
06-05-2024 08:24 AM
Hi Fer,
@Fer2401 wrote:
The aim:
To generate a single .lvm file which has a timestamp, the value of the TTL pulse and the instantaneous speed of the disk rotating.
Any comments are greatly appreciated.
Instead of using LVM I recommend to write your data to a TDMS file. You can write the separate data into separate (channel) groups inside the file. Using waveforms you also write timestamps automatically…
06-05-2024 08:56 AM
Thank you for both your recommendation and your comments, I've attached another version that I think it's for LabVIEW 2019.
As for the rest for your comments, I have the impression that we're doing experiments with a few similarities, but mine is simpler. I did forgot to mention that based on comments by other, I'm (slowly) migrating this entire thing as a state machine and, from what I understand, trying to do a similar thing as you are.
06-05-2024 08:58 AM
Thanks for the idea about other types of files and using waveforms. I'll explore and see what works best. Thank you!