LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How i can measure time and save the result

I want to measure time on labview, with 1ms accuracy.
I want that there is boolean start and stop and after measurement it saves result to the file.
Timer resets when measurement starts again.

sorry my english..thanks
0 Kudos
Message 1 of 15
(3,618 Views)
Hello Jani,

make a sequence of 4 frames:
1) wait in a while loop for the start button
2) get actual time with "Get Date/Time in seconds"
3) wait in a while loop for the stop button
4) get actual time with "Get Date/Time in seconds"
now get the difference of both time values and save this value with your favorite "Write to File".

You can put all this in a while loop for making more than one time measurement...
Btw, this method depends on timing accuracy of the operating system, so you might get less than 1ms accuracy.

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 15
(3,618 Views)
thank you, that was exactly what i was looking for.
0 Kudos
Message 3 of 15
(3,618 Views)
I have other things in my file also, like while loops or case structures. If i use this 4 sequence frames, my file do not work. what is the problem?
0 Kudos
Message 4 of 15
(3,618 Views)
Hello Jani,

there may be many reasons, most probably data dependencies...
You should post your vi here in the forum so we may have a look at it.

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 15
(3,618 Views)
Ok, here it is, first I give the filename, like
c:\test.txt

then i press Start, get the data(simulation)
and Stop, i want to measure time between those signals. But now the system is not working, latch control do not work...
0 Kudos
Message 6 of 15
(3,618 Views)
Hello Jani,

at a first look before lunch:
you have to check the start/stop condition inside the while loops of the timing sequence. Your sequence will run forever at the moment, because it starts immediatly with the initial values of Start/Stop.

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 15
(3,618 Views)
Hello Jani,

now I did some changes to your vi...
But it will need some work from you.

The start/stop is checked inside the timing sequence. You have to add a better "End Program"-check, because at the moment the vi will stop only after a measurement has been finished (not immediatly, when you press the "Program stop"-button).

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(3,618 Views)
Sorry, but i have version 7.0 and you have 7.1 ?
i cant open your file.
0 Kudos
Message 9 of 15
(3,618 Views)
Here comes the 7.0 version...

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 15
(3,618 Views)