11-19-2009 12:42 PM
Hello -- I have an event loop with a 50ms Timeout at which time, my target hardware is polled for data over a USB interface, and the resulting data is plotted on an X-Y chart. The update rate is good and acceptable, but whenever I click on a front panel item (a dropdown, or a boolean), the update rate gets REALLY FAST as long as I keep the mouse clicked. I'd love to have this improved update rate during normal operation, but cannot seem to understand why it's happening, and how I might be able to induce it. CPU loading is not significantly impacted while the update rate is improved.
Thanks
-Ted
Solved! Go to Solution.
11-19-2009 01:04 PM
A loop with an event structure spins when a timeout occurs or when one of the other events fires. This also means that the timeout only occurs in regular intervals if nothing else happens.
Your description does not make a lot of sense. Can you attach a very simple VI that shows the problem. What are types of events are the other event cases? What do you mean by "keep the mouse clicked"? Does the polling occur in the timeout case or elsewhere?
Does it also get faster when you lower time timeout value?
11-19-2009 01:17 PM
Hello -- Thanks for the reply.
I've attached a screengrab of the top level VI which has the loop. Normally, unless there's user interaction, this loop just polls the hardware for data. Qualitatively, I can say that after lowering the timeout value, the response improves, but only to a certain point.
Now, say I click on one of my front panel dropdowns. As long as I stay clicked on that dropdown (the mouse button is pressed), the update of my graph improves significantly. Once I release the mouse, the update rate revers to the slower rate.
I will try and build a simple vi that can hopefully replicate the problem, but because I am so intertwined with the USB operation, that might be difficult to do.
No other events should be firing during operation (except of course for the mouse down-event when I click on any front panel control).
Regards
-Ted
11-19-2009 01:44 PM
Could you show us where that wire under the label "setup" is coming from?

Ben
11-19-2009 01:51 PM
11-19-2009 02:21 PM
tpascaru wrote:
Hi Ben -- "Setup" is my Functional Global Variable that outputs a cluster of about 5 items that control certain parameters in the VI. One of them is the update rate of the display which gets hooked up to the timeout value of the Event Loop.
Does the FGV get touched somewhere in that code?
It seems like it is getting set to zero.
Ben
11-19-2009 02:29 PM
11-19-2009 02:37 PM
In your first post you said the update rate improves.
There is an indicator being updated in that default case.
Is that the indicator you are reporting as updating faster?
If not forget about me, I'll just fade back into the background.
Ben
11-19-2009 03:51 PM
Hi Ben: Thanks for the feedback. There are several indicators that exhbit improved speed. I actually tied an indicator to the iteration counter of the outer while loop, and for whatever reason, the loop executes signifiantly faster when the mouse is clicked on a control!
11-19-2009 04:17 PM
Does it actually poll at 50ms intervals during regular runs, or does the timeout case take a significant time to execute? Remember the loop time is the timeout execution time + timeout value.
Does you see any errors at the status indicator when the speed is faster?
All event cases have a "time" event terminal, subtract the old (via feedback node) from the new tick to get a realtime display of loop rate. What does it show?