10-25-2018 10:06 AM
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!!!!
Solved! Go to Solution.
10-25-2018 10:21 AM
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.
10-25-2018 10:25 AM
Thanks...
but when I run the VI.. I am still not able to see the change iin the indicators on the front panel..
10-25-2018 11:02 AM
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.
10-25-2018 11:07 AM
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.
10-26-2018 01:15 PM
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,
10-26-2018 01:16 PM
your version works well..
but in a big application, I cannot always use a case structure, right?
10-29-2018 09:45 AM
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.
10-29-2018 10:15 AM
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?
10-29-2018 01:09 PM
Yes, that's how you'll do it