LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble using shift register with a elapsed time on first interaction

Hi, I'm making a VI that executes a case structure every time the elapsed time completes it's timer. Thing is, I want the first interaction to take the "inicial time" value, and all future interactions to take the "interval" value.

 

To do this I set a number control to start the shift register and other to continuously change the timer as I want. Unfortunately the "initial time" is not working and the program is running the "interval" directly. Does anyone knows why this is happening?

0 Kudos
Message 1 of 4
(682 Views)

Can you share the Down-converted VI in LV20 or lower, Not all the users will have the latest version of LabVIEW.

 

In Simple you can have a Boolean Shift register initialized with True in the start of interaction and make it has false once the first iteration is completed.

 

The case can be executed if either of the Boolean is true ( Shift register value/Elapsed Timer Value)

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 4
(640 Views)

I don't know if you meant this, but I can't open your Vi because I don't have the 2023 version.
In my VI the first time has an Elapsed Time of 2 seconds and the next times it will have a delay of 5 seconds.
Send me something if you don't understand.

Message 3 of 4
(627 Views)

To do this I set a number control to start the shift register and other to continuously change the timer as I want.

> Unfortunately the "initial time" is not working and the program is running the "interval" directly.

> Does anyone knows why this is happening?

 

On the first iteration of your inner timer loop the Time Target is set to the value of Initial time.

Then the value of Interval is put into the shift register.

On the second iteration this new Interval value overwrites the Initial time value.

This is why you never see the Initial time interval.

 

This can be prevented by using the Time has Elapsed Boolean.

See attachment.

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 4
(572 Views)