LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get one elapsed time for two loops OR MORE

I'm calculating the time spent to maintain a value "elapsed time" for 2 things(A and B) differents,what to change in order to have 1 "elapsed time" not 2 ,so the value of "elapsed time" is caculated the moment the user maintain the value of A and B1.png

0 Kudos
Message 1 of 24
(4,153 Views)

Your question is not clear at all. Also please attach your Vi instead of pictures.

 

(e.g. explain what you mean by "maintain".)

0 Kudos
Message 2 of 24
(4,136 Views)

If you just want to update "MAINTIEN 2" in both cases (A and B) you can use a local variable for MAINTIEN 2 in the B case and write to that.

But I'm also not sure I understand your problem correctly.

 

0 Kudos
Message 3 of 24
(4,113 Views)

My VI is already attached

 

Elapsed time 2 is calculated when the user starts the test of "variometre",maintien 3 when the user keeps the pointer of the variometre in 7 for 10 seconds

Elapsed time  is calculated when the user starts the test of"horizon artificiel",maintien 2 when the user keeps the pointer of the horizon in 30 for 10 seconds.

that's good if i wanna each test alone,but now the complication of this one is to maintain the 2 values 7 of the variometre and 30 of the horizon in the same time during 10 secs.that's why i want to have just 1 elapsed time and 1 maintien,because the the 2 tests will run on parallel then the elapsed time must start and when the user realises the 2 conditions in the same time,the maintien must begin counting.

 

 

1.png

0 Kudos
Message 4 of 24
(4,101 Views)

Right click on the Elapsed Time Express VI and choose "Open Front Panel".  It will ask if you want to convert from an Express VI.  Do so.  In the new VI, open the VI properties and change the execution to not be reentrant.  Save this VI somewhere in your project.  Now replace the other Express VI call with your new VI.  They will now use the same instance of the Elapsed Time VI (your project specific one) and you will only have 1 timer.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 24
(4,087 Views)

i did it but it seems that it doesn't work.the moment i changed the Elapsed time to VIs,the main VI didn't work exactly the joystick it doesn't work anymore1.png

0 Kudos
Message 6 of 24
(4,041 Views)

Hi archfire,

 

Could you please be more specific on what you are looking for and what exactly seems to be the issue? I understand that the joystick does not work, but what is incorrect? Can you please post what the expected behavior should be and what is currently happening?

Kevin S
Applications Engineer
National Instruments
0 Kudos
Message 7 of 24
(4,010 Views)

It is really not clear what you want, but here are some ideas:

 

  1. Wiring the millisecond timer value to the start time input makes absolutely no sense (you do this in two places! Why???!!!!). The value there is completely random.
  2. The elapsed time express VI is reentrant, so if you only want one per loop, maybe you should place a single instance before the inner case structure.
  3. If you would leave the stop buttons at latch action, you would not need the property nodes. Why did you change it from the default action?
  4. Your "numeric" and "numeric 2" belong in shift registers, no need for local variables.
  5. ...
  6. ...
  7. ......
0 Kudos
Message 8 of 24
(4,003 Views)

for the elapsed time when the VI starts is not a problem.the problem is the maintain(the 2nd elapsed time) that i want calculate

what i'm looking for is:i wanna calculate the elapsed time for the student to maintain the 2 values in the same time 30 in the right one and 7 for the one on the left.so the counter of  elapsed time that i'm calling in the VI maintain shouldn't be calculated until the user could reach the 2 values 30 and 7 then the counter begins.the problem that i have is the moment i reach 30 or 7 the counter of maintain starts,i don't want that.

0 Kudos
Message 9 of 24
(3,990 Views)

Hi achfire,

 

You need to code with clearer ideas.

What i suggest you to do :

1. Put all your commands on the right of your VI

2. Put all your indicators on the left of your VI

3. Use SubVi to all code you are using several times (name ur subVIs by there functions)

4. Try to make your code good looking in a 19"screen !( try to avoid using scroolbar)

5. Build an FGV which calculate your time elapsed

6. Do the maths in order to run your VI as you are expecting !

 

PS: Adding comment could be awesome when you are sharing your code like here but for maintenance issues as well 🙂

Good luck !


BR,

Vincent

0 Kudos
Message 10 of 24
(3,972 Views)