Вы находитесь на странице: 1из 8

Harris South Norwood

Design and Technology

Systems and Control


BURGLAR ALARM EXERCISE

From the System> Soft Systems menu, select Burglar Alarm

From the Soft System window menu, select Help>Quick Help


This displays a list of the Outputs and Inputs in the system.

If you can already do this, complete the following tasks by yourself. If not, use the
Instructions to
do Task 1A; then do Task 1B by yourself.

Task 1A: Build a program that checks if a burglar enters by the left hand
door. If a burglar enters, the alarm is switched on for 3 seconds and then
switched off.

Task 1B: Build a program that checks if a burglar enters by the left hand
door. If a burglar
enters, the alarm is switched on until the RESET button is pressed. When
this button is
pressed, the alarm is switched off and the program goes back to checking
the door.
ACTIVITIES
Skill Covered:
Build, test and edit a program with a loop to monitor an input
from a digital
device, and produce an output when it is on.
Instructions
1. Place a Decision command two spaces under Start.
Double click on the Decision command.
The left hand door sensor is input 0, so click on input digit 0 to change it to
a 1. This sets the command to check if the pressure pad inside the door is
pressed. Type in a label to remind you what the command does. Click OK.

2. Add Outputs and Wait commands under the Decision command, to


switch on the alarm for 3 seconds; then switch it off.

Reminder
When you set an Outputs command: set the output to 1 to switch it on set
the output to 0 to switch it off.
Burgla
3. Read the information below about how to draw lines. Then draw the lines
in your program as shown in Instructions 4 to 6.

Drawing Lines
Click with the right mouse button on the command at the start of the line.
From the menu that appears, choose ‘Start Line’. The cursor will turn to a pen symbol.
Then click with the right mouse button on the place where you want the line to end. To
draw more lines, simply click with the right mouse button at the starting point, and then
click again on the ending point for your line.

4. Start the first line on the Start command. End it in the space after the last
command
5. Now draw the repeat loop as three more lines, as shown below:
as shown below:
6. Draw a line from the side of the Decision command, back into the line
above it.

Drawing Lines from Decision Commands


The first line drawn from a Decision command will always be the “Yes”
route. The second line drawn will label itself the “No” route. If you need to
swap them over, click on the Decision command with the right mouse
button, and select: “Swap Yes and No”.

7. Click the green Run button to run your program. Click on the left hand
door In the Soft System. The alarm should switch on for
3 seconds; then switch off. Click the red Stop button to stop the program.
These instructions have shown you how to do Task 1A. Now do Task
1B by yourself.
Burglar Alarm - Soft Systems
Task 2A: Extend the program that you built for Task 1B, so that it checks if
a burglar enters by either the left hand door or the right hand window. If
a burglar enters, the alarm is switched on until the RESET button is
pressed. When this button is pressed, the alarm is switched off and the
program goes back to checking the door and window.

Task 2B: Extend the program again so that now it checks all four sensors
in the room: - the light beam across the door at the back of the room, and
the pressure pad under the vase; as well as the left hand door and the right
hand window.
ACTIVITIES
Skill Covered: Build, test and edit a program with a loop to monitor input
from TWO OR MORE digital devices, and produce an output if one OR
another is on.

Instructions
1. Before you begin to edit your program, do the following investigation
of how some of the sensors work.
The Digital Panel shows the state of the inputs and outputs in the system.
If the input displays1, it means it is “on”. If it displays 0, it means that the
input is “off”. Click on the left hand door (input 0). The panel will change to
show that this input is on. Notice that inputs 1 and 3 are already displayed
as “on”. Input 1 is a pressure pad. The vase is pressing on the pad, so the
input is on (1). Click and hold on the window behind the vase to see the
input change to 0 when the burglar lifts the vase. Input 3 is a reed switch on
the right hand window. When the window is closed, the input is on (1).
Click on the window to see the input change to 0 when the burglar appears.
Burglar Alarm – 4
2. Place another Decision command in the program you built for Task 1B.
Double click on this Decision command. The reed switch on the window is
input 3, so click on input digit 3 to change it to a 0. The command will now
check to see if the sensor goes off.
Type a label. Click OK.
3. Draw the lines in your program as shown below:

4. Run the program to check that it responds if a burglar enters by either


the door or the window.
These instructions have shown you how to do Task 2A. Now do Task
2B by yourself.

Help
Just add another Decision command to check the pad under the vase, but
read the information
below about using the light beam before you add the final part of the
program.
Using the Light Beam
You can set a light beam
(output 6) to shine across
the bottom of the door.
When the beam shines
on the light sensor, the
sensor is on (1).
When you click on the door,
the burglar breaks the beam
and the sensor is off (0).
You will need to add an Outputs command to switch on the beam, at the
start of your
program.
The beam must stay on all the time the program is running. So you will
need to open the two
Outputs commands that switch the alarm on and off, and set output 6 (the
beam) to the
“ignore” state as shown below:
Ignore the beam
If you don’t do this, these commands will also switch the beam off when
they switch the alarm.
file:///C|/Program Files/Economatics/Logicator/Logicator Teaching Materials/Burglar Alarm.htm (9 of 15)
[16/11/2007 13:38:42]
Soft Systems Help - Burglar Alarm
Burglar Alarm - 5
Using Variables to Store Information (1)
Soft Systems
for Logicator
Task 3: Extend the program that you built for Task 2A, so that when the
alarm is activated, a
message is displayed that identifies where the burglar has entered.
The following Instructions will help you to do this task, but you will also do
parts of it by yourself
ACTIVITIES
file:///C|/Program Files/Economatics/Logicator/Logicator Teaching Materials/Burglar Alarm.htm (10 of
15) [16/11/2007 13:38:42]
Soft Systems Help - Burglar Alarm
Skills Covered: Build a program that uses variables as a way of storing
and using information.
Use procedures as building blocks to build a larger program.
Instructions – 1: Using Procedures
The best way to start this Task is to build the instructions for operating the
alarm as a separate
procedure.
1. Place a Procedure
command beside Start:
Double click on the Procedure command.
Type alarm. Click OK.
The Procedure command gives the procedure its name.
2. Move the commands
that operate the alarm,
and place them under the
Procedure command.
Redraw the lines.
3. Complete the
procedure by adding
an End command.
This command tells the
program that the
procedure has ended.
4. Place a Do Procedure
command in the main part of
the program as shown below:
file:///C|/Program Files/Economatics/Logicator/Logicator Teaching Materials/Burglar Alarm.htm (11 of
15) [16/11/2007 13:38:42]
Soft Systems Help - Burglar Alarm
Double click on the Do Procedure command.
Select ALARM from
the list.
This command tells the
program to run the
procedure with this name.
5. Run the program to check that it still works as it did before you made
these changes.
Burglar Alarm - 6
Using Variables to Store Information (2)
Soft Systems
for Logicator
Instructions – 2: Using Variables to Store Information
1. Redraw the lines below the Decision commands as shown below, to
make room for more
commands:
Lines redrawn here
2. Scroll down the Commands
list to find the Expression
command (shortened to Express.)
Place an Expression command as shown below:
Double click on the Expression command.
file:///C|/Program Files/Economatics/Logicator/Logicator Teaching Materials/Burglar Alarm.htm (12 of
15) [16/11/2007 13:38:42]
Soft Systems Help - Burglar Alarm
Select A from the first box.
Type 1 in the second box. Click OK.
This command stores the number 1 in variable A if the door sensor is
activated.
3. Decide for yourself where to place another Expression command in the
program, and set it
so that the number 2 is stored in variable A if the window sensor is
activated.
4. Place another Procedure command in space on the flowsheet. Double
click on this Procedure
command. Type identify. Click OK.
5. Place a Compare
command under the
Procedure command.
Double click on this
command.
Select A from the first box.
Select = (“equal to”) from the second box.
Type 1 in the third box. Click OK.
This command checks to see if the number 1
is stored in variable A.
6. Place a Message command beside the Compare command:
Double click on the Message command. Type in your own message that
says the burglar has
entered by the side door. Click OK.
7. Add another Compare command and another Message command to the
procedure.
Set the Compare command to check if the number 2 is stored in variable A.
Type your own message in the Message command to say the burglar has
opened the
file:///C|/Program Files/Economatics/Logicator/Logicator Teaching Materials/Burglar Alarm.htm (13 of
15) [16/11/2007 13:38:42]
Soft Systems Help - Burglar Alarm
side window.
8. Add an End command to the procedure and draw the lines as shown
below.
Take care to draw the lines correctly.
Reminder
Remember that you can
click on a Compare
command with the right
mouse button to swap
over the “Yes” and “No”
lines.
9. Now edit your
ALARM procedure
as follows:
Move commands
down, and add a
Do Proc command
set to run the
IDENTIFY procedure.
Add a Hide Message
command as shown:
Set it to hide All
messages:
10. Run the program to test that it displays the correct message when a
burglar enters by either
the door or the window.
Extensions
1. Extend your program so that it covers all four sensors in the system.
2. Add these two
commands to your
ALARM procedure
so that the alarm
cannot be reset
until the correct code
number has been
input.
This uses a new variable (B) to store different information. You can use a
code number of your
own.
See Help> Logicator Commands for more information on the Input
command.

Вам также может понравиться