Timer or Wait_Until
winstonma
Posts: 45
I have a lift and a projector. I want to shut down the projector if the lift is up for 30 minutes (also the countdown should be canceled once when lift is down within 30 minutes)
How can I achieve that? Thanks
How can I achieve that? Thanks
0
Comments
BUTTON_EVENT[tp, UP_BUTTON]
{
push:
WAIT 'SHUT_DOWN_PROJECTOR' 18000
{
shutDownProjector()
}
}
BUTTON_EVENT[tp, DOWN_BUTTON]
{
push:
CANCEL_WAIT 'SHUT_DOWN_PROJECTOR'
}
you can also do it with Timeline.
[size=+1]Note:[/size]
1st : I think you should tell us how your projector and its lift are controlled and if they have a good feedback facility like responses of the current state
2nd : 30 minutes ON in the projector housing??!?.. if your projector is big enough, it will be burned for sure!!
3rd : In the first place, why someone may pull up the lift, and intending to pull it down again in a 30 minutes??. In common logic , in a room with a projector , no one will pull it up unless he wants to end up the meeting. If you are trying to make some precautions if someone forgot to turn off the projector and pulled up the lift, you should make it in your code by turning off the projector immediatelly before pulling the lift up .. see bellow :
One of the great things that my instructor taught me is :
- try to use timelines instead of waits specially in sequenced system shutdown
- Always think in terms of logic not in terms of code. In your case, you may burn the projector , and your client will call you sayin "your fabulous AMX burned my equipment", when in fact it is your fault, not AMX
Another example is the Drapes Relays, a relay for each direction, one for UP and the other for DOWN, if you didn't define them in a mutually exclusive group and someone pushed UP while the other is ON the motor will be burned.
hello friends,
I'm a newbie to AMX programming . can you provide me an example by implementing the above situation using timeline.
Yeah, a 30 minute wait to turn off a projector looks dangerous to me. If the wait is interrupted, by a reboot or power glitch or whatever, the projector will stay on for a long time.
Went on a service call recently to a law firm that had a system which had been installed by Big National Integration Company about three years ago. They couldn't get their projector to work -- a popup claiming it was in its cool-down cycle kept appearing. Prior to calling us, the law firm called Big National Integration Company and a technician came out and pronounced the projector in good working order. The code was on the master and when I looked at it I saw that when the projector was turned off, a parameter indicating cooling was set and would be reset at the expiration of a wait. Problem was that if the wait was interrupted, there was no method to reset the parameter. Worst part about it was that the projector is a Sanyo which has a very easy to understand and implement status query and response. No reason whatsoever to rely on a wait for cooling with one of these projectors.
I don't know much about what projector lifts are available, pricing and the like. But, every projector lift that I have seen had some sort of facility to turn the projector off when the lift was raised. Perhaps this is some sort of feature associated with particular projectors, I don't know. Seems like a worthwhile feature, though.