06-04-2008 12:10 PM
06-04-2008 12:16 PM
06-04-2008 12:36 PM
Lynn posted some good follow-up Q's but let me focus on another issue where scobo wrote;
""Wait Until Next ms Multiple" block so that it executes every 50 milliseconds "
A common misconception about that function is what you wrote. Under the most simple cicumstances it will do that, but if you are doing any other stuff at the same time (70% CPU says you are) then that function will execute differently than expected.
Say the tick = 0 and you wait 50 and no other code is slowing down the cycling. Then when the tick-count reaches 50 it is done waiting.
Say the tick count is 10 then the code will only wait 40 because 50 is the next even multiple.
Again tick = 0 but this time your code takes 51 ticks to run. THe tick is now 51 so the next multiple would be 100.
So if your code takes longer to execute than the "wait until next" then with time you will be missing cylces.
Try using the TImed Loop if you have it available BUT I suspect the answers to Lynn's follow-up Q are what we need to get you going.
Ben
06-04-2008 12:50 PM
johnsold wrote:
Do you have any array or string building occurring in the program? Are references being opened/created and not closed? Does memory usage increase over time?
06-04-2008 01:27 PM
06-04-2008 01:55 PM - edited 06-04-2008 01:57 PM
06-04-2008 02:07 PM
Yep!
Go with Ton's suggestions. I think he listed all of the glaring issues.
Ben
06-04-2008 02:12 PM
I'll clean it up and see if that solves the problem.
Thanks for the help!