LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sotore loop number for use at a later time

Solved!
Go to solution

Hi all,

I would like to display the number of iterations which have ocurred within an infinetely running loop from the time a button is pressed and held.

In the attached vi, the idicator "Iteration number since bottom pressed" shows almost what I want, except that the count does not start at 0 as I would like to. For that I need to substract the loop number at the moment the button was pressed. How can one get access to this value (loop number at the time the button is pressed) and substract it to the running loop number?

 

Thank you very much in advance!

Richard

 

 

0 Kudos
Message 1 of 5
(2,480 Views)

Hi richard,

 

How can one get access to this value (loop number at the time the button is pressed) and substract it to the running loop number?

Two notes:

- to store values in loops and use them in the next iteration you should use shift registers

- when you want to store the iteration count at the time the button was pressed you need to check current button state and compare with previous one ("IF now is TRUE AND was FALSE before THEN…"). Or use thiat BooleanCrossing function…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,473 Views)
Solution
Accepted by topic author ricardo81

Here's a quick example. (you don't even really need the event structure)

0 Kudos
Message 3 of 5
(2,464 Views)

Thank you very much, that's exactly what I needed!

Richard

 

0 Kudos
Message 4 of 5
(2,444 Views)

Thank you, I appreaciate it!

0 Kudos
Message 5 of 5
(2,443 Views)