09-17-2008 03:05 AM
Hey
I really need help on this, here is my problem,
I use a for loop to detect the light intensity from different angle.(ex: from -60' to 60' and 5' is step)
The data from light detector shows 0 sometimes, I think it is the instrument problem.
So I wanna do the measurment in the same angle again when the data shows 0.
Is there any possible when the data is 0, the for loop can make the measurement in the same angle again(without stopping the program)!
Thank you!
09-17-2008 03:19 AM
Hey Gordan,
Instead of for loop, use While Loop and make the loop to run for the actual number of times and also check for the data 0. If the data is 0, continue the loop else exit the loop
Regards,
Raja
09-17-2008 04:59 AM
Sounds like a job for a state machine to me. There are examples of state machines in the example finder.
You would want a state for reading the value from the device. I assume the device moves so you would want a state for moving it. If you read 0 in your measure state then don't change the state to move, but redo the measurement.
09-17-2008 05:17 AM
09-17-2008 06:08 AM