7.1.3
S5 Application Program
As a prerequisite to the application program described below, the process input and output data on
a Simatic S5 must be at the peripheral addresses PW132 and PW134.
Read access:
L PW 132
Read status word 1
L PW 134
Read speed actual value
Write access:
T PW 132
Write control word 1
T PW 134
Write speed setpoint
To control the inverter only the two control word bits
Enable/Stop and Enable/Rapid Stop must be
changed. Fig. 40 shows how the control word is mapped in the Simatic S5.
Fig. 41 shows the S5 program for this application example. In the upper section the setpoint is
specified depending on input E1.3. Actual control of the inverter via the control word starts from the
CONT jump flag. The control commands
Enable, Stop and Rapid Stop are triggered depending on the
digital inputs I 1.1 and I 1.2. These commands are coded as constant hex (KH) figures and transferred
into the control word (PW132).
0
0
0
0
0
0
0
0
0
0
0
0
0
X
X
0
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
Bit:
PW 132:
PB 132
PB 133
0 = Enable
Enable / Rapid stop
Enable / Stop
0 = Hold control not activated
0 = Ramp generator set 1
0 = Parameter set 1
0 = No other functions activated
00347AEN
Fig. 40: Control word mapping in the Simatic S5
OB1:
: SPA FB 10
NAME: SEW
: BE
cyclically
FB 10 :
: U E 1.3
: SPB = CCW
: L KF +5000 1000 1/min CW
: T PW 134 as speed setpoint
: SPA = CONT
LEFT : L KF -3750 750 1/min CCW
: T PW 134 as speed setpoint
:
CONT : U E 1.1
: U E 1.2 Control command
: SPB = ENAB Trigger enable
:
: UN E 1.1
: U E 1.2 Control command
: SPB = STOP Trigger stop
:
: UN E 1.2 Control command
: SPB = STOP Trigger rapid stop
: BEA
:
ENAB : L KH 0006 Write enable
: T PW 132 to control word
: BEA
STOP : L KH 0002 Write stop
: T PW 132 to control word
: BEA
STOP : L KH 0000 Write rapid stop
: T PW 132 to control word
: BE
00348AEN
Fig. 41: Example of an S5 program for control of the MOVITRAC
®
31.. inverter via the process data
Application Examples
7
60
MOVITRAC
®
31.. Fieldbus Unit Profile
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]