01-05-2022 05:49 AM
Solved! Go to Solution.
01-05-2022 10:51 AM
Hi boyy,
@Labviewboyy69420 wrote:
My problem before this is finished, is that the time and date is repeated an average of 10 times before it continues (shown in picture). The time/date should only sample and write 1 time before it "moves on" sampling and writing the data values.
You are writing the same timestamp to the TDMS file several times inside the loop.
And this loop may iterate very fast several times due to those autoindexing inputs - faster than the clock will update. (Especially as you write only 3 digits for milliseconds…)
@Labviewboyy69420 wrote:
Please attach all files directly to your message in this forum!
Most people refuse to open 3rd party download links, many people are prohibited from opening such 3rd party download links (due to company firewalls)…
01-05-2022 04:37 PM
What is the point having a For Loop that only does 1 iteration?
01-06-2022 01:49 AM
The additional FOR loop was sort of a last effort to try and control the data flow, since I suspected that it sampled a timestamp per channel reading. To elaborate: there are 10 channels of boolean data and there is an average of 10x copied of each timestamp. The way I’ve designed it (without the additional FOR loop) is to have 1 timestamp for each data smaple of all 10 channels in the DAQassistant.
01-06-2022 05:13 AM
The additional FOR loop was sort of a last effort to try and control the data flow, since I suspected that it sampled a timestamp per channel reading. To elaborate: there are 10 channels of boolean data and there is an average of 10x copied of each timestamp. The way I’ve designed it (without the additional FOR loop) is to have 1 timestamp for each data smaple of all 10 channels in the DAQassistant.
01-13-2022 03:30 AM
Hi, I expanded the millis and it's still identical, It writes the same stamp 10 times and not 10 different timestamps. I'm fairly certain of this.
01-13-2022 05:18 AM
I never used TDMS files, however I guess you should write the timestamp only once for each iteration of the While Loop, since the acquisition timestamp is actually the same for all 10 channels.
01-18-2022 07:39 AM
After some of the feedback and just trying different things I solved it by: Having a foor-loop with N=1 for time (since the timestamp is to be sampled once, then a for-loop with N=10 for the samples, since one stream of boolean values have 10 channels.
Thanks to all for your input!
01-18-2022 10:18 AM
Hi boyy,
@Labviewboyy69420 wrote:
Having a foor-loop with N=1 for time (since the timestamp is to be sampled once, then a for-loop with N=10 for the samples, since one stream of boolean values have 10 channels.
Two comments:
01-18-2022 10:28 AM
1. The first for loop might be unnecessary.
2. I don’t need to for the loop to funtion. But aestetically on the spreadsheet, this isolates the timestamp sampling from the boolean sampling and results in a single timestamp for all 10 channels per reading (loop count).