Projector warm-up time?
fogled@mizzou
Posts: 549
I'm trying to account for the warm-up and cool-down time for a projector, since that cycle has to complete before it will accept any other commands.
I can easily poll the projector and get the current lamp state. I just can't figure out how to keep polling the projector every so often (5-10 seconds or so). A simple WHILE loop will swamp the projector with queries and I never get a response back. How can I slow down the processes inside the WHILE loop to only happen every XX ticks? When I put a WAIT in there, the stuff inside the WAIT waits, but the WHILE loop itself doesn't.
Can someone offer some advice on this issue?
Thanks,
I can easily poll the projector and get the current lamp state. I just can't figure out how to keep polling the projector every so often (5-10 seconds or so). A simple WHILE loop will swamp the projector with queries and I never get a response back. How can I slow down the processes inside the WHILE loop to only happen every XX ticks? When I put a WAIT in there, the stuff inside the WAIT waits, but the WHILE loop itself doesn't.
Can someone offer some advice on this issue?
Thanks,
0
Comments
define_program
wait 20 send_command vdvVproj,'current_status'
It may represent more traffic as we are talking to the dev all the time, however, it will allow the system to remain 'in sync' even if a user controls the vp by remote. Another reason we poll like this is that if the projector doesn't respond, it may well have died or been stolen!....either way security steps are taken in this instance.
:-)
Polling a device every 2 seconds is a lifetime for a serial port and shouldn't pose any problems for your dev or master on an average sized system.
Final thought, IMHO you should always use a code block to stack and handle all commands to the port and issue them at the 'correct' intervals for that dev no matter how simple you think the coms will be.
Using a code block like this will ensure the 'poll' does not bump into other commands you might be issuing somewhere else in your code, and vice versa.
Can you explain why you would want to count off the seconds yourself rather than letting the processor do the work for you? The WAIT 70 above just gets stuck in the wait queue, rather than testing a condition on every loop through the DEFINE_PROGRAM section.
Jeremy
My initial mistake, why I couldn't get it to work, was that I was trying to do the WAIT up in DEFINE_EVENT instead of DEFINE_PROGRAM. Otherwise, my code looks a lot like what NMarkRoberts posted.
That said, I've never implemented a timeline before, and I need to learn. So I'm going to give that a try. If I run into trouble with the timeline, I'll post a new thread with more specific questions.
Thanks everyone for the guidance!