LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reseting "Elapsed Time Express VI" Elapsed Time Output

Solved!
Go to solution

Hi everyone,

 

I use the attached template for my tests and depending of the result of the test i give the chance to the user to repeat the test if failed.

 

I set 5 min to select an option to repeat it and if the user dont select anything, it doesnt repeat the test. 

 

The issue is that if the user wants to repeat it and the test failed again the Elapsed Time Express VI save the elapsed time from the first start of the test, so if the test last more than 5 min and the test VI arrives to the repetition decission, it pass through it and doesnt repeit it.

 

So i need to know if i can use this VI or not (or if im doing something wrong)

 

Thank you in advance.

 

xespizua_0-1747293667745.png

 

0 Kudos
Message 1 of 6
(107 Views)

Hi xespizua,

 


@xespizua wrote:

So i need to know if i can use this VI or not (or if im doing something wrong)


When the VI doesn't work like it should then you cannot used it…

 

On that image of code:

  • Why do the property nodes miss their labels?
  • Why are there so many Rube-Goldbergs?
    Why do you need to OR with TRUE/FALSE?
    Why do you need to AND with TRUE?
  • Why is there a STOP function in your code? Using a STOP in the middle of code execution indicates a bad code architecture…
  • ElapsedTime has a Reset input: do you use this already?
  • Why do you use the ElapsedTime ExpressVI at all? Why not measure the elapsed time on your own using two HighResolutionSeconds functions and a shift register?

Suggestion:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(105 Views)

When the test starts, wire a true value to the "Reset" input of the elepsed time vi for just the first iteration. Best to use a shift register for this.

Message 3 of 6
(93 Views)

Hi GerdW, thanks for answering,

 

  • Just to have more space in the BD.
  • Because if i press Not Ok in the Two button dialog i cant exit from the while loop. ts just an example code to simulate a result of a test. But, yes i can improve a lot my codeS.
  • I know that the STOP function is an example of bad code architecture but it works for me in some cases and i use it just in critical cases with the global variable. But yes, i need to replace that "emergency system".
  • Im doing it, no? I linked the YES button to it. Am i missing something?
  • I thought that was a good option. I'll try with HighResolutionSeconds functions but seems a little bit complex at first...

Regards,

xespizua.

0 Kudos
Message 4 of 6
(73 Views)

EDIT: the Elapsed Time Express VI is linked to the Format Into String function by the Elapsed Time(s) output, not the Present (s) output.

0 Kudos
Message 5 of 6
(54 Views)
Solution
Accepted by topic author xespizua

I solved it with the High Resolution Relative Seconds.vi, easiest than i thought.

 

Thanks GerdW for the idea.

 

xespizua_0-1747304456231.png

 

0 Kudos
Message 6 of 6
(28 Views)