LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to time a case structure?

Solved!
Go to solution

Hi irsa,

 

whenever I press "Reset" the "Time has Elapsed" goes to TRUE for exactly 3s:

check.png

Can you verify this?

 

This would be step 1: verifying the correct working of the ElapsedTime part to generate a signal being TRUE for the time of your measurement.

 

In step 2 you need to check if the data saving works as expected. Did you talk with Jawad on this topic?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 17
(1,528 Views)

With your guidance we are almost near to solve this issue. I verified both the steps for the code attached to this post. Whenever i press "record" it saves for next "6" sec. The only issue now is that alongwith saving those 6 sec, it always save first 5.4 sec data when we press "run" button. I just want to get rid of these almost 5.4 sec data now.

0 Kudos
Message 12 of 17
(1,523 Views)

Hi irsa,

 

The only issue now is that alongwith saving those 6 sec, it always save first 5.4 sec data when we press "run" button.

This is "by design"…

ElapsedTime will start with "time is not elapsed" after each start of the VI.

You need to program a logic to avoid saving data in the first 6s after run!

 

 

Spoiler

Hint:

run time := current time - start time

IF run time < 6s THEN

  don't save

ELSE

  use ElapsedTime condition

ENDIF

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 17
(1,519 Views)

I have created a logic in code but dont know how to give current time and start time as input to case structure used as if else condition.And secondly how to place this condition/case structure in the code. Is it positioned at correct place , i mean outside the loop?The code is attached....

0 Kudos
Message 14 of 17
(1,510 Views)

Can you please convert the logic (given in your last post) to LV code. I am trying but couldnot get it properly. 

0 Kudos
Message 15 of 17
(1,509 Views)
Solution
Accepted by irsa

Hi irsa,

 

I am trying but couldnot get it properly. 

You have a huge problem with THINK DATAFLOW!

Why do you put code, which needs to be executed in your loop, AFTER the loop?

Why do you use controls instead of reading system time?

 

Simple solution:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 16 of 17
(1,504 Views)

Its done perfectly 🙂 Thank you so much

0 Kudos
Message 17 of 17
(1,478 Views)