LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FGV timer usage

Solved!
Go to solution

I made a FGV timer and add it in the main VI.

However, I can not see the real time elapsed time as well as the "has time elapsed?" working...

 

now I know how to make a FGV, but not sure how to use it..

thanks so much!!!!

0 Kudos
Message 1 of 14
(3,216 Views)

Hi idjuven,

 

You timer FGV is fine, you just need to move the controls in your main into the loop so they are read every iteration. If you controls are outside the loop, they populate the loop tunnels with static values. Once inside the loop, those controls are never read again, so they retain whatever initial value they have.

 

If you turn on highlight execution or probe those inputs, you'll see the values coming from the tunnels on the left side of the loop don't change with changes to the front panel control state.

 

Modified code attached.

Regards,
0 Kudos
Message 2 of 14
(3,204 Views)

Thanks...

but when I run the VI.. I am still not able to see the change iin the indicators on the front panel..

0 Kudos
Message 3 of 14
(3,198 Views)
Solution
Accepted by topic author idjuven1

idjuven1,

 

When you start the VI, make sure the enum is set to "start" and the target time is something reasonably high (10s works well). Then, once you have started the VI, change the enum to "Read Time". That will then start updating the indicators.

 

Regards,
0 Kudos
Message 4 of 14
(3,182 Views)

idjuven1,

I forgot to mention I also changed the boolean constant on the stop button of your FGV from F to T. If you set this to true, the loop inside your FGV will run indefinitely and will never return any values to the calling VI. You want your FGV to execute 1 iteration per call and then call it in a loop if you need to query it more often.

 

Regards,
Message 5 of 14
(3,180 Views)

I am still struggling with how to use the FGV timer..

 

as enclosed, I remove the case structure, now the timer should reset first and start timing, right?

 

why it is not working???

 

 

THanks and have a nice weekend,

0 Kudos
Message 6 of 14
(3,137 Views)

your version works well..

 

but in a big application, I cannot always use a case structure, right?

0 Kudos
Message 7 of 14
(3,136 Views)

Every time you loop in the while loop, it resets the FGV. Try moving the FGV with the "start" input outside the while loop to have more success. 

C. Weeks
Product Support Engineer
NI
Message 8 of 14
(3,111 Views)

Thanks so much!!!

 

so if I wanna use this in a large VI.. should I always reset it first and then read time in a while loop?

 

 

0 Kudos
Message 9 of 14
(3,104 Views)

Yes, that's how you'll do it

C. Weeks
Product Support Engineer
NI
0 Kudos
Message 10 of 14
(3,095 Views)