02-28-2012 09:58 AM
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.
02-29-2012 12:26 PM
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.
03-02-2012 11:24 AM
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
03-05-2012 05:01 PM
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.
03-12-2012 10:11 AM
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
03-12-2012 10:43 AM - edited 03-12-2012 10:47 AM
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) ![]()
03-14-2012 11:44 AM
I finally solved the problem.
thnaks for your help.
03-14-2012 11:44 AM
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.
03-14-2012 11:47 AM
Glad you were able to find something that worked for you 🙂
03-14-2012 01:29 PM