LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elapse time express vi

hello all,

 

iam using the time elapsed express vi since i need to verify that certain variable changes in a predifined time interval.

iam using a state machine for this,

1 state user must input a couple of parametes, and press a control to start the test.

(if the change on the variable happens before the time then is a good test)

now that means that the express vi time unless the test fails wont be able to reset;

2. after the respective dialog (regarding the result of the test are being displayed to the user) it goes to the state to wait fo the start control,

but the value of the time does not start from zero like the first time, it starts from the value it reached last time,

 

i have tried numerous work around (many of them out of pure frustration)

1. save the vi, set it as rentraint, and non-rentraint (no luck on neither)

2. tried to set all the values ot the vi to defaults (before the test) nothing

3. i was suspecting the vi to be in memory (and not closed completly) so i tried to close it via property node,

4. tried to play woth the reset, and the reset after time has elapsed (nothing)

 

any help in this will be greatly apreciated.

0 Kudos
Message 1 of 42
(7,206 Views)

If you post your code we will take a look and see what we can do to help. If you can not post your code some screen shots would be nice so that we are not guessing why your vi does not reset.

Tim
GHSP
0 Kudos
Message 2 of 42
(7,179 Views)

thanks for responding tim;

 

here i upload a screen shot of the state where the test is happening, where user sends comand, front pannel.

 

hope this helps.

 

thanks

 

Download All
0 Kudos
Message 3 of 42
(7,164 Views)

Hi Caluctra,

 

Try moving your Get Date/Time in seconds VI inside your inner while loop. With your current set-up, it will continue to base the time elapsed on the first time it obtains the timestamp before the while loop executes. 

0 Kudos
Message 4 of 42
(7,139 Views)

alisa thanks for replaying.

 

that did not solve the problem

here i send you a pic of a simple experiment.

a switch in which i want to switch it on and off  (for 3 seconds each state) three times

i have it inside a for loop.

the first iteration it switches both on and off state at three seconds exactly,

now the second iteration and third, it wont switch and the timing indicator hangs.

 

i have not been able to solve this timing issue.

please help

0 Kudos
Message 5 of 42
(7,108 Views)

Hi caluctra,

 

1) you don't need to wire start time, it's already fetched inside the express VI (in the exactly same fashion!)

2) there's a reset input for the express VI, and there's a reason for!

3) RTFM! (aka context help) Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 42
(7,092 Views)

I finally solved the problem.

thnaks for your help.

0 Kudos
Message 7 of 42
(7,069 Views)

Hi Caluctra,

 

I think the problem you're seeing now is due to the fact that the first frame automatically resets as soon as the time elapses. Therefore, the Time Elapsed VI in the first frame is counting time (from when it automatically reset) as the second frame executes. By the time it gets back to the first frame,the time has just barely elapsed and it quickly moves on to second frame again, therefore always appearing to be in the second state after the first iteration of the for loop.

 

You can get the behavior you expect by adding a shift register that preserves the "Time has elapsed" boolean for the next iteration of the while loop. This can be used as an input to Reset so that the Time Elapsed VI resets itself whenever it reached its time target the last time the while loop ran. I have shown how I altered your code in the picture below.

 

resetTime.png

0 Kudos
Message 8 of 42
(7,069 Views)

Glad you were able to find something that worked for you 🙂

0 Kudos
Message 9 of 42
(7,064 Views)

Hi caluctra,

 

did you spot the classic RubeGoldberg in your "solution" picture?

IF true THEN true ELSE false

 

You're not familiar with boolean logic, don't you?

Best regards,
GerdW


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