01-10-2020 03:54 AM
Hello all,
I'm having some issues with the logging VI in the Continuous monitoring and logging sample project.
The system time stamp is logged at a higher frequency than the actual data that that is logged.
You can see that the "Untitled-DT string" has 25 samples while the other ones, only one. The second print screen has the "a lot of time" printed and not a lot of data.
The third printscreen is the addapted Log Data.VI from the CML sample project..
If I add a Wait(ms) then I can't log the rest of the data.
If you've encountered this before, can you suggest me how to fix this?
Thanks,
Dragos
01-10-2020 05:01 AM
Hi Dragos,
your "Untitled" string has a length of 25 (where does that come from?) while all other items only have a length of 1: this corresponds to your 2nd screenshot showing the data table.
On the blockdiagram: what's the point of the inner while loop?
01-10-2020 05:29 AM
Hi Gerd,
Thanks for the reply,
The "untitled string" is the time stamp string that's logged with the Write TDMS. yes, they correspond to each other from the two print screens.
With the while loop i'm planning to get new timestamp string for every new measurement.
Dragos
01-10-2020 05:46 AM
Hi Dragos,
@DPetrutiu wrote:
With the while loop i'm planning to get new timestamp string for every new measurement.
But as the loop only iterates once (per call of the case structure) it is pointless (or "Rube-Goldberg")!
As that timestamp string array written to your TDMS file contains only one element: where does that "length=25" entry come from?
01-10-2020 06:06 AM
Hi Gerd,
I've removed the while loop, from the case structure and tried it again.
The "length=25" comes from the how much time I let the program run.
If i leave it longer, the length of string array increases, and same as the other values.
If I'm running the same code, in the unaltered CML sample project, I get it running well (timestamp and all).
The thing is, that currently I'm modifying a code written to log hardware data.
I've tried time sequences also to "slow down" the writing of the time stamp to the TDMS file. No success on that either.
01-10-2020 06:26 AM
Hi Dragos,
@DPetrutiu wrote:
The "length=25" comes from the how much time I let the program run.
If i leave it longer, the length of string array increases, and same as the other values.
The array (as seen in the image above) will always contains just one single element!
The number of items in the TDMS file might get larger…
Why don't you wire group labels to those TDMS functions?
Why don't you attach your whole project (as ZIP)?
01-10-2020 06:33 AM
Hi Gerd,
Really appreciate your help. I'm attaching the .zip with the whole project.
Just changed the Log File.VI to this:
Will deploy it on the PC that contains hardware and try it out. Let you know if it works.
Thanks,
Dragos
01-10-2020 06:58 AM
Hi Gerd,
The last changed modified the TDMS file, with the timestamp at the start of the log file. Unfortunately, same as before, there was more time logged than samples.
The DT_string is 74 now, which means I left the program running longer, around 3-4min.
With the while loop there, and a Wait(ms) block at 60000ms = 1min I got the following:
Thanks,
Dragos