02-27-2026 10:01 AM
dsb@NI wrote:
After targeting your code to my hardware, I am able to run without any additional modifications and without seeing any errors. Sooo, I think you are close. Since this appears to be a performance issue at this point, try these easy steps:
- Increase the number of read/write samples from 2000 to 20000 (this will make your loop time nominally 100 ms).
- Log all the waveforms to TDMS. Prove that you can do the experiment. Prove that you are getting expected data by reading and reviewing the data files.
After the easy stuff is complete, you may be able to call the code 'good enough'.
P.S. I don't think I have been forceful enough with respect to the logging...
Stop trying to write to 5 different text files in a loop that is struggling to keep up. Writing these text files is the slowest part of your code and gates your code performance. Your writing to disk code is also the messiest part of your code and makes the whole diagram harder to read and debug.
Fair enough, and thank you for reviewing the code and providing additional suggestions. Glad to know I'm close! I'm working on figuring out how to convert from TDMS to CSV or txt, which should remedy some of the issues.
03-02-2026 07:01 AM
jecunningham@vt.edu wrote:
Fair enough, and thank you for reviewing the code and providing additional suggestions. Glad to know I'm close! I'm working on figuring out how to convert from TDMS to CSV or txt, which should remedy some of the issues.
There's a TDMS plugin for Excel, else you can do a "Read TDMS and save as CSV" afterwards when timing isn't an issue.