07-15-2010 12:32 PM
I am attempting to start and stop a counter output (creates pulsed output) in a while loop and I am not sure how this can be accomplished. I have a while loop running that is taking measurements from a digital compass. If my heading is within an acceptable range, the counter outputs (2 of them for turning left and right) should be turned off. If the heading is outside the acceptable range, lets say too far to the right, I want to start one of my counter outputs to turn the object to the left. The issue I am having is that if I put the "Start Task" block in the while loop the system will try to start each iteration of the loop, even if it is already on. I don't know if this is a problem, but it doesn't seem efficient from a programming standpoint. I remember reading somewhere that stopping and starting tasks can really slow down a loop. Any suggestions?
Solved! Go to Solution.
07-15-2010 01:52 PM
Can you post some code to look at?
07-15-2010 01:56 PM
I actually just figure it out. If you use some if statements and the "Is Task Done" block, you can get it to work.
07-15-2010 01:59 PM
Always nice when someone takes the time to figure it out on their own. I usually find then when I ask for help I usually figure it out before I get a responce. Nice to know these guys are here to help if you can not figure it out.