11-19-2023 03:01 AM - edited 11-19-2023 03:02 AM
Hello everyone,
I would like to record data depending on the runtime of the programme and then output it in a txt document. Unfortunately, for reasons that are not entirely clear to me, the value of the clock that I use as an index is reset to 0 at random times (sometimes around 31000, sometimes around 72000).
Can anyone tell me if there is an explanation for this reset?
Or if there is a better way to record and output the current runtime of the programme in milliseconds?
Have a nice day together and I hope you see what I have overlooked
Josi
11-19-2023 07:05 AM
Why don't you use Elapsed Time Express VI instead?
11-19-2023 07:20 AM
You are logging the very same data multiple times. You forgot to initialize the shift register to an empty array. As a consequence, new data in the inner loop are added to the whole history of already accumulated data.
11-19-2023 08:28 AM
There are several problems with your code. Some have already been mentioned, but there are other problems (more fundamental).
Here is a Simple Elapsed Timer example. I'm deliberately saving it as a simple "picture" to encourage you to open the Timing Palette, look at the offerings, drop down some of the functions, and read the Help to understand what they do. Then predict what the value of "Elapsed ms" will be -- I almost guarantee you'll be off by at least 8 ms. For "Extra Credit", explain this.
Bob Schor
11-19-2023 12:38 PM - edited 11-19-2023 12:47 PM
@J0SI wrote:
Or if there is a better way to record and output the current runtime of the programme in milliseconds?
So please tell us all the control values you are using, how you run it, what you see, and what you expect to see instead as result. Where is the "data" you mentioned coming from?
11-19-2023 01:29 PM
Oops. My second bullet point shows that I was confused, not the Original Poster. Yes, the High Resolution Relative Seconds is in seconds, but multiplying it by 1000 (of course) turns it into milliseconds, which is probably what the OP intended.
Bob Schor