LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get one elapsed time for two loops OR MORE

Excuse me i don't know where are my left and right hands 🙂

0 Kudos
Message 11 of 24
(1,388 Views)

thanks Smiley Happy

 

what did you mean by FGV

0 Kudos
Message 12 of 24
(1,384 Views)

An FGV is a "Functional global variable"

 

An FGV has to have :

1. Uninitialized shift registers

2. While loop wich is executing only once (with a TRUE wired to the stop condition)

3. Usually an enum type which correspond to your states machine

 

The FGV stores its data between successive runs of the VI as long as the VI remains in memory.

 

BR,

Vincent

0 Kudos
Message 13 of 24
(1,378 Views)

i want to have one elapsed time for 2 indicators,that's my problem.

for each indicator ,there is 1 condition in order to make the elapsed time for maintain starts.i want to have 1 maintain for both of the indicators,so when the 2 conditions happen in the same time(1st indicator  at 30 and the other at 7) then the maintain starts and if he keeps thoses values for 10sec then the user get the maintain

 

how to do that especially that i have 2 while loops and 4 case structures Smiley Sad

0 Kudos
Message 14 of 24
(1,346 Views)

Hi achfire,

 

Have you tried implementing a functional global variable, and other suggestions by Vincent? 

Kevin S
Applications Engineer
National Instruments
0 Kudos
Message 15 of 24
(1,322 Views)

i tried but i think i didn't know how to really use FGV,where exactly to implement it,and what to do to retrieve data from the conditions from 2 loops to put them in 1 elapsed time;so it starts just when the 2 conditions are true

0 Kudos
Message 16 of 24
(1,314 Views)

Hi achfire,

 

Do you think you can post what you have with the FGV implemented? Once your code is posted, we can point you in the right direction regarding your current use of the FGV.

 

Here is a community example showing the basic implementation of a FGV

https://decibel.ni.com/content/docs/DOC-2143

Kevin S
Applications Engineer
National Instruments
0 Kudos
Message 17 of 24
(1,297 Views)

i will try,even if i don't get the point of using FGV to get one elapsed time for 2 loops

0 Kudos
Message 18 of 24
(1,283 Views)

Hello everybody,

Like i already told you in personal messages, the use of the FGV will allow you to detect your events with an event loop.
A way to solve your issue is to build an FGV which gonna work as a chronometer. Different states for this FGV could be

* Set time (where you launch the time)
* Get time (where you get the current time)
* Stop/Pause time (where you pause time)
* RAZ time (where you reset time to 0)

There are several ways to do this, this is a possibility. afterwards, we don't understand 100% your problem because i think you don't know what's yours as well.

We could help you if you are giving us some code to comment, we won't do your code !

 

Edit ;:

Like a told you several times, your "2 loops" architecture is wrong or your way to develop it, is. That's why you need to start again your architecture.

BR,
Vincent

0 Kudos
Message 19 of 24
(1,262 Views)

Hi everybody

 

i tried to use just 1 loop as vincent told me,i think i'm missing just a little thing because the maintain is counting when both conditions of variometre and horizon artificiel are true,but for some reason the moment i reach 7 (the condition of maintain for the right one) the pointer of the left one goes directly to 30 which is the condition of maintain for that one,consequently i get the maintain but it's like the condition of the variometre controls the other condition,how to avoid that

NB:i will try this last solution then i will use FGV .

 

2.png3.png

0 Kudos
Message 20 of 24
(1,246 Views)