03-22-2006 04:21 PM
03-23-2006 06:57 AM
03-23-2006 07:52 AM
'After some trouble shooting the engineer '
Hi Ben
I appriciate much of the advice you give us on this group, but come on, shooting the engineer just because your 1 ms out on a couple of loops is a bit drastic..
Sorry I can't help with your problem, but please spare the life of your poor engineers.
Ian
03-23-2006 07:53 AM
03-23-2006 08:00 AM
Sorry I can't help with your problem, but please spare the life of your poor engineers.
Ian
"
I'll try!
Actually the engineer was looking for me to help correct the problem. He just had to sit back and let me come up with the answers.
Still curious,
Ben
03-23-2006 08:25 AM
03-23-2006 08:54 AM
Hi Matt!
"unless I delayed the processing in the loops such that they were running too long anyway. "
That is exactly my issue. The reading from the global boolean is taking too much time. My loops are running at 100 HZ.
I am not sure if your example would catch the late flags. I am using an "Error Logger" to track these errors.
The best case failures indicate the loops are finishing 1 msec late. The worse case indicates 56 msec!
Ben
BTW: CPU is not an issue. I am running on a dual processor with one using 75% and the other using 50%.
03-23-2006 09:46 AM
Ben,
I dunno if access to globals requires switching to a UI thread, but it sounds like a reasonable theory. I do recall that timed loops are given boosted priority -- perhaps also their own thread? If so, there may well need to be some sort of context-switching when accessing a global.
Still, it's hard to account for 10's of msec extra for timed loops over the other standard loops. Does every vi with a global on its block diagram reserve a separate spot in memory for a copy of the data? If so, there must be a process "under the hood" responsible for dispatching the updated value to all of the global variable instances. Hmmmm. The train of thought isn't leading me anywhere...
Along the same lines as Shane's queue idea, you might also consider trying either a Notifier or perhaps even a lowly Occurrence. I have tended to keep using Occurrences for very simple "HALT RIGHT NOW" situations. Because they're so simplistic, I've figured them to have lower overhead than Notifiers or Queues, though I haven't done any careful benchmarking. I only know they were easily good for several kHz under RT with a sub-GHz CPU.
Let us know if/when/how you fix this one.
-Kevin P.
03-23-2006 10:00 AM
"A wise man goith into his storehouse and bringith forth treasures both old and new." (Paraphrased Proverb)
"There is wisdom in a multitude of counsellors." (Proverbs)
"even a lowly Occurrence. "
Wonderful thought Kevin!
I will investigate further and update.
Ben
03-23-2006 10:45 AM
Actually, the correct quote should be along the lines of "without cunning the people will fall and deliverance will be found in a multitude of counselors" (and yes, I know the original).