This example shows how to model a home alarm system that has multiple intrusion-detection sensors. When the system detects an intrusion, it gives you a short amount of time to disable the alarm. If you do not disable the alarm within the allotted time, the system calls the police.
This model shows how to use:
Local event broadcasts to coordinate between parallel states.
Output events to drive external blocks.
Input events to simulate periodic triggering of a system.
The chart models the logic of the security system. It consists of four parallel states: one for each type of anti-intrusion sensor (window, door, and motion detector), and a fourth state that controls the alarm. In each time step, the parallel states are evaluated in sequence as indicated by the numbers in the top right corners of the states.
Inputs to the system include a signal that controls whether the alarm is enabled and, for each sensor, an on/off control and an intrusion signal. The chart outputs signals to sound an alert and to call the police.
For additional implementation details, see the chart annotations.