LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check when the loop starts

Solved!
Go to solution

Hello.

I want to make a list of when the while loop starts, but I've been thinking about it for hours because I don't know how to do it.


repeat         start time
0                00:00:00
1                00:00:05
2                00:00:10
3                00:00:15
4                00:00:20

 

I attached my failures.

If you can help me, I will be very delighted.

Thank you!

0 Kudos
Message 1 of 10
(3,314 Views)
Solution
Accepted by topic author kimtae

What do you want to do with this information. Just display it on the screen, log it to file, or something else?

 

You were pretty much there unless I misunderstood something. I have attached an amendment which shows the iteration number next to each time stamp.

 

Something to note is that building an array inside of a loop which potentially runs forever is asking for trouble because eventually your array will get so big you run out of memory. If you are going to do something like this in anger I would definitely limit the size of your array so that you don't run out of memory

0 Kudos
Message 2 of 10
(3,294 Views)
Solution
Accepted by topic author kimtae

You need to explain in detail what you want to achieve. A list of what?

Also: your loop starts only once and never stops, so there is only one start time.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 10
(3,291 Views)
Solution
Accepted by topic author kimtae

Hi kim,

 

you are halfway:

(That's not the final solution, but will show the next steps…)

Best regards,
GerdW


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

Thank you so much for the tip.

I am relived to hear that Im halfway not wrong way.

And it worked well!!

Thank you!

 

Best regards.

Kim

0 Kudos
Message 5 of 10
(3,277 Views)

 

 

 

0 Kudos
Message 6 of 10
(3,273 Views)

Thank you for your comment!

Actually, my version is 2015. So I can't look inside your file.

I'm so sorry.

But your explanation helped me a lot. Thank you very much!

 

When a customer creates a 10-second pattern, it is repeatedly executed in LabVIEW.
Looking at the resulting graph, it seems to work normally (Figure 1).
However, the actual time is about 13 seconds.
So we wanted the actual running time of one loop.

The program configuration repeats the loop once per second.
Wait Until Next ms Multiple Function is set to 1000 ms (Figure 2).
It seems to me that Wait Until Next ms Multiple Function(1s) + other actions within the loop (0.3s) = 1.3s.

Can you tell me how can I calculate the time it takes for 1 iteration (10 points)?

kimtae_0-1637834126380.png

 

kimtae_1-1637834126360.png

 

 

0 Kudos
Message 7 of 10
(3,269 Views)

Thanks for the comment!
I wrote the question again in another comment.
The loop I was trying to make repeats once per second
It's actually a problem that takes more than 1 second.

Is there any way to find out how much time has elapsed in 10 loops (10 points)?

 

Best regards.

Kim

0 Kudos
Message 8 of 10
(3,262 Views)

Could I get a hint on how to get the time it takes to iterate this loop 10 times?

0 Kudos
Message 9 of 10
(3,260 Views)
Solution
Accepted by topic author kimtae

Hi kim,

 


@kimtae wrote:

Could I get a hint on how to get the time it takes to iterate this loop 10 times?


Take the timestamp before and after that loop and subtract both values…

Best regards,
GerdW


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