GB+USA
via the BEEP block and stop the work cycle.
x
Then the next work cycle follows. After each successfully completed work
cycle, add one to the variable VAR2. Show the value of the variables in
Display 1. It corresponds to the number of finished parts.
x
Ready-to-use project: Stamping press.mdl
Everything hopefully worked, because your neighbor will be extremely happy
if his machine is running before the programmer shows up. As you know, he
needs the machine urgently.
4.3 Car Park Barrier (see assembly instructions page 18)
The new car park should be opened in the city next Saturday. The barrier for
16
the entrance was installed today. Because it
is well known in the meantime that you are
the best programmer in the city, you were
asked right away to handle the programming.
Of course, you are proud to have been asked
and get to work immediately. Assemble the
model.
Task 1:
The barrier should open when the pushbutton E3 is pressed. If the
barrier is open, the light is green. The light turns red and the barrier
closes again only after the light barrier has been passed.
Programming Tips:
x
Write the subprograms "Open" and "Close" for
opening and closing the barrier.
x
Switch the lamp on for the light barrier first in the
flowchart and then switch the light to red.
x
Close the barrier. It is then in its initial position.
x
After you press pushbutton E3 (EDGE block), the
barrier opens. Then the light turns green.
x
If the light barrier is interrupted and then closed
again (1-0 and 0-1 EDGE at E4), the light should
turn red and close the barrier.
x
Then the flowchart starts from the beginning
again.
Task 2:
The car park should be reserved for prominent guests
on opening day. They receive a secret code with three
digits for this. They must press three of the five inputs
E22-E26 on the TERMINAL block in the correct order.
The barrier may only open after that. Program this
function in a "Code" subprogram. A message should
appear on the Terminal stating whether the code was
correct or wrong. The code should be: E26 – E22 – E24.
Programming Tips:
x
You can set up the "Code" subprogram in very different ways. The easi-
est method is to query the three inputs E26, E22 and E24 sequentially
using the EDGE block. If the three pushbuttons are pressed, the message
"Code correct" appears, and you exit the subprogram. However, the
wrong pushbutton can be pressed in between using this solution without
the program noticing it.
x
If you want to make the code entry secure, so that really only three
pushbuttons can be pressed, and if one of them is wrong, the message
"Code wrong" appears, then programming is a bit more complex. You
use the INPUT block and query all five inputs E26-E22 as follows: