4. Programming Tasks – Part 2
Before you start with the second part of the programming tasks, you should
take another look at the LLWin 3.0 handbook. Work through Chapters 5
and 6 carefully. The programming tasks are slowly becoming more demand-
ing. We use variables, more parallel processes and the analog inputs EX
and EY of the Intelligent Interface. But if you read these two chapters
of the LLWin 3.0 handbook carefully, you will find it easier to handle these
tasks later. Additionally, you will know all blocks, which are available in
LLWin 3.0.
4.1 Temperature Control (see assembly instructions page 13)
room temperature. As soon as a threshold value is exceeded, the air condi-
tioner switches on. If the temperature drops below the threshold value,
the air conditioner switches off again and the heating switches on. Now you
want to try to program such a control circuit using the "Temperature Con-
trol" model. First build the model.
Task:
The heating is triggered by lens tip lamp M2. The "blower" serves as
a "cooling unit" at output M1. We use the NTC resistance at input EX
for temperature measurement. Program the model, so that the heat-
ing switches off and the blower switches on above a specific temper-
ature. This should cool until the lower threshold value is reached.
Then the blower should be switched off and the heating on.
You should set the two threshold values on the TERMINAL block using
the parameters EA and EB. The value for the respectively current tem-
perature should be shown in Display 1 of the TERMINAL.
Programming Tips:
x
Query the analog value EX constantly in a separate process using the
ASSIGNMENT block, and store the value in the variable VAR1.
x
Note that the resistance value of the NTC resistance decreases with
increasing temperature. Consequently, the upper temperature threshold
value EA is the smallest value of the variable VAR1. The blower should
switch on at this threshold value. The lower temperature threshold value
EB is the largest value of the variable VAR1. The heating should switch
on at this threshold value.
x
Query constantly using the two COMPARE blocks whether VAR1 is below
the smallest or above the largest value, and switch the blower or heater
on accordingly.
A new air-conditioning system
was installed in your home.
Of course, you immediately
asked the installation engineer
how the temperature control
operates. He readily explained
to you that a temperature
sensor constantly measures the
x
You can find out which value EX has at room temperature easily using
the Check Interface diagnosis tool. Switch the lamp M2 on, and see how
the value decreases. Then switch the blower on (so that it blows in the
direction of the thermal sensor) and observe how the value increases.
You select the threshold values EA and EB correspondingly. The values
can fluctuate somewhat with the different NTC resistances.
x
Ready-to-use project: Temperature control.mdl
4.2 Stamping Press (see assembly instructions page 15)
The workshop next door has invest-
ed in a highly modern machine to
stamp metal parts. The machine
has already been installed, but
unfortunately the programmer,
who is supposed to start operation
of it, will only arrive in two weeks.
Because the workshop urgently
needs the machine, the owner asks you whether you could not get the
machine running. Because you already have a lot of experience program-
ming, you promise to have it running by tomorrow.
First assemble the stamping press model using the instructions.
Task:
The machine should press a part with four strokes in one work cycle.
It may only start after the operator has pressed both pushbuttons E3
and E4 (two-hand operation) and the light barrier is not interrupted
at the same time.
If the light barrier is interrupted during a work cycle, the machine
stops. A warning signal sounds. The number of strokes can be set
on the TERMINAL using the parameter EA. The number of parts to
be processed should be shown in Display 1 on the TERMINAL.
Programming Tips:
You really got yourself into something now. But don't worry; it's not that
difficult using LLWin 3.0.
x
First switch the lamp for the light barrier on. Then run the machine to its
starting position (the tappet activates pushbutton E1 at its upper reverse
point).
x
Then query using the COMPARE block whether E2, E3 and E4 equal "1"
(formula: E2 AND E3 AND E4; also refer to the Chapter 6 in the LLWin
handbook).
x
If this is the case, switch the motor M1 on and let the tappet carry out
four strokes, but only if the light barrier is not interrupted!
x
Add a variable VAR1 each time when the pushbutton E1 is pressed, and
then query whether the number of strokes set at EA is reached via the
COMPARE block. Switch off the motor after each stroke, and check
whether the light barrier was interrupted. If yes, output a warning signal
GB+USA
15