|
The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024
|
Latest message you have seen: RE: How difficult would it be to... |
[Date Prev][Date
Next][Thread Prev][Thread Next][Date
Index][Thread Index]
RE: I'm Sure this is an old question
- To: ukha_d@xxxxxxx
- Subject: RE: I'm Sure this is an old question
- From: Mike Griffiths <mike@xxxxxxx>
- Date: Mon, 2 Sep 2002 10:27:21 +0100
- Mailing-list: list ukha_d@xxxxxxx; contact
ukha_d-owner@xxxxxxx
- Reply-to: ukha_d@xxxxxxx
Below is a quote from the HomeVision Manual where Craig describes How
HV
functions and the difference between the two types of System
It might be useful to some people
There again :)
Mike
Control Style
The controller is primarily an "event-driven" controller. It
performs the
actions you define when specific events occur. However, the controller
also
provides some features of "loop-type" controllers. An
understanding of how
these types of systems differ will help explain how the controller
works.
In a "loop" system, the schedule is essentially a long list of
conditions
(If-Then statements) and associated actions. The controller continually
runs
through them in a loop evaluating each condition.
If a condition is met, the controller then executes the associated
actions.
These systems can be powerful because you can specify complex
combinations
of conditions. Loop systems have several drawbacks, however:
* The controller spends most of its time checking conditions that are
rarely
true. This slows down its response when an input changes or a command
is
received. The response time may be OK for simple applications, but not
for
more advanced applications. For example, an infrared remote control used
to
control video text on the TV screen needs a quick response in order to
be
usable.
* When an If-Then-Else statement is used, either the THEN or ELSE part
will
be executed every time through the loop. Thus, some commands will be
executed each loop. This is rarely the desired behavior, as most
commands
only need to be executed once in response to some event. Preventing
repeated
actions requires cumbersome programming techniques (such as setting a
flag
after performing the action to indicates that it has already been
done).
An "event-driven" system, in contrast, only executes actions when
an event
occurs. The controller constantly checks for the events, then
immediately
performs the actions associated with it. This provides several
advantages
over a loop-type system:
* The controller can respond much faster to the event.
* Programming is simpler, as the user can easily specify the actions to
perform in response to any event.
There is one disadvantage to an event-driven controller. What if the
event
that you care about is not one the controller is looking for? For
example,
say you want to turn on a light when a variable is equal to 67 and it's
dark
outside. If the controller doesn't have a built-in function checking
for
these precise conditions, you can't do it. For this reason, loop-type
controllers can be more powerful, as you can typically set any
combination
of conditions you care about.
The controller provides the best features of both types of systems. At
its
heart, it's an event-driven controller that provides the rapid input
response typical of such systems. With it, you can develop powerful
schedules with only limited "programming". However, the
controller can also
execute a group of user-specified commands at a rapid rate (every few
milliseconds with a periodic event set to execute every "loop"),
simulating
the loop-type systems. You can then use combinations of If-Then-Else
statements to check for any set of conditions you desire and perform
appropriate actions. You could even put the entire schedule into this
group
of actions and have a completely loop-type system, although you'd lose
many
of the benefits of an event-driven system.
Yahoo! Groups
Sponsor |
ADVERTISEMENT
|
|
|
|
http://www.automatedhome.co.uk
Post message: ukha_d@xxxxxxx
Subscribe: ukha_d-subscribe@xxxxxxx
Unsubscribe: ukha_d-unsubscribe@xxxxxxx
List owner: ukha_d-owner@xxxxxxx
List of UKHA Groups here - http://groups.yahoo.com/group/UKHA_Grouplists/
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Home |
Main Index |
Thread Index
|
|