You are on page 1of 301

1extbeek

Automatlng
682 300
en 0ú02hh
feste 5eItware 1ee|s
Contents and general lnstructlons
l Festo P.8F-FSTú-L8-Fh en 0ú02hh
Author 8. Plagemann . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0rlglnal de . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fdltlon en 0ú02hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0eslgnatlon P.8F-FSTú-L8-Fh . . . . . . . . . . . . . . . . . . . . . . . .
0rder no. 682 300 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 (Festo KC, Fssllngen, Federal kepubllcof
Cermany, 200ú)
lnternet: http:]]www.festo.com
e-mall: servlce_lnternatlonal@festo.com
The reproductlon, dlstrlbutlon and utlllzatlon of thls
ment as well as thecommunlcatonof lts contentsto others
thout express authorlzatlon ls prohlblted. 0ffenders wlll be
heldllable for the payment of damages. All rlghts reserved ln
the event of the grant of a patent, utlllty module or deslgn.
Contents and general lnstructlons
ll Festo P.8F-FSTú-L8-Fh en 0ú02hh
Mlcrosoft wlndows reglstered trade mark of Mlcrosoft Corporatlon
Contents and general lnstructlons
lll Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
0eslgnated use lX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Target group lX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fxample pro|ects lX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lmportant user lnstructlons X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1. Pregramming Ier autematien techne|egy 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 About thls book 1-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Programmlng for automatlon technology or the PC 1-ú . . . . . . . . . . . . . . . . . . . .
2. 1he basic ru|es eI an f51 preject 2-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1 0vervlew 2-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3. 1he Iirst f51 preject: Centre||ing a garage deer 3-1 . . . . . . . . . . . . . . . . . . . . .
3.1 Pro|ect, l]0s, program, lF ... ThFh ... 0Thkw 3-5 . . . . . . . . . . . . . . . . . . . . . . . .
3.1.1 Pro|ect 3-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.2 Selectlng the controller type 3-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.3 l]0 conflguratlon 3-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.ú Programmlng 3-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.5 Complllng 3-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.6 0ownloadlng the pro|ect 3-3ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.7 Checklng 3-37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.8 0ocumentatlon 3-ú0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.9 The Carage pro|ect 3-ú2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Summary 3-ú3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents and general lnstructlons
lv Festo P.8F-FSTú-L8-Fh en 0ú02hh
4. A s|ight|y |arger preject with f51: Centre||ing a dri||ing machine 4-1 . . . . . . .
ú.1 The drllllng machlne ú-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.1 0peratlon ú-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.2 Actuators and sensors ú-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.3 The program ú-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.ú Allocatlon ú-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.2 Program organlsatlon ú-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3 The flrst steps ln the statement llst ú-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3.1 Startlng the program ú-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3.2 Sequentlal program ú-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3.3 0ownloadlng the pro|ect ú-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú The flrst steps ln ladder dlagram ú-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.1 Startlng the program ú-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.2 Sequentlal program ú-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.3 Step programmlng wlth counters ú-19 . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.ú 0ownloadlng the pro|ect ú-20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5. 1he 51£P eperatien in the statement |ist 5-1 . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1 The STFP 5-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 The contect of a step 5-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 Colng to the next step 5-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.ú The name of the step 5-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5 }umplng from step to step 5-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6 The last step 5-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7 The alternatlve sequencer 5-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8 The parallel sequencer 5-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6. Mu|titasking with f51: 1he dri||ing machine's eperating medes 6-1 . . . . . . . .
6.1 Programs work slmultaneously 6-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 Supervlslng programs 6-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3 Startlng programs wlth tlme llmlts 6-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.ú Fxchanglng data among programs 6-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents and general lnstructlons
v Festo P.8F-FSTú-L8-Fh en 0ú02hh
7. 1he dri||ing machine grews in statement |ist 7-1 . . . . . . . . . . . . . . . . . . . . . . . .
7.1 Startlng and stopplng the automatlc program 7-3 . . . . . . . . . . . . . . . . . . . . . . . .
7.2 lnchlng mode 7-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.3 Fdge detectlon 7-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.3.1 Programmlng for edge detectlon 7-11 . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.ú The home posltlon program 7-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8. 1he dri||ing machine grews in |adder diagram 8-1 . . . . . . . . . . . . . . . . . . . . . .
8.1 Startlng and stopplng the automatlc program 8-3 . . . . . . . . . . . . . . . . . . . . . . . .
8.2 lnchlng mode 8-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3 Fdge detectlon 8-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3.1 Programmlng for edge detectlon 8-9 . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.ú The home posltlon program 8-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9. 1imes and ceunters with f51 in statement |ist 9-1 . . . . . . . . . . . . . . . . . . . . . .
9.1 The tlme module 9-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.1 Let's begln wlth a slmple example 9-ú . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.2 The tlmer wlthout steps 9-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.3 The tlmer 0h delay 9-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.ú The swltch 0FF delay 9-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.5 The flasher 9-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2 The counter module 9-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2.1 Count up lncrement 9-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2.2 Count backwards decrement 9-15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2.3 The counter wlthout the counter (module) 9-18 . . . . . . . . . . . . . . . . . . .
9.2.ú Comblnlng tlmes and counters 9-20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.3 Llmltatlons of uslng tlmes and counters 9-23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.ú Practlcal appllcatlon of tlmes and counters 9-2ú . . . . . . . . . . . . . . . . . . . . . . . . . .
9.ú.1 The garage door wlth tlmes]counters 9-2ú . . . . . . . . . . . . . . . . . . . . . . .
Contents and general lnstructlons
vl Festo P.8F-FSTú-L8-Fh en 0ú02hh
10. 1imes and ceunters with f51 in |adder diagram 10-1 . . . . . . . . . . . . . . . . . . . . .
10.1 The tlme module 10-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.1 Let's begln wlth a slmple example 10-ú . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.2 The tlme-on delay 10-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.3 The swltch 0FF delay 10-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.ú The tlme module ln detall 10-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2 The tlme module 10-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2.1 Count up lncrement 10-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2.2 The unlversal counter 10-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2.3 Comblnlng tlmes and counters 10-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.3 Llmltatlons of uslng tlmes and counters 10-16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11. 5ub-pregrams with f51 11-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.1 lmportlng and namlng modules 11-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 Transfer and return parameters 11-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2.1 Fxample of return parameters ln statement llst 11-7 . . . . . . . . . . . . . . .
11.2.2 Fxample of transfer parameters ln statement llst 11-9 . . . . . . . . . . . . . .
11.2.3 Fxample of transfer and return parameters
ln statement llst 11-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2.ú Fxample of return parameters ln ladder dlagram 11-1ú . . . . . . . . . . . . . .
11.2.5 Fxample of return parameters ln ladder dlagram 11-15 . . . . . . . . . . . . . .
11.3 Sub-programs wlth FST: Creatlng your own modules 11-17 . . . . . . . . . . . . . . . . . .
11.3.1 My own shlft module 11-17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.ú 0lfference between CFM]CMP 11-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12. Recegnising errers with f51: 1he f51 errer pregram 12-1 . . . . . . . . . . . . . . . . . .
12.1 Ceneral lnformatlon on errors ln a FST system 12-3 . . . . . . . . . . . . . . . . . . . . . . . .
12.2 The reactlon to an error 12-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.3 The error program 12-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.3.1 The error reactlon wlth the error program 12-9 . . . . . . . . . . . . . . . . . . . .
12.3.2 The garage door wlth error program 12-10 . . . . . . . . . . . . . . . . . . . . . . . .
12.3.3 0escrlptlon of an error 12-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents and general lnstructlons
vll Festo P.8F-FSTú-L8-Fh en 0ú02hh
13. 0perating with f51: Cennecting and pregramming
eperater termina|s 13-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.1 Connectlng the operator termlnal 13-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.1.1 The FXT port ln the FFCs (front end controller) 13-5 . . . . . . . . . . . . . . . .
13.1.2 Communlcatlon between FF0 and the programmlng PC 13-6 . . . . . . . .
13.2 FF0 0eslgner and FST 13-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.2.1 Showlng a varlable on the dlsplay 13-10 . . . . . . . . . . . . . . . . . . . . . . . . . .
13.2.2 Modlfylng a varlable from the dlsplay 13-12 . . . . . . . . . . . . . . . . . . . . . . .
13.3 The FF0 ln the Fthernet network 13-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.3.1 The FF0 0eslgner pro|ect for Fthernet communlcatlon 13-1ú . . . . . . . . .
13.3.2 Multlple controllers ln the network wlth a FF0 13-17 . . . . . . . . . . . . . . . .
14. ketwerking with f51 14-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.1 Prerequlslte for uslng Fthernet the TCP]lP drlver 1ú-3 . . . . . . . . . . . . . . . . . . . .
1ú.1.1 Fxcurslon lnto lP address and network masks 1ú-6 . . . . . . . . . . . . . . . .
1ú.1.2 Can the controller be found ln the network! 1ú-7 . . . . . . . . . . . . . . . . . .
1ú.1.3 0hCP server 1ú-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.1.ú Program sensltlve lP addresses 1ú-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.2 Programmlng and trouble shootlng ln the network 1ú-13 . . . . . . . . . . . . . . . . . . . .
1ú.3 Communlcatlng among the controllers ln the network 1ú-16 . . . . . . . . . . . . . . . . .
1ú.3.1 lP_Table 1ú-17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.3.2 Fasy_S and Fasy_k 1ú-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.3.3 Fxample 1ú-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.3.ú Monltorlng data communlcatlon 1ú-21 . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.ú Communlcatlng wlth wlndows appllcatlons uslng 00F 1ú-22 . . . . . . . . . . . . . . . . .
1ú.ú.1 uslng 00F to wlndows 1ú-22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5 Some rules for uslng Fthernet 1ú-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.1 Fthernet ls standardlsed 1ú-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.2 Fthernet has standardlsed cables and plugs 1ú-31 . . . . . . . . . . . . . . . . . .
1ú.5.3 hu8s and swltches 1ú-33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.ú From the productlon llne to the offlce vla Fthernet 1ú-3ú . . . . . . . . . . . . .
1ú.5.5 FasylP 1ú-36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.6 The rules for uslng Fthernet (10 M8lt]s) 1ú-36 . . . . . . . . . . . . . . . . . . . . .
Contents and general lnstructlons
vlll Festo P.8F-FSTú-L8-Fh en 0ú02hh
15. 1he W£ß server in the centre||er 15-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.1 what ls a wF8 server! 15-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2 wF8 Server and FST 15-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2.1 hecessary browser settlngs 15-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2.2 Some rules for the FST wF8 server 15-6 . . . . . . . . . . . . . . . . . . . . . . . . .
15.2.3 where the hTML pages! 15-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3 hTML pages for the wF8 server 15-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3.1 The flrst hTML page 15-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3.2 A llttle blt more text 15-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3.3 Accesslng the process 15-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16. 1ips and tricks Be|pIu| yet Iun 16-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.1 Allocatlonllst 16-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.2 Statement llst 16-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.3 updatlng the pro|ect 16-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.ú Flndlng syntax errors 16-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17. £rrer messages 17-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.1 Ceneral FST error numbers 17-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.2 Festo fleldbus error 17-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.3 AS-lnterface error 17-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.ú Pk0Fl8uS-0P (CP62) error 17-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18. 1he f51 Ct cemmand interpreter 18-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.1 The FST operands ] varlables 18-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.1.1 0lsplaylng operands 18-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.1.2 Modlfylng operands 18-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.2 Some other commands 18-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents and general lnstructlons
lX Festo P.8F-FSTú-L8-Fh en 0ú02hh
ßesignated use
Thls software package enables any user famlllar wlth PLC]lPC
drlves to conflgure, program and commlsslon the SPS]lPC
supported by the software package.
0bserve also the standards speclfled ln the relevant chapters,
as well as natlonal and local laws and technlcal regulatlons.
1arget greup
Thls manual ls lntended for technlclans tralned ln control and
automatlon technology, flttlng, etc. who are deallng for the
flrst tlme wlth commlsslonlng and operatlng the PLC]lPC
ported by the software.
lnformatlon:
¥ou wlll flnd software complementary to the product on the
Festo lnternet pages under the address: www.festo.com
under ¸lndustrlal Automatlon] ¸Servlces & Support]
¸0ownload Area].
£xamp|e prejects
The sample pro|ects from thls book are archlved on the FST
C0 ln the subdlrectory \Samples\0eutsch or
llsh. lf necessary, you can read themuslng FST (restore).
lf you also lnstalled sample flles when you lnstalled FST, the
example pro|ects are already located ln the FST pro|ect
tory.
Contents and general lnstructlons
X Festo P.8F-FSTú-L8-Fh en 0ú02hh
tmpertant user instructiens
0anger categorles
Thls manual contalns lnstructlons on the posslble dangers
whlch may occur lf the product ls not used correctly. These
lnstructlons are marked (warnlng, Cautlon, etc.), prlnted on a
shaded background and marked addltlonally wlth a
gram. A dlstlnctlon ls made between the followlng danger
warnlngs:
Warning
Thls means that fallure to observe thls lnstructlon may
result ln serlous personal ln|ury or damage to property.
Cautien
Thls means that fallure to observe thls lnstructlon may
result ln personal ln|ury or damage to property.
P|ease nete
Thls means that fallure to observe thls lnstructlon may
result ln damage to property.
The followlng plctogrammarks passages ln the text whlch
descrlbe actlvltles wlth electrostatlcally sensltlve
nents.
Flectrostatlcally sensltlve components may be damaged lf
they are not handled correctly.
Contents and general lnstructlons
Xl Festo P.8F-FSTú-L8-Fh en 0ú02hh
Marklng speclal lnformatlon
The followlng plctograms mark passages ln the text
lng speclal lnformatlon.
Pictegrams
lnformatlon:
kecommendatlons, tlps and references to other sources of
lnformatlon.
Accessorles:
lnformatlon on necessary or senslble accessorles for the
Festo product.
Fnvlronment:
lnformatlon on envlronment-frlendly use of Festo products.
1ext markings
º The bullet lndlcates actlvltles whlch may be carrled out ln
any order.
1. Flgures denote actlvltles whlch must be carrled out ln the
numerlcal order speclfled.
lndlcate general actlvltles.
Contents and general lnstructlons
Xll Festo P.8F-FSTú-L8-Fh en 0ú02hh
Pregramming Ier autematien techne|egy
1-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 1
1. Programmlng for automatlon technology
1-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
1. Pregramming Ier autematien techne|egy 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 About thls book 1-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Programmlng for automatlon technology or the PC 1-ú . . . . . . . . . . . . . . . . . . . .
1. Programmlng for automatlon technology
1-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Automatlon can be deflned as processors to
cally carry out technlcal processes".
The startlng polnt for automatlon ls a technlcal process whlch
should be carrled out ln such a way that certaln ob|ectlves
(e.g. efflclency, safety, avallablllty) are achleved.
ln order for thls to take place automatlcally, l.e. wlthout
stant human lnterventlon, automatlon equlpment ls requlred.
lt lmplements the functlons for reglsterlng, processlng and
output of slgnals.
lmplementatlon of the processlng algorlthmtakes places as
loglcal, arlthmetlc llnks. ln the past thls was based on varlous
types of auxlllary power (e.g. electrlc, pneumatlc, hydraullc),
today thls takes place almost excluslvely as programs ln
puters.
1)
human
computer
lnterface
hetwork
Computer
network
Automatlon
system
Technlcal
process:
lnputs]outputs
Fleldbus
1)
http:]]alex.fh-trler.de]lnfo]automatlslerung.html
1. Programmlng for automatlon technology
1-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
1.1 Abeut this beek
Thls book descrlbes how thls processlng algorlthm ls
oped, tested and optmlsed uslng FST
2)
. The ob|ectlve ls to
enable the user to learn and experlence on hls or her own the
baslc, necessary features of the FST software wlth the ald of
the book. All the examples have been developed wlth
FST software.
1.2 Pregramming Ier autematien techne|egy er the PC
Contrary to programs wrltten for PCs or handheld computers,
for example, programs for automatlon technology must
mally functlon constant human lnterventlon". For
lnstance, whlle the word processor lnto whlch thls text ls
belng entered requlres the human user to constantly be ln
attendance, the weldlng robot must weld the automoblle
body wlthout humans constantly havlng to lntervene.
ever, humans are naturally needed for the process"
to come about ln the flrst place. There ls thus a need for the
plannlng and programmlng hand as well as user lnterventlon.
Today plannlng and programmlng ls done practlcally all the
tlme on PCs uslng programmlng software developed |ust for
thls purpose. Programs are then executed ln the controller.
Thls represents a slgnlflcant dlfference between the
mlng for typlcal PC appllcatlons and for typlcal automatlon
appllcatlons.
ln automatlon technology, the programmlng computers and
the controller computers are two dlstlnct, lndependent unlts.
2)
FST Festo Software Tools
1. Programmlng for automatlon technology
1-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Computer wlth
programmlng
software
(PC wlth FST ú.1)
Computer to control
(FFC Compact,
FFC Standard, CPX...)
ln automatlon technology we thus always have to assume
that at least two machlnes are necessary:
The programmlng machlne and the controller machlne, or
slmply: the controller.
1. Programmlng for automatlon technology
1-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1he basic ru|es eI an f51 preject
2-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 2
2. The baslc rules of an FST pro|ect
2-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
2. 1he basic ru|es eI an f51 preject 2-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1 0vervlew 2-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2. The baslc rules of an FST pro|ect
2-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
2.1 0verview
The followlng should explaln programmlng procedures for
FST ln detall. ¥ou wlll obtaln as complete an overvlew as
posslble. Fverythlng descrlbed has a common basls for the
processlng of an automatlon pro|ectlon wlth some baslc tasks
whlch are always necessary:
ke. What te de Cemment
1 Call up a new pro|ect ln the Pro|ect menu
2 hame the pro|ect ln the dlalog box
3 Select the proper controller,
enter pro|ect comment
¥ou can use FST software to program completely dlfferent
CPus of an entlre controller famlly.
ú l]0conflguratlon There wlll hardly ever be an automatlon pro|ect wlthout any
lnputs or outputs.
5 Programmlng At least a Program0 ls mandatory
0eclslon whether to use a ladder dlagramor a statement llst
6 Make pro|ect ¥ou wlll be automatlcally asked to do thls
7 0ownload pro|ect A connectlon to the controller must exlst to do thls
8 Check And posslbly correct, lmprove, optlmlse
9 0ocument 0escrlbe, make comments, prlnt
2. The baslc rules of an FST pro|ect
2-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
1he Iirst f51 preject: Centre||ing a garage deer
3-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 3
3. The flrst FST pro|ect: Controlllng a garage door
3-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
3. 1he Iirst f51 preject: Centre||ing a garage deer 3-1 . . . . . . . . . . . . . . . . . . . . .
3.1 Pro|ect, l]0s, program, lF ... ThFh ... 0Thkw 3-5 . . . . . . . . . . . . . . . . . . . . . . . .
3.1.1 Pro|ect 3-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.2 Selectlng the controller type 3-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.3 l]0 conflguratlon 3-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.ú Programmlng 3-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.5 Complllng 3-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.6 0ownloadlng the pro|ect 3-3ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.7 Checklng 3-37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.8 0ocumentatlon 3-ú0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.9 The Carage pro|ect 3-ú2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Summary 3-ú3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3. The flrst FST pro|ect: Controlllng a garage door
3-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The flrst practlcal example should follow the example of a
compact controller and also reduced to the most slmple
baslc functlons: A garage door should open and close from
the lnslde and outslde.


    
0PFh
CL0SF
0PFh
CL0SF
 Llmlt swltch (lower)
 Llmlt swltch (upper)
 Carage door
 Motor up and down
 0utslde area of garage door controller
 Key swltch
 lnslde area of garage door controller
The garage door should be controlled ln such a way that
door can be closed at any tlme from the lnslde and
outslde
door can only be opened from the outslde when the
key swltch and the 0PFh button are actuated
neously
door can be opened from the lnslde at any tlme
door always runs up to the llmlt swltch (above) when
openlng
door only closes when the CL0SF button ls belng
pressed.
3. The flrst FST pro|ect: Controlllng a garage door
3-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
These can be represented ln the followlng way:
An lPC FFC FC20
3)
ls used as a controller, that ls, a compact
controller wlth 12 lnputs and 8 output.
3)
0f course, all other FST controllers can also be used ln thls example.
An lPC FFC Standard, such as the FC ú00, would also work well ln
thls example. however, an lPC PS1, whlch offers more upgrade
posslbllltles due to lts modular deslgn, could also been used.
3. The flrst FST pro|ect: Controlllng a garage door
3-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1 Preject, t{0s, pregram, tf ... 1B£k ... 01BRW
we wlll be strlctly adherlng to the order ln Chapter 2
ú)
:
3.1.1 Pro|ect
º Please create a new pro|ect.
º how name your pro|ect 'Carage'
ú)
¥ou wlll flnd thls example as Car_en_s.ZlP on your C0.
3. The flrst FST pro|ect: Controlllng a garage door
3-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.2 Selectlng the controller type
º Please select the proper controller here the FFC
pact
5)
and wrlte a comment lf you wlsh.
5)
lf you are uslng a FFC Standard, thls lmage must look llke
thls:
3. The flrst FST pro|ect: Controlllng a garage door
3-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.3 l]0 conflguratlon
º howopen the l]0 conflguratlon by double-cllcklng the
entry ln the pro|ect wlndow.
¥ou see that an l]0 module has already been entered here.
Thls ls automatlcally entered for all controllers for whlch lt ls
mandatory that a certaln l]0 module be avallable. ln the
umn lw you wlll recognlse that the lnputs begln wlth l0.0, and
that the outputs begln wlth 00.0 ln the column 0w. ¥ou can
change thls speclflcatlon lf necessary.
l]0 conflguratlon for FFC Standard
use a controller type for whlch you have more posslbllltles for
the lnput]output modules, you wlll have to use a l]0 module
here.
1. To do so, rlght-cllck lnto the empty l]0 conflguratlon and
choose lnsert from the context menu or double-cllck lnto
the empty conflguratlon.
2. how open the menu and select the l]0 card that you want
for your appllcatlon.
3. The flrst FST pro|ect: Controlllng a garage door
3-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
A FFC FCú00 has 16 lnputs and 8 outputs. The lnputs are
grouped ln 2 groups of one byte each (8 blts, 8 lnputs)
(FCú00 seen from above).
Select FCú00 from the menu and an lnput word wlll be
slgned to each byte. The followlng wlll therefore be allocated
automatlcally:
l0.0 ... l0.7
l1.0 ... l1.7
(0.00) 00.7
Select FCú00 (word) ln the menu and two lnput bytes wlll be
summarlsed ln one word. The followlng wlll therefore be
cated automatlcally:
l0.0 ... l0.15
00.0 ... 00.7
3. The flrst FST pro|ect: Controlllng a garage door
3-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
l]0 addresses
Perhaps lt ls not qulte that easy to understand what these
addresses mean.
The garage door example shows that sensors, actuators and
the controller are necessary for a process. Sensors and
tors are lndependent devlces (a llmlt swltch, a swltch, a
perature monltor, a valve, a contact, a motor ...). So that the
controller can make use of these devlces, there must a
nectlon between the sensors]actuators and the controller:
The connectlon from the sensors and to the actuators takes
place vla the l]0 modules. These l]0 modules requlre a name
so that the CPu can communlcate wlth them. For FST namlng
always takes place by words, thus 'lw' for 'lnput word' and
'0w' for 'output word'. A slngle blt can then be accessed
wlthln a 'word'.
For larger or nested controllers, there can be many l]0
ules.
3. The flrst FST pro|ect: Controlllng a garage door
3-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Thls ls baslcally nothlng more than an 'address'. lf a postman
carrles letters, then he has, for example, 16 dlfferent letters
for 'Klng Street' the controller would say: 0ata for the
put word 0w66.
The letters are dlstrlbuted to 16 letterboxes on Klng Street
the controller would dlstrlbute to the output blts as follows:
066.0, 066.1, 066.2 .... 066.15
The allocatlon llst for thls example would look llke thls:
3. The flrst FST pro|ect: Controlllng a garage door
3-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.ú Programmlng
ln practlce programmlng ls mostly started by enterlng the
lnputs and outputs lnto the allocatlon llst.
we should proceed ln the same manner.
Allocatlon llst
º 0pen the allocatlon llst wlth a double cllck.
º ln the empty allocatlon llst you can enter the flrst operand
elther agaln by double-cllcklng or by rlght-cllcklng to get
the context menu.
3. The flrst FST pro|ect: Controlllng a garage door
3-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
º howenter all the operands ln the allocatlon llst.
The followlng lmage shows a posslble allocatlon llst.
And here are some rules for the allocatlon llst:
operand's address must match the entry ln the l]0
conflguratlon. lf lw20 were entered ln the l]0
atlon as an lnput word, then the address l20.0 and so
forth would have to be used here.
symbol may have up to 9 characters, no speclal
acters and also no predeflned characters. For lnstance, l0
and v10 are prohlblted as symbollc operands
6)
, as l0 ls
used for lnput and v10 for constant.
comment may conslst of any characters you llke.
6)
¥ou wlll flnd a llst of all FST operands ln sectlon 18.1.
3. The flrst FST pro|ect: Controlllng a garage door
3-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Programm a statement llst
7)
0nce the allocatlon llst has been created, lt ls flnally tlme to
wrlte the program. Fvery FST pro|ect requlred a program wlth
the ho. 0.
klght-cllcklng on the Programs dlrectory ln the pro|ect
dow opens the context menu wlth the posslblllty of lnsertlng
a new program. 0r use the lcon for 'hew Program' or the
sert menu.
how choose the programmlng language you want. Please
note that you cannot automatlcally translate between the
statement llst and the ladder dlagram. Speclfylng one of the
two languages thus applles to the entlre program. 0n the
other hand, programs wlth varlous programmlng languages
can be mlxed wlthln a pro|ect Program 0 could therefore be
wrltten ln statement llst (STL), whlle Program 12 ls ln ladder
dlagram(L0k).
7)
lf you would llke to programln ladder dlagram, please sklp to the
sectlon 'Program as a ladder dlagram' on page 3-20.
3. The flrst FST pro|ect: Controlllng a garage door
3-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
The followlng entrles are now posslble:
Type: Program oder CMP or CFM here lt remalns
at the program
humber: 0 ... 63 here lt remalns 0
verslon: 1 ... 9 here lt remalns 1
Comment: Carage door controller
º Cllcklng 0K wlll open the programwlndow whlch ls stlll
empty. Should the 'shortcut' not be vlslble to you, then
you can open lt by cllcklng Shortcuts ln the vlew menu.
3. The flrst FST pro|ect: Controlllng a garage door
3-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
howthe garage door controller should be descrlbed.
when should the door open!
The door should open lf elther
button ls pressed lnslde 0R
button ls pressed outslde Akß the key swltch ls
ated at the same tlme.
¥ou can use nearly the same words ln the FST statement llst:
ln dolng so you can make almost all the entrles uslng
cuts and the mouse or typlng on the keyboard (or a mlx of
any of these).
Fven the use of the symbols ls released ln comparlson wlth
the absolute operand address. The followlng programls
therefore equlvalent:
3. The flrst FST pro|ect: Controlllng a garage door
3-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
IF I0.2 'Open_in: 'Push button inside Open
OR { I0.4 'Open_out: 'Push button outside Open
AND I0.6 ¡ 'Key: Key switch outside
THEN SET O0.0 'Relay_op: Vl: Relay to open the door
wlth the llne ThFh SFT 00.0, though we swltched on the
motor to open, lt has not been swltched off so far. when
should the motor be swltched off!
The motor should be swltched off when the door ls open.
IF open 'I0.0: Limit keys garage door is open
THEN RESET Relay_op 'O0.0: Vl: Relay to open the door
when closlng the door, the respectlve push button should
remaln actuated contlnuously for securlty reasons.
we could therefore word thls as follows:
The door closes iI CL0SF ls pressed on the lnslde er the
slde and the door ls not closed. 0therwise lt wlll remaln ln
place.
IF { Close_in 'I0.3: Push button inside Close
OR Close_out ¡ 'I0.5: Push button outside Close
AND N closed 'I0.l: Limit keys garage door is closed
THEN SET Relay_clo 'O0.l: V2: Relay to close the door
OTHRW RESET Relay_clo 'O0.l: V2: Relay to close the door
howall the automatlon technology experts wlll be telllng us
that we have forgotten some general condltlons. Flrst of all,
we must make sure that the motor cannot operate ln both
dlrectlons at the same tlme. Consequently, for both dlrectlons
the opposlte dlrectlon must be querled along wlth lt.
Second, we must ensure that the motor remalns ln place
when CL0SF and 0PFh are pressed at the same tlme.
3. The flrst FST pro|ect: Controlllng a garage door
3-17 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The flnal programcould look llke thls:
IF Open_in 'I0.2: Push button inside Open
OR { Open_out 'I0.4: Push button outside Open
AND Key ¡ 'I0.6: Key switch outside
AND N Relay_clo 'O0.l: V2: Relay to close the door
AND N Close_in 'I0.3: Push button inside Close
AND N Close_out 'I0.5: Push button outside Close
AND N open 'I0.0: Limit keys garage door is open
THEN SET Relay_op 'I0.0: Vl: Relay to open the door
IF open 'I0.0: Limit keys garage door is open
OR Close_in 'I0.3: Push button inside Close
OR Close_out 'I0.5: Push button outside Close
THEN RESET Relay_op 'I0.0: Vl: Relay to open the door
IF { Close_in 'I0.3: Push button inside Close
OR Close_out ¡ 'I0.5: Push button outside Close
AND N closed 'I0.l: Limit keys garage door is closed
AND N Relay_op 'O0.0: Vl: Relay to open the door
AND N Open_in 'I0.2: Push button inside Open
AND N Open_out 'I0.4: Push button outside Open
THEN SET Relay_clo 'O0.l: V2: Relay to close the door
OTHRW RESET Relay_clo 'I0.l: V2: Relay to close the door
Fven when lt looks so nlce on paper, one very lmportant
ponent ls stlll mlsslng: The commentary. A program ls only
really 'good' when colleagues wlll stlll understand ln 2 years
what ls lntended now. That ls why a program should have
sound comments.
Perhaps the followlng would be better:
3. The flrst FST pro|ect: Controlllng a garage door
3-18 Festo P.8F-FSTú-L8-Fh en 0ú02hh
""Pro¸ect: Garage
""Author: Bernhard Plagemann
""Date: l October 20l5"
""Open garage door
IF Open_in 'I0.2: Push button inside Open
OR { Open_out 'I0.4: Push button outside Open
AND Key ¡ 'I0.6: Key switch outside
AND N Relay_clo 'O0.l: V2: Relay to close the door
AND N Close_in 'I0.3: Push button inside Close
AND N Close_out 'I0.5: Push button outside Close
AND N open 'I0.0: Limit keys garage door is open
THEN SET Relay_op 'O0.0: Vl: Relay to open the door
""Stop garage door
IF open 'I0.0: Limit keys garage door is open
OR Close_in 'I0.3: Push button inside Close
OR Close_out 'I0.5: Push button outside Close
THEN RESET Relay_op 'O0.0: Vl: Relay to open the door
""Closing the garage door
IF { Close_in 'I0.3: Push button inside Close
OR Close_out ¡ 'I0.5: Push button outside Close
AND N closed 'I0.l: Limit keys garage is closed
AND N Relay_op 'O0.0: Vl: Relay to open the door
AND N Open_in 'I0.2: Push button inside Open
AND N Open_out 'I0.4: Push button outside Open
THEN SET Relay_clo 'O0.l: V2: Relay to close the door
OTHRW RESET Relay_clo 'O0.l: V2: Relay to close the door
here are some more lnstructlons for maklng entrles ln the
statement llst:
can type the statement llst llke you would a letter to
the controller. As soon as you press your program
ls formatted and the comments wlll be added to the
locatlonllst.
must be at least one blank space between each
operatlon and each operand.
blank spaces are allowed ln names, operands or
operatlons.
3. The flrst FST pro|ect: Controlllng a garage door
3-19 Festo P.8F-FSTú-L8-Fh en 0ú02hh
you type somethlng that FST does not recognlse, lt
ls then assumed that you would llke to deflne a new
and. ¥ou wlll then recelve the followlng query:
FST presumes that 'honsens' ls the symbol for a new
operand. Slmply cllck Cancel (or press make the
correctlon and contlnue.
requlres 8oolean sets as a matter of prlnclple. A
ean set conslsts of lF and ThFh, and can posslbly conslst
of 0Thkw ln addltlon. lF, ThFh and 0Thkw may each
only occur exactly one tlme ln a set.
3. The flrst FST pro|ect: Controlllng a garage door
3-20 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Program as a ladder dlagram
8)
0nce the allocatlon llst has been created, lt ls flnally tlme to
wrlte the program. Fvery FST pro|ect requlres a programwlth
the ho. 0.
klght-cllcklng on the Programs dlrectory ln the pro|ect
dow opens the context menu wlth the posslblllty of lnsertlng
a new program. 0r use the lcon for 'hew Program' or the
sert menu.
how choose the programmlng language you want. Please
note that you cannot automatlcally translate between the
statement llst and the ladder dlagram. Speclfylng one of the
two languages thus applles to the entlre program. 0n the
other hand, programs wlth varlous programmlng languages
can be mlxed wlthln a pro|ect Program 0 could therefore be
wrltten ln statement llst (STL), whlle Program 12 ls ln ladder
dlagram(L0k).
8)
¥ou wlll flnd thls pro|ect as Car_en_l.ZlP on your C0.
3. The flrst FST pro|ect: Controlllng a garage door
3-21 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The followlng entrles are now posslble:
Type: Program or CMP or CFM here lt remalns
Program
humber: 0 ... 63 here lt remalns 0
verslon: 1 ... 9 here lt remalns 1
Comment: Carage door controller
Cllcklng 0K wlll open the program wlndow whlch ls stlll
empty. Should the 'shortcut' not be vlslble to you, then you
can open lt by cllcklng Shortcuts ln the vlew menu.
3. The flrst FST pro|ect: Controlllng a garage door
3-22 Festo P.8F-FSTú-L8-Fh en 0ú02hh
how the garage door controller should be descrlbed.
when should the door open! The door should open iI elther
button ls pressed lnslde 0R
button ls pressed outslde Akß the key swltch ls
ated at the same tlme.
ln the ladder dlagram, an 0k becomes a parallel connectlon,
an Ah0 a serles connectlon and a h0T a breaker.
3. The flrst FST pro|ect: Controlllng a garage door
3-23 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Fven the use of the symbols ls released ln comparlson wlth
the absolute operand address. The followlng programls
therefore equlvalent:
however, our program stlll has a ma|or error. Though the door
does begln to open, lt stops rlght away lf one of the buttons
lnvolved ls no longer actuated a truly lnconvenlent way of
openlng the garage.
what ls mlsslng ls 'locklng', the memory of the ladder
gram. ln addltlon, you must deflne how the locklng wlll be set
and deleted. lt ls set wlth the condltlon descrlbed above and
deleted as soon as the garage door ls open. The program wlll
then look llke thls.
3. The flrst FST pro|ect: Controlllng a garage door
3-2ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
A Iew mere instructiens te eperate the |adder diagram
editer
A ladder dlagramls subdlvlded lnto networks. An lndlvldual
network conslsts of 'contacts' und 'colls'.
Contacts and colls can be negated.
Contacts can be swltched ln serles and ln parallel.
networks are elther lnserted before or after the
current network.
addltlonal contact ln serles to an exlstlng contact ls
lnserted by marklng the current contact and lnsertlng
another one before lt uslng the Contact lcon of the
cuts.
3. The flrst FST pro|ect: Controlllng a garage door
3-25 Festo P.8F-FSTú-L8-Fh en 0ú02hh
parallel contact ls added by marklng the contact(s) to
whlch the new contact should be parallel. The shortcuts
are subsequently used.
parallel coll ls added lf the exlstlng coll ls marked
and another ls added uslng the shortcuts.
contact or a coll ls negated (or the negatlon ls undone)
by marklng lt and negatlng lt uslng the shortcuts.
3. The flrst FST pro|ect: Controlllng a garage door
3-26 Festo P.8F-FSTú-L8-Fh en 0ú02hh
coll ls provlded wlth other controller attrlbutes (S set,
k restore, l lncrement, count forwards, 0 decrement,
count backwards) by marklng lt and then rotatlng through
the posslbllltles by means of the shortcuts and cllcklng
the one you want untll lt has been entered.
comments on the operands are dlsplayed ln two llnes
ln these examples. They can be set ln the menu Fxtras
Preferences... L0k Llnes for 0perand Comments.
you type somethlng as an operand that FST does
not recognlse, lt ls then assumed that you would llke to
deflne a new operand. ¥ou wlll then recelve the followlng
query:
3. The flrst FST pro|ect: Controlllng a garage door
3-27 Festo P.8F-FSTú-L8-Fh en 0ú02hh
presumes that 'honsens' ls the symbol for a new
operand. Slmply cllck Cancel (or press make the
correctlon and contlnue.
8ack to the garage door:
when closlng the door, the respectlve push button should
remaln actuated contlnuously for securlty reasons.
we could therefore word thls as follows:
The door closes iI CL0SF ls pressed on the lnslde er the
slde and the door ls not closed. 0therwise lt wlll remaln ln
place.
how all the automatlon technology experts wlll be telllng us
that we have forgotten some general condltlons. Flrst of all,
we must make sure that the motor cannot operate ln both
dlrectlons at the same tlme. Consequently, for both dlrectlons
the opposlte dlrectlon must be querled along wlth lt. Second,
we must ensure that the motor remalns ln place when Close
and 0pen are pressed at the same tlme.
3. The flrst FST pro|ect: Controlllng a garage door
3-28 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The flnal programcould look llke thls:
3. The flrst FST pro|ect: Controlllng a garage door
3-29 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Fven when lt looks so nlce on paper, one very lmportant
ponent ls stlll mlsslng: The commentary. A program ls only
really 'good' when colleagues wlll stlll understand ln 2 years
what ls lntended now. That ls why a program should have
sound comments.
Perhaps the followlng would be better:
3. The flrst FST pro|ect: Controlllng a garage door
3-30 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.5 Complllng
The FST software does not always agree wlth everythlng we
wrlte. A syntax check, whlch searches the programfor formal
errors, ls performed durlng compllatlon. Cllck the lcon for
'8ulld Pro|ect'.
¥ou wlll recelve a message about the check and the
tlon of the statement llst or the ladder dlagram.
3. The flrst FST pro|ect: Controlllng a garage door
3-31 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Frrors ln the statement llst
9)
Thls won't always work out so nlcely on the flrst try.
The followlng example shows an error:
FST reports ú errors ln thls example. The ú errors should be
found ln:
CZ0P00v1.AwL¸2ú] ThFh expected
and
CZ0P00v1.AwL¸2ú] ThFh lnvalld operatlon
and
CZ0P00v1.AwL¸28] lF, 0ThFkw or STFP expected
and
CZ0P00v1.AwL¸29] lF or STFP expected
The meanlng ls:
CZ0P00 Program 00 (P00)
verslon 1
ln llne 2ú
9)
lf you have programmed ln ladder dlagram, please sklp to the
chapter 'Frrors ln the ladder dlagram' on the next page.
3. The flrst FST pro|ect: Controlllng a garage door
3-32 Festo P.8F-FSTú-L8-Fh en 0ú02hh
º 8y double-cllcklng the llne number, e.g. ¸2ú], FST
matlcally sklps to the speclfled spot.
The current llne number can also be seen ln the lower rlght of
the status bar lf the cursor ls ln the programmlng wlndow.
ln thls example, the set beglnnlng lF was entered twlce ln a
8oolean set.
Frrors ln the ladder dlagram
Thls won't always work out so nlcely on the flrst try.
The followlng example shows an error:
3. The flrst FST pro|ect: Controlllng a garage door
3-33 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The three errors should be found ln:
CZ0P00Vl.OUT{l7¡ Unknown operand ???
and
CZ0P00Vl.OUT{l7¡ One~bit operand expected
and
CZ0P00Vl.OUT{23¡ Empty sentence part
The meanlng ls:
CZ0P00 Program 00 (P00)
verslon 1
ln llne 17 of the complled code. 0ouble-cllcklng the
flrst error opens Program 0 and posltlons the cursor ln the
network ln whlch the error ls suspected.
ln thls case, a contact has been entered wlthout statlng the
operand (lnput, output, flag ...).
3. The flrst FST pro|ect: Controlllng a garage door
3-3ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.6 0ownloadlng the pro|ect
º howplease connect your controller to the power and use
the programmlng cable to connect the controller and your
programmlng PC.
ln our example, the FFC Compact FC20, the programmlng
cable for the FFC ls plugged lnto the port wlth the 'C0M'
deslgnatlon, for the programmlng PC, the programmlng
cable ls usually plugged lnto C0M1 or C0M2.
º As soon as the controller has been connected and the
programmlng cable ls plugged ln, you can test whether or
not you are able to establlsh a connectlon by uslng the
'Control Panel' lcon.
Should a connectlon result, you wlll recelve a message whlch
could look llke thls:
3. The flrst FST pro|ect: Controlllng a garage door
3-35 Festo P.8F-FSTú-L8-Fh en 0ú02hh
lf a connectlon does not result, please check
º the settlngs on your PC. 0pen the menu Fxtras, entry
'Preferences...', card 'Communlcatlon'. here you can
check whether the rlght serlal port and the baudrate 9600
have been entered.
º The Power LF0 must llght up green on the controller and
the programmlng cable must be plugged lnto the C0M
port. The kuh LF0 can llght up green, orange or red,
dependlng on how lt was prevlously used.
lf the connectlon was successful, then you can download the
pro|ect.
3. The flrst FST pro|ect: Controlllng a garage door
3-36 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The message '0ownload complete' must be glven ln the
message wlndow.
0ependlng on how your controller was prevlously used, you
must now set the controller to kuh.
P|ease nete
º Please check the kuh LF0:
lf lt ls green, then your controller ls already operatlng ln
kuh mode.
lf the LF0 ls orange, then you must set the controller to
kuh uslng the kuh]ST0P sllde swltch
9)
.
9)
lf you are uslng a FFC Standard, a rotary swltch ls used for
kuh]ST0P. The controller ls ln ST0P ln posltlon 0, ln kuh ln all other
posltlons.
3. The flrst FST pro|ect: Controlllng a garage door
3-37 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.7 Checklng
0f course, lt ls of great lmportance that we check whether the
automatlon pro|ect ls really worklng the way we want lt to. To
do so, actuate the respectlve push buttons and llmlt keys and
observe how the garage door reacts.
however, lt ls also lmportant to observe what the controller ls
dolng and how the automatlon pro|ects reacts from the
troller's perspectlve.
¥ou have two essentlal posslbllltes ln partlcular for thls. Flrst,
you can actlvely observe the program, and second, the lnputs
and outputs.
º To observe the program, please open the wlndow of your
Program 0 and rlght-cllck ln thls wlndow.
¥ou wlll recelve a context menu, lrrespectlv of whether
you have programmed ln statement llst or ladder
gram, and contalned ln the menu ln the entry '0nllne'.
3. The flrst FST pro|ect: Controlllng a garage door
3-38 Festo P.8F-FSTú-L8-Fh en 0ú02hh
º Actlvate the onllne mode, then the status of the lndlvldual
varlables wlll be dlsplayed ln the programwlndow (STL)
or whether the condltlon has been met wlthln a rung
(L0k).
3. The flrst FST pro|ect: Controlllng a garage door
3-39 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln the programwlndow, you wlll recognlse the contexts ln the
onllne mode wlthln the programm excerpt that ls vlslble.
however, lt ls often lmportant to observe varlables
dent of the programwlndow that ls vlslble. Therefore, you
can call up the '0nllne 0lsplay'.
here you can observe the lnputs, for example.
¥ou see ln the dlsplay that the lnputs l0.3, l0.ú and l0.7 are
actlvated.
These opportunltles for observatlon make lt very easy to put
a pro|ect lnto operatlon.
3. The flrst FST pro|ect: Controlllng a garage door
3-ú0 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.8 0ocumentatlon
0f course, nobody can take over for you the task of wrltlng a
manual for your process or machlne. however, FST does allow
you to handle lmportant documentatlon tasks wlthln the
|ect. Thls lncludes:
comments ln the programand
pro|ect documentatlon.
The pro|ect documentatlon ls normally a pure text flle. lf you
double-cllck on 'Pro|ect 0ocumentatlon', a flle pro|ect.txt wlll
open wlth the text edltor actlvated on your wlndows system.
The flle ls stored ln the pro|ect dlrectory of your current
|ect.
3. The flrst FST pro|ect: Controlllng a garage door
3-ú1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The entlre pro|ect can ultlmately be prlnted.
Choose thls entry, you can select the components of the
|ect documentatlon that you want.
3. The flrst FST pro|ect: Controlllng a garage door
3-ú2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.1.9 The Carage pro|ect
lf you also lnstalled sample flles when you lnstalled FST, the
sample pro|ects are already located the FST pro|ect dlrectory.
For the Carage pro|ect, they are:
(programmed ln statement llst)
(programmed ln ladder dlagram).
The sample pro|ects from thls book are archlved on the FST
C0 ln the subdlrectory \Samples\0eutsch or
llsh. lf necessary, you can read themuslng FST (restore).
Select the command kestore ln the Pro|ect menu.
ln the followlng dlalog, look for the flle you want
or CAk_Fh_L.ZlP) on the C0 ln the
subdlrectory \Samples\0eutsch or \Samples\Fngllsh.
3. The flrst FST pro|ect: Controlllng a garage door
3-ú3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
3.2 5ummary
here are most lmportant polnts of thls chapter ln a nutshell.
P|ease nete
lf you are programmlng ln FST, then create a pro|ect flrst.
ls necessary for each lndlvldual controller (each
CPu). The method of proceedlng corresponds to the
lowlng table.
ke. What te de Cemment
1 Call up a new
pro|ect
ln the Pro|ect menu
2 hame the pro|ect ln the dlalog box
3 Select the proper
controller,
enter pro|ect
comment
¥ou can use FST software to program
completely dlfferent CPus of an entlre
controller famlly.
ú l]0conflguratlon There wlll hardly ever be an automatlon
pro|ect wlthout any lnputs and outputs.
5 Programmlng At least a Program0 ls mandatory
6 Make pro|ect ¥ou wlll be automatlcally asked to do
thls
7 0ownload the
pro|ect
A connectlon to the controller must exlst
to do thls
8 Check And posslbly correct, lmprove, optlmlse
9 0ocument 0escrlbe, make comments, prlnt
3. The flrst FST pro|ect: Controlllng a garage door
3-úú Festo P.8F-FSTú-L8-Fh en 0ú02hh
programmlng, the allocatlon llst for the lnputs and
outputs ls usually created flrst.
pro|ects always requlre a Program 0.
llst
ls done wlth lF ... ThFh ... 0Thkw wlthln
a program.
and ThFh must be used exactly one tlme ln every
8oolean set.
may be used but ls not necessary.
dlagram
are programmed wlthln a program.
network conslsts of contacts and colls.
A s|ight|y |arger preject with f51: Centre||ing a
dri||ing machine
ú-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 4
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
4. A s|ight|y |arger preject with f51: Centre||ing a dri||ing machine 4-1 . . . . . . .
ú.1 The drllllng machlne ú-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.1 0peratlon ú-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.2 Actuators and sensors ú-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.3 The program ú-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.1.ú Allocatlon ú-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.2 Program organlsatlon ú-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3 The flrst steps ln the statement llst ú-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3.1 Startlng the program ú-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3.2 Sequentlal program ú-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.3.3 0ownloadlng the pro|ect ú-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú The flrst steps ln ladder dlagram ú-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.1 Startlng the program ú-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.2 Sequentlal program ú-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.3 Step programmlng wlth counters ú-19 . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú.ú.ú 0ownloadlng the pro|ect ú-20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The example of the garage door was qulte nlce at the
nlng, but a great deal of attrlbutes were lndeed mlsslng whlch
begln to make automatlon technology lnterestlng. 0peratlng
modes such as automatlc, manual or lnchlng, for example, or
step-by-step processlng of a programand much more.
That ls why thls chapter should deal wlth a sllghtly more
lenglng pro|ect. The drllllng machlne
 Clamp cyllnder
 0rlll cyllnder
 F|ector



81
82
83

85
86
Let's deflne some general condltlons, as ls always the case ln
an automatlon pro|ect.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
4.1 1he dri||ing machine
ú.1.1 0peratlon
The drllllng machlne ls operated vla a control panel. here you
wlll flnd the followlng buttons:
ßutten functien
Start Starts the automatlc sequence
halt Stops the sequence at the end of a cycle
(breaker)
Contlnuous]
lnchlng mode
Selector swltch that swltches between
automatlc and lnchlng mode. The Start button
ls used ln lnchlng mode to contlnue swltchlng
step-by-step
Stop Stops the sequence lmmedlately (breaker)
Automatlc]
manual
Selector swltch that swltches between
automatlc and manual mode. Manual mode
can only be swltched on when automatlc mode
ls not actlve.
8ack to home
posltlon
keturns the machlne to home posltlon 8ack to
home posltlon can only be started lf the
manual mode ls actlve.
Clamp 8utton for the clamp cyllnder ln manual mode
0rlll 8utton for the drlll cyllnder ln manual mode
F|ect 8utton for the e|ector cyllnder ln manual mode
Fmergency stop Fmergency stop swltches the controller's
outputs wlthout stress. ln addltlon, emergency
stop sends a slgnal to an lnput so the
controller knows about the emergency stop.
After releaslng the emergency stop, the system
must be returned to home posltlon uslng 8ack
to home posltlon before lt can be restarted.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The lndlcator llghts can be used:
ßutten functien
Start llght Llghts up when the system ls ln home posltlon
and automatlc mode can be started uslng Start.
8ack to home Llghts up as long as the home posltlon program
ls actlve
Fmergency llght Shows lf Fmergency stop ls or was actuated
untll the machlne ls agaln ln home posltlon after
the emergency stop
Automatlc llght Shows lf the machlne ls operatlng ln contlnuous
mode
ú.1.2 Actuators and sensors
The drllllng machlne has three actuators: Clamp cyllnder, drlll
cyllnder and e|ector. lf the cyllnders are allocated letters ln
the tradltlonal way, they are then cyllnders A, 8 and C. Fach
cyllnder ls equlpped wlth two llmlt keys, one to clamp and the
other to release.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.1.3 The program
The three cyllnders must operate ln the followlng movement
sequence ln automatlc mode:
A÷ 8÷ 8- A- C÷ C-
The movement sequence ls descrlbed as follows ln the
tlon plan (ls not generated ln FST, thls chart ls merely an
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.1.ú Allocatlon
The allocatlon llst requlres 16 lnputs and 8 outputs. A FFC
Standard FCúú0 ls used as a example controlller. The entlre
allocatlon llst could look llke thls.
10)
Operand Symbol Comment
I0.0 Released Bl: Clamp cylinder is released
I0.l Clamped B2: Clamp cylinder is clamped
I0.2 Drill_dow B3: Drill cylinder is down
I0.3 Drill_up B4: Drill cyllinder is up
I0.2 E¸ected B5: E¸ector is forward
I0.5 E¸_back B6: E¸ector cylinder is back
I0.6 Start Sl: Start button
I0.7 Halt S2: Halt button {breaker¡
I0.8 Continous S3: Continuous mode switch {0=inching mode¡
I0.9 Stop S4: Stop button {breaker¡
I0.l0 Automatic S5: Automatic switch {0=manual¡
I0.ll Home_pos S6: Back to home position button
I0.l2 Man_CylA S7: Clamp cylinder manual button
I0.l3 Man_CylB S8: Drill cylinder manual button
I0.l4 Man_CylC S9: E¸ector manual button
I0.l5 Em_Stop Sl0: Emergency stop switch {breaker¡
O0.0 Aplus Yl: Clamp the workpiece
O0.l Aminus Y2: Release the workpiece
O0.2 Driller Y3: Drill cylinder
O0.3 E¸ector Y3: E¸ector
O0.4 L_Start Hl: Start light
O0.5 L_Home H2: Back to home position light
O0.6 L_Em H3: Emergency stop light
O0.7 L_Auto H4: Automatic continuous mode light
10)
A note on proceedlng: l created the allocatlon llst ln an Fxcel
table. Thls allows for slmple copylng and changlng. Then l
completely marked, copled and pasted the table ln FST. ln so
dolng, FST checks for correct syntax, ln thls example lnvalld
lengths, for example. The symbol may have no more than
the comment no more than 36.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
4.2 Pregram erganisatien
To ease programmlng, lt ls commonly accepted these days
that you dlvlde a pro|ect lnto 'sectlons', 'blocks', 'modules' or
as ln FST lnto pregrams.
Please observe the followlng terms:
Fverythlng havlng to do wlth an lndlvldual central unlt (or an
lndlvldual central controller) ls named 'Pro|ect'.
There are 'programs' wlth the pro|ect, exactly up a maxlmum
of 6ú programs numbered from 0 to 63, therefore P0 ... P63.
The programP0 plays a speclal role. lt ls the programthat ls
automatlcally started when the controller ls swltched on. lf lt
ls not avallable, the controller sends an error message and
swltches to Stop.
All the programs can work slmultaneously, the term here ls
'multltasklng'.
To organlse the '0rllllng machlne' pro|ect, you could organlse
the programs as follows:
P0 0rganlsatlon program
P1 Automatlc programand lnchlng
P2 8ack to home posltlon
P3 kecognlslng and treatlng errors ln the machlne
Pú Manual program
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Thls results ln a pro|ect wlndow as follows:
The allocatlon llst ls also expanded:
Operand Symbol Comment
P0 Organisation program
Pl Automatic program
P2 Back to home position
P3 Error mode
P4 Manual mode
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
4.3 1he Iirst steps in the statement |ist
11{12)
So that the '0rllllng machlne' pro|ect can gradually come
about, lndlvldual tasks should be fulfllled consecutlvely. To
be able to 'see' anythlng at all, a slmple automatlc sequence
should be programmed flrst. we need programs P0 and P1 to
do thls.
ú.3.1 Startlng the program
The automatlc program should be temporarlly started ln
gram P0 wlthout any condltlons. lt only needs two llnes to do
thls
13)
:
IF NOP
THEN SET Pl
lt ls also posslble to swltch on (SFT)
1ú)
and off (kFSFT) a
program|ust as you would an output.
11)
¥ou wlll flnd thls flrst drllllng machlne pro|ect as 0rlll_01.ZlP on
your C0.
12)
lf you would llke to programln ladder dlagram, sklp to sectlon ú.ú.
13)
hote for those adept ln FST software for FPC controllers: There ls
no longer an lF h0P ThFh Pw. The Pwoperatlon has been
omltted.
1ú)
hote for those adept ln FST software for FPC controllers: The
query 'lF h PX ThFh SFT PX' ls no longer necessary. The command
SFT PX does not cause a return |ump ln actlve PX.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.3.2 Sequentlal program
The automatlc programls a programln whlch one step ls
processed after the other. The FST software provldes the
STFP operatlon for thls type of program, the sequence
program. we can therefore programthe automatlc sequence
qulte slmply:
"" Automatic mode of the drilling machine
STEP Aplus
IF Released 'Bl to I0.0 Clamp cylinder is released
AND Bohr_up 'B4 to I0.3 Drill clinder is up
AND E¸_back 'B6 to I0.5 E¸ector cylinder is back
AND Em_Stop 'Sl0 to I0.l5 Emergency stop {breaker¡
AND Stop 'S4 to I0.9 TStop switch {breaker¡
AND Start 'Sl to I0.6 Start button
THEN RESET Aminus 'Y2 to O0.l Clamp cylinder back
SET Aplus 'Yl to O0.0 Clamp the workpiece
STEP Bplus
IF Released 'B2 to I0.l Clamp cylinder is forward
THEN SET Driller 'Y3 to O0.2 Drill cylinder
STEP Bminus
IF Drill_dow 'B3 to I0.2 Drill clinder is down
THEN RESET Driller 'Y3 to O0.2 Drill cylinder
STEP Aminus
IF Bohr_up 'B4 to I0.3 Drill clinder is up
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
STEP Cplus
IF Released 'Bl to I0.0 Clamp cylinder is released
THEN SET E¸ector 'Y4 to O0.3 E¸ector
STEP Cminus
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
JMP TO Aplus
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.3.3 0ownloadlng the pro|ect
lf you would llke to test the flrst slmple verslon, the programs
P2, P3 and Pú must be deactlvated before you can complle.
Although they are created, they have not yet been used and
are stlll empty.
Slmply use the mouse to cllck ln the approprlate box.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
4.4 1he Iirst steps in |adder diagram
15)
So that the '0rllllng machlne' pro|ect can gradually come
about, lndlvldual tasks should be fulfllled consecutlvely. To
be able to 'see' anythlng at all, a slmple automatlc sequence
should be programmed flrst. we need programs P0 and P1 to
do thls.
ú.ú.1 Startlng the program
The automatlc program should be temporarlly started ln
gram P0 wlthout any condltlons. ¥ou only need a network to
do
lt ls also posslble to swltch on (S)
16)
and off (k) a program
|ust as you would an output.
P|ease nete
Klndly observe that programP1 ls set here wlth the
trlbute S. An asslgnment (coll wlthout attrlbute) ls lnvalld
for programs (P...).
15)
¥ou wlll flnd thls flrst drllllng machlne pro|ect as 0rlll_L1.ZlP on
your C0.
16)
hote for those adept ln FST software for FPC controllers: The query
'lF h PX ThFh SFT PX' ls no longer necessary. The command SFT PX
does not cause a return |ump ln actlve PX.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.ú.2 Sequentlal program
The automatlc programls a programln whlch one step ls
cessed after the other. A step structure ls slmulated ln the
ladder dlagramelther wlth a counter or wlth flags.
mlng wlth flags wlll very llkely occur more often (even lf lt ls
not more comfortable).
Step programmlng wlth flags
Fvery step recelves a slmple self locklng. The self locklng ls
set by an Ah0 llnk from the transltlon condltlon for thls step
and the query whether the prevlous step ls
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
8oth the flrst and the last step each have a speclal feature.
the flrst step, there ls not a transltlon condltlon.
fore, the start condltlon must be worded preclsely enough
that the controller cannot be accldentally started a
ond tlme ln the mlddle of the automatlc sequence. ln case
of doubt, crltlcal steps must be querled as to whether or
not they are actlve, lf necessary.
the last step, there ls not a next step. Therefore, the last
step ls not programmed as locklng. lt ls automatlcally
deleted as soon as the prevlous one has been deleted.
however, here you must take care that only a slngle CPu
cycle ls avallable to actlons of the last step. lf necessary,
another step must be programmed to make sure that the
last step can actlvely cause somethlng.
Flnally, the controller's outputs are swltched at the end of the
program. ln the process lt ls lnvestlgated for each output ln
whlch steps lt must be actlve.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The programcould look llke thls:
Sequencer for steps 1 to 3
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-17 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Sequencer for steps ú to 6
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-18 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Swltchlng
P|ease nete
the flags used ln such a programare remanent
17)
, the
last actlve step wlll remaln ln the event of power loss. lf
you wlsh to do so, then the warmrecovery after the
power supply ls restored must be planned preclsely.
the flags used are not remanent, they wlll lose thelr
content when the power supply ls swltched off, the
gram wlll then always begln wlth the flrst step after
belng swltched on. ln the above example, the flags 300.0
and followlng have been chosen dellberately, as thls flag
range ls not remanent for the FFC controllers (FFC
pact, FFC Standard).
17)
kemanence deslgnates secure behavlour of a PLC operand ln the event of power loss. ln the event
of loss of electrlc energy, the flags recelve the most recent status, thus 0 or 1. hon-remanent or
volatlle operands become 0 when they are not supplled wlth energy.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-19 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.ú.3 Step programmlng wlth counters
lf a counter
18)
ls used lnstead of flag blts, then the counter
status' query ls the flrst part of the every step. A step looks
llke
The |ump to certaln step occurs by loadlng a number ln the
step counter, as wlth a return |ump at the beglnnlng.
18)
¥ou wlll flnd thls program example as 0rlll_L2.ZlP on your C0.
ú. A sllghtly larger pro|ect wlth FST: Controlllng a drllllng machlne
ú-20 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ú.ú.ú 0ownloadlng the pro|ect
º lf you would llke to test the flrst slmple verslon, the
grams P2, P3 and Pú must be deactlvated before you can
complle. Although they are created, they have not yet
been used and are stlll empty.
º Slmply use the mouse to cllck ln the approprlate box.
1he 51£P eperatien in the statement |ist
5-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 5
5. The STFP operatlon ln the statement llst
5-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
5. 1he 51£P eperatien in the statement |ist 5-1 . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1 The STFP 5-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 The contect of a step 5-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 Colng to the next step 5-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.ú The name of the step 5-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5 }umplng from step to step 5-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6 The last step 5-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7 The alternatlve sequencer 5-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8 The parallel sequencer 5-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5. The STFP operatlon ln the statement llst
5-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln the prevlous chapter we already used the operatlon STFP,
but largely lntultlvely, that ls, wlthout exactly knowlng why
whlch step causes somethlng. ln thls chapter we want to take
a closer look at the mysterlous STFP
19)
operatlon.
So here are some rules.
As soon as the STFP operatlon ls used ln a program
one slngle step ls always actlve ln thls program
step ls taken after the other lf 'somethlng can be
done' ln the last 8oolean set (lF ... ThFh ...0Thkw).
Thls means that lt wlll go to the next step lf
a 8oolean set conslstlng of only lF ... ThFh the lF
part ls fulfllled or
a 8oolean set conslstlng of lF ... ThFh ... 0Thkw,
the ThFh part (fulfllled condltlon) or the 0Thkw part
(non-fulfllled condltlon) was processed.
can |ump between steps uslng the operatlon '}MP T0'
|ump must be deflned ln the last step or the program
wlll be termlnated.
19)
Ladder dlagram programmers can sklp thls chapter wlthout havlng
to substltute another one for lt.
5. The STFP operatlon ln the statement llst
5-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
5.1 1he 51£P
The baslc support provlded by the Step operatlon ln
mlng ls |ust thls: lf there are steps ln a program, only a slngle
step can be actlve at a tlme, all the other steps wlll not be
observed. lmaglne a step programwlth 170 steps and
Provlded that the programltself ls actlve (see the
chapter 'Multltasklng'), then only that sectlon of the 1800
llnes of program code ls processed whlch ls part of the step
currently actlve.
Conslder the step Amlnus ln the automatlc program.
The followlng ls asked ln thls step:
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill cylinder is up
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
The condltlon 0rlll_up, that ls, that the drlll ls up, ls also
fulfllled ln the step Aplus. Thls condltlon would not sufflce on
lts own to release cyllnder A agaln.
ln addltlon, you must make sure that the part
been clamped and
The prevlous steps must therefore already be completely
processed before the step Amlnus can be observed ln the
flrst place.
¥ou can lmaglne that the step programls no longer 1800 llnes
(to adhere to the example above) but only 10 or 15 llnes, thus
exactly as long as the current step. Thls applles untll you go
to the next step.
5. The STFP operatlon ln the statement llst
5-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
5.2 1he centent eI a step
The usual 8oolean sets can be ln a step:
lF ... ThFh (... 0Thkw)
The operatlon 0Thkw should be used ln a step programonly
after conslderatlon, as lt lmmedlately goes to the next step.
Many such 8oolean sets can be ln a step, the number ls
practlcally unllmlted.
5.3 Ceing te the next step
0f course, lt ls of great lmportance to go from one step to the
next. Colng to the next step ls deflned as follows:
0ne goes from the currently actlve step to the next step
currently actlve step becomes lnactlve and the next
step becomes actlve) lf 'somethlng can be done' ln the last
8oolean set (lF ... ThFh ... 0Thkw). Thls means that lt wlll go
to the next step lf
a 8oolean set conslstlng of only lF ... ThFh the lF part ls
met or
a 8oolean set conslstlng of lF ... ThFh ... 0Thkw, the
ThFh part (fulfllled condltlon) or the 0Thkw part
(non-fulfllled condltlon) was processed.
Please observe: The last 8oolean set of a step ls always
meant here!
5. The STFP operatlon ln the statement llst
5-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Fxample:
STEP Example
IF I.0
THEN SET O0.0
IF N I0.l
THEN SET Fl0.0
RESET Fl00.0
IF Fl0.0
THEN RESET Ol0.5
STEP Forward
ln thls example, only the two llnes
lF F10.0
ThFh kFSFT 010.5
are responslble for golng from the Fxample step to the
ward step. All the other llnes are executed as long as the step
ls actlve (therefore at least one tlme).
As long as the condltlon to go to the next step thls ls lF
F10.0 ln thls example ls not met, thls step ls processed
cycllcally, always beglnnlng wlth the flrst llne after the llne
STFP Fxample.
5. The STFP operatlon ln the statement llst
5-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
5.4 1he name eI the step
¥ou can |ump from one step to another. To do thls (and only
thls), you need a step name. The example of the drllllng
chlne could thus forego many step names. The example
mlght look llke thls:
STEP Aplus
IF Released 'Bl to I0.0 Clamp cylinder is released
AND Drill_up 'B4 to I0.3 Drill clinder is up
AND E¸_back 'B6 to I0.5 E¸ector cylinder is back
AND Em_Stop 'Sl0 to I0.l5 Emergency stop {breaker¡
AND N Stop 'S4 to I0.9 Stop switch {breaker¡
AND Start 'Sl to I0.6 Start button
THEN RESET Aminus 'Y2 to O0.l Clamp cylinder back
SET Aplus 'Yl to O0.0 Clamp the workpiece
STEP
IF Released 'B2 to I0.l Clamp cylinder is forward
THEN SET Driller 'Y3 to O0.2 Drill cylinder
STEP
IF Drill_dow 'B3 to I0.2 Drill clinder is down
THEN RESET Driller 'Y3 to O0.2 Drill cylinder
STEP
IF Drill_up 'B4 to I0.3 Drill clinder is up
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
STEP
IF Released 'Bl to I0.0 Clamp cylinder is released
THEN SET E¸ector 'Y4 to O0.3 E¸ector
STEP
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
JMP TO Aplus
5. The STFP operatlon ln the statement llst
5-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
0nly the step Aplus ls '|umped to' and thus requlres a step
name. Step names may
at most 9 characters
have any speclal characters or any blank spaces
(both 'A÷' and 'A plus' are prohlblted)
be used twlce (wlthln a program)
have numbers ('Step1' ls a valld name, as ls '1').
5.5 |umping Irem step te step
The condltlon to go the next step allows you to swltch from
one step to the next. Thls ls baslcally an lmpllclt |ump, that ls,
a |ump that ls programmed wlthout lt belng expressly wrltten.
¥ou could also wrlte the |umps wlthout maklng the program
any better or worse, lt would slmply mean a blt more work.
5. The STFP operatlon ln the statement llst
5-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
"" Automatic mode of the drilling machine
STEP Aplus
IF Released 'Bl to I0.0 Clamp cylinder is released
AND Drill_up 'B4 to I0.3 Drill clinder is up
AND E¸_back 'B6 to I0.5 E¸ector cylinder is back
AND Em_Stop 'Sl0 to I0.l5 Emergency stop {breaker¡
AND N Stop 'S4 to I0.9 Stop switch {breaker¡
AND Start 'Sl to I0.6 Start button
THEN RESET Aminus 'Y2 to O0.l Clamp cylinder back
SET Aplus 'Yl to O0.0 Clamp the workpiece
JMP To Bplus
STEP Bplus
IF Released 'B2 to I0.l Clamp cylinder is forward
THEN SET Driller 'Y3 to O0.2 Drill cylinder
JMP To Bminus
STEP Bminus
IF Drill_dow 'B3 to I0.2 Drill clinder is down
THEN RESET Driller 'Y3 to O0.2 Drill cylinder
JMP To Aminus
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill clinder is up
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
JMP To Cplus
STEP Cplus
IF Released 'Bl to I0.0 Clamp cylinder is released
THEN SET E¸ector 'Y4 to O0.3 E¸ector
JMP To Cminus
STEP Cminus
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
JMP TO Aplus
5. The STFP operatlon ln the statement llst
5-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
however, there are hardly any machlnes anymore that work ln
such a slmple and stralghtforward manner as attempted by
thls very flrst drllllng machlne program. we wlll usually come
across branchlng (and wlll also be expandlng the drllllng
chlne program).
Take the followlng example:
STEP Example
IF Large
THEN JMP TO Large pack
IF Small
THEN JMP TO Small pack
IF N Large
AND N Small
THEN JMP TO Error
ln thls step the declslon ls taken on how many packaglng
slzes should be produced elther large or small. lf the
aglng slze ls not deflned, then somethlng ls wrong,
quently, the program|umps to the Frror step.
what wlll happen now lf due to a strange sltuatlon both large
and small packages should be produced at the same tlme,
that ls, lf the varlables Large and Small are both true ('1' or
'hlgh' or 'TkuF')!
Then FST works through the programln strlct adherence to
the llne order:
The slze ls asked for ln the flrst llne. lf thls condltlon ls met,
the programwlll |ump to the step Large pack. Then lt
tlnues ln thls step. The query for Small wlll therefore no
longer be read at all.
Ceneral:
lf the condltlon ls true, a |ump ls made lmmedlately ln the
event of an lF ... ThFh }MP T0. All the programllnes are no
longer processed after the |ump.
5. The STFP operatlon ln the statement llst
5-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
5.6 1he |ast step
There must be a |ump ln the last step of a program.
wlse the programwlll be swltched off as soon as the last
condltlon has been met.
Most programmers add an uncondltlonal |ump. That would
look llke thls ln our example:
STEP Cminus
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
JMP TO Aplus
IF NoP
THEN JMP To Cminus
The lF h0P ls always true, belng an uncondltlonal condltlon.
Consequently the same step contlnues to be worked on ln
thls last step untll the condltlon lF F|ected has been met.
5.7 1he a|ternative sequencer
lt ls necessary ln nearly all pro|ects to make declslons
tually excludlng one another:
Stop actuated or not!
verslon 1 or verslon 2 belng produced!
there an error!
The query about the alternatlve ls lnserted for the
mlng ln a step.
5. The STFP operatlon ln the statement llst
5-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
¥ou already saw an example of thls ln sectlon 5.5:
STEP Example
IF Large
THEN JMP TO Large pack
IF Small
THEN JMP TO Small pack
IF N Large
AND N Small
THEN JMP TO Error
P|ease nete
The actlve step (ln thls case the STFP Fxample) becomes
lnactlve as soon a condltlon ls met and a |ump ls made. A
clear prlorlty rule ls thus present lf multlple condltlons are
met.
lf both the condltlons 'Large' and 'Small' are met ln the
example above, then a |ump ls made to the STFP Large pack.
5.8 1he para||e| sequencer
Multlple sequences must be processed ln parallel ln many
slmllar cases. The FST statement llst does not have a parallel
sequencer ln any programs. lf two sequencers should be
cessed ln parallel, a second programcontalnlng the parallel
sequencer ls slmply actlvated.
Flags can be used to synchronlse the sequencers.
Mu|titasking with f51: 1he dri||ing machine's
eperating medes
6-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 6
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
6. Mu|titasking with f51: 1he dri||ing machine's eperating medes 6-1 . . . . . . . .
6.1 Programs work slmultaneously 6-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 Supervlslng programs 6-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3 Startlng programs wlth tlme llmlts 6-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.ú Fxchanglng data among programs 6-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
we have prevlously used only two programs for the drllllng
machlne, to be preclse only one, as the programP1 ls started
only ln the programP0. however, uslng programs can brlng
us a great deal further. So here are some explanatlons about
the programs' concept.
6.1 Pregrams werk simu|taneeus|y
FST supports up to 6ú programs, all of whlch can work
taneously. 'Slmultaneously' means that they appear to work
at the same tlme. however, that ls not completely true, of
course. For the central unlt does not have 6ú mlcroprocessors
worklng through the 6ú programs, rather, |ust one. As a
consequence, thls one processor swltches very qulckly from
one program to another. A complete loop of the processor, a
processor cycle, thus processes all 6ú programs one after the
other.
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
And then there are the lnputs and outputs at the beglnnlng
and end of processlng: The slgnal statuses are read at the
beglnnlng and wrltten at the end.
The processor stops for a brlef moment to check and see lf
there ls somethlng to be done ln the program, lf yes, lt takes
care of lt there and moves on to the next program. Thls
happens so qulckly that lt appears on the outslde that all the
programs are runnlng at the same tlme slmultaneouly, or
'multltasklng'.
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
6.2 5upervising pregrams
we have already polnted out that only the programP0 plays a
speclal role, lt ls automatlcally actlvated when the controller
ls swltched on. All the other programs never actlvate on thelr
own, rather, they must be expllcltly actlvated ln the pro|ect.
As a consequence, operatlons are needed to supervlse
grams. There are two operatlons ln partlcular for thls:
P and PS.
P ls the programltself. A programcan be swltched on (SFT)
and off (kFSFT). A programcan also be querled as to whether
lt ls actlve uslng lF P5 or lF h P5, |ust as an operand can be
used for a contact or a coll ln the ladder dlagram.
P5 ls the program status. Fach programalso has a program
status. For example, PS0 belongs to P0. The programstatus
can halt a program durlng program executlon (kFSFT PS5) or
lt can contlnue executlon (SFT PS5). ¥ou can also ask lf the
programstatus ls actlve (lF PS5) or lnactlve (lF h PS5).
what ls the dlfference between programand programstatus!
programstatus PS ls completely meanlngless for the
ladder dlagram. lt exlsts but ls not needed.
statement llst the programstatus ls lmportant ln
cesslng programs wlth the STFP operatlon.
Take the automatlc programfor the drllllng machlne. lf for
lnstance the program ls ln the 8plus step, the drlller should
be run down.
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
For some reason (Fmergency Stop, materlal |am or somethlng
else), the machlne ls halted, the drlller ls changed, the materlal
ls taken out and the process ls supposed to start from the
beglnnlng agaln. For thls purpose the Program P1 ls flrst reset
and then restarted from the beglnnlng (SFT P1).
The programhas to be halted for another reason
lf the programls contlnued uslng SFT PS1, lt wlll contlnue
worklng ln the step 8plus and wlll not start over from the
beglnnlng.
Program and programstatus can be summarlsed as follows:
PregramP Pregram status P5 5tatus
0 0 lnactlve
0 1 reserved
1 0 actlve but halted
1 1 actlve and processed
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
6.3 5tarting pregrams with time |imits
As descrlbed, the programs are processed slmultaneously.
Cycle tlmes depend on the length of the program. The more
programllnes you pack lnto a program, the longer the cycle
tlme wlll be. however, there are appllcatlons whlch should not
be contlnuously processed but perhaps one every second or
mlnute. ¥ou can use the module Fú to make thls happen.
here lt ls agreed upon that a programwlll be processed wlth
tlme llmlts, whereas the order of processlng from P0 to P63
and back to P0 does not change. Should the processor
come upon a programcalled up wlth tlme llmlts, then lt wlll
check whether the deslred tlme ls elapsed, lf yes, thls
gram ls processed, lf not, lt ls passed over.
6. Multltasklng wlth FST: The drllllng machlne's operatlng modes
6-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
6.4 £xchanging data ameng pregrams
lnputs, outputs, flags, reglsters, tlmes and counters are
global ln FST, l.e., they apply to all the programs.
Communlcatlon among the programs occurs ln the usual way
vla flags. There are up 160 000 lndlvldual ones whlch can be
addressed ln 10 000 flag words, thus from F0.0 to F9999.15.
1he dri||ing machine grews in statement |ist
7-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 7
7. The drllllng machlne grows ln statement llst
7-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
7. 1he dri||ing machine grews in statement |ist 7-1 . . . . . . . . . . . . . . . . . . . . . . . .
7.1 Startlng and stopplng the automatlc program 7-3 . . . . . . . . . . . . . . . . . . . . . . . .
7.2 lnchlng mode 7-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.3 Fdge detectlon 7-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.3.1 Programmlng for edge detectlon 7-11 . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.ú The home posltlon program 7-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7. The drllllng machlne grows ln statement llst
7-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The long preface merely served the purpose of brlnglng the
drllllng machlne program somewhat closer to the reallty of
modern machlne controllers. After all, the organlsatlon of
operatlng modes such as automatlc, manual, etc. must be
programmed flrst.
7.1 5tarting and stepping the autematic pregram
The automatlc program ls started uslng 'Start' and can then
work cycllcally (a query comes later on whether materlal ls
stlll avallable ln the drop magazlne).
however, lt may only be started lf the machlne ls ln home
posltlon, nelther stop, halt nor emergency stop ls actuated
and the back to home posltlon programand the manual
gram are not actlve.
we can therefore program as follows:
"" Switch on automatic mode
IF Start 'Sl: Start button
"" Home position
AND Released 'Bl to I0.0 Clamp cylinder is released
AND Drill_up 'B4 to I0.3 Drill clinder is up
AND E¸_back 'B6 to I0.5 E¸ector cylinder is back
"" Halt buttons
AND Halt 'S2 to I0.7 Halt button {breaker¡
AND Stop 'S4 to I0.9 TStop switch {breaker¡
AND Em_Stop 'Sl0 to I0.l5 Emergency stop {breaker¡
""Programs
AND N P2 'Back to home position
AND N P4 'Manual mode
THEN SET Pl 'Automatic and inching
7. The drllllng machlne grows ln statement llst
7-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
As the automatlc mode should now run ln contlnous mode,
the automatlc program must be modlfled.
"" Automatic mode of the drilling machine
STEP Aplus
IF Released 'Bl to I0.0 Clamp cylinder is released
AND Drill_up 'B4 to I0.3 Drill clinder is up
AND E¸_back 'B6 to I0.5 E¸ector cylinder is back
THEN RESET Aminus 'Y2 to O0.l Clamp cylinder back
SET Aplus 'Yl to O0.0 Clamp the workpiece
STEP Bplus
IF Clamped 'B2 to I0.l Clamp cylinder is forward
THEN SET Driller 'Y3 to O0.2 Drill cylinder
STEP Bminus
IF Drill_dow 'B3 to I0.2 Drill clinder is down
THEN RESET Driller 'Y3 to O0.2 Drill cylinder
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill clinder is up
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
STEP Cplus
IF Released 'Bl to I0.0 Clamp cylinder is released
THEN SET E¸ector 'Y4 to O0.3 E¸ector
STEP Cminus
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
JMP TO Aplus
IF NOP
THEN JMP TO Cminus
7. The drllllng machlne grows ln statement llst
7-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Although the automatlc programruns endlessly, lt cannot be
halted any more.
Two buttons are provlded for thls ln the operatlon: ST0P
stops lmmedlately, hALT stops after the end of the cycle.
ST0P ls very easy to program, lt merely resets the automatlc
program.
hALT ls a blt more compllcated, as the hALT button can be
actuated anytlme durlng the programcycle but only becomes
effectlve at the end of the cycle. Therefore, we wlll need a flag
to note that hALT has been actuated. Thls flag must then
tervene at the end of the cycle.
The organlsatlon could be expanded ln thls way:
"" Stop automatic
IF N Stop 'S4 to I0.9 Stop button {breaker¡
THEN RESET Pl 'Automatic and inching""
Halt after end of cycle
IF N Halt 'S2 to I0.7 Halt button {breaker¡
THEN SET F_HALT 'Flag HALT actuated
7. The drllllng machlne grows ln statement llst
7-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
we can expand the last step ln automatlc mode:
STEP Cminus
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
STEP Halt
IF E¸_back 'B6 to I0.5 E¸ector cylinder is back
AND N F_HALT 'Flag HALT actuated
THEN JMP TO Aplus
IF F_HALT 'Flag HALT actuated
THEN RESET F_HALT 'Flag HALT actuated
RESET Pl 'Automatic and inching
IF NOP
THEN JMP TO Halt
lf a mlnlmal programls added to the programs P2 and Pú
now belng used, we can thus complle and use the modlfled
pro|ect.
IF NOP
THEN NOP
7. The drllllng machlne grows ln statement llst
7-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
7.2 tnching mede
lnchlng mode means that the automatlc sequence ls
cessed ln steps, whereas golng from one step to the next
depends on addltlonal lnput from operatlng personnel. An
lnchlng push button ls requlred whlch ln our example ls
lmplemented wlth the start push button lnto practlce.
¥ou could formulate thls ln general as follows:
how thls condltlon could be worked lnto every step, of
course. Let's take the step Amlnus for example.
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill clinder is up
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
lf the condltlon to go the next step should be represented as
lt was prevlously, we must programas follows:
7. The drllllng machlne grows ln statement llst
7-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill clinder is up
AND { Continuous 'S3 to I0.8 Continuous {0=Inching mode¡
OR N Continuous 'S3 to I0.8 Continuous {0=Inching mode¡
AND Start ¡ 'Sl to I0.6 Start button
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus
Thls procedure would be posslble, but lt lnflates the
matlc program unnecessarlly. The comblned Ah0]0k llnk,
whlch lnfluences golng to the next step lndependently from
the process condltlon, can be programmed ln the
tlon programand used as a flag ln automatlc mode. we can
programfor once ln the organlsatlon program:
"" Forward flag for inching mode
IF Pl 'Automatic and inching
AND { Continuous 'S3 to I0.8 Continuous {0=Inching mode¡
OR N Continuous 'S3 to I0.8 Continuous {0=Inching mode¡
AND Start ¡ 'Sl to I0.6 Start button
THEN SET F_forward 'Flag advance condition inching
OTHRW RESET M_Continue 'Flag advance condition inching
To be able to lnsert thls flag lnto the automatlc program,
whlch must walt ln lnchlng mode:
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill clinder is up
AND F_Forward 'Flag go to next step condition inching
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
7. The drllllng machlne grows ln statement llst
7-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The program
21)
could now look llke thls:
"" Automatic mode of the drilling machine
STEP Aplus
IF Released 'Bl to I0.0 Clamp cylinder is released
AND Drill_up 'B4 to I0.3 Drill clinder is up
AND E¸_back 'B6 to I0.5 E¸ector cylinder is back
THEN RESET Aminus 'Y2 to O0.l Clamp cylinder back
SET Aplus 'Yl to O0.0 Clamp the workpiece
STEP Bplus
IF Clamped 'B2 to I0.l Clamp cylinder is forward
AND F_Forward 'Flag go to next step condition inching
THEN SET Driller 'Y3 to O0.2 Drill cylinder
STEP Bminus
IF Drill_dow 'B3 to I0.2 Drill clinder is down
AND F_Forward 'Flag go to next step condition inching
THEN RESET Driller 'Y3 to O0.2 Drill cylinder
STEP Aminus
IF Drill_up 'B4 to I0.3 Drill clinder is up
AND F_Forward 'Flag go to next step condition inching
THEN RESET Aplus 'Yl to O0.0 Clamp the workpiece
SET Aminus 'Y2 to O0.l Clamp cylinder is back
STEP Cplus
IF Released 'Bl to I0.0 Clamp cylinder is released
AND F_Forward 'Flag go to next step condition inching
THEN SET E¸ector 'Y4 to O0.3 E¸ector
STEP Cminus
IF E¸ected 'B5 to I0.4 E¸ector cylinder is forward
AND F_Forward 'Flag go to next step condition inching
THEN RESET E¸ector 'Y4 to O0.3 E¸ector
JMP TO Aplus
IF NOP
THEN JMP TO Cminus
21 ¥ou wlll flnd the pro|ect as 0rlll_03.ZlP on your C0.
7. The drllllng machlne grows ln statement llst
7-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
7.3 £dge detectien
The lnchlng mode, programmed ln thls way, now has a
characterlstlc vlewed as belng elther 'correct' or 'wrong',
dependlng on the appllcatlon.
lf the machlne ls ln lnchlng mode, lt ls sufflclent to rest on the
Start push button (keep lt held down) to ensure that the
quence ls contlnuously processed.
lt ls demanded ln some appllcatlons that the machlne can
work exactly one step forward when a push button ls
ated.
what we really want ln thls case ls for the machlne to go to
the next step when your flnger starts to actuate the Start
push button. The termfor thls ln automatlon technology ls
edge detectlon.
Colng from step to step should take place by means of the
rlslng edge but not the 1 slgnal.
7. The drllllng machlne grows ln statement llst
7-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
7.3.1 Programmlng for edge detectlon
Fdge detectlon ls programmed very slmply ln FST uslng a
flag.
"Edge detection
IF N Edge_flag 'Flag edge detection Start button
AND Start 'Sl to I0.6 Start button
THEN SET Edge_flag 'Flag edge detection push button start
IF N Start 'Sl to I0.6 Start button
THEN RESET Edge_flag 'Flag edge detection Start button
The condltlon 'lF h Fdge_flag Ah0 Start' ls met for exactly
one controller cycle lf the Start button ls actuated.
¥ou get a negatlve edge when you reverse the loglc.
"" Negative edge
IF N Edge_n 'Flag for negative edge detection
AND N Start 'Sl to I0.6 Start button
THEN SET Edge_n 'Flag for negative edge detection
IF Start 'Sl to I0.6 Start button
THEN RESET Edge_n 'Flag for negative detection
7. The drllllng machlne grows ln statement llst
7-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
lf we want to have the lnchlng mode for the drllllng machlne
programmed ln such a way that the Start button has to be
actuated for each step, then we can expand our organlsatlon
program:
""Organisation program for the drilling machine
"" Switch on automatic mode
IF Start 'Sl: Start button
"" Home position
AND Released 'Bl: Clamp cylinder is released
AND Drill_up 'B4: Drill cyllinder is up
AND E¸_back 'B6: E¸ector cylinder is back
"" Halt buttons
AND Halt 'S2: Halt button {breaker¡
AND Stop 'S4: Stop button {breaker¡
AND Em_Stop 'Sl0: Emergency stop switch {breaker¡
"" Programs
AND N P2 'Back to home position
AND N P4 'Manual mode
THEN SET Pl 'Automatic program
"" Stop automatic
IF N Stop 'S4: Stop button {breaker¡
THEN RESET Pl 'Automatic program
"" Halt after end of cycle
IF N Halt 'S2: Halt button {breaker¡
THEN SET F_HALT 'Flag HALT actuated
"" Reset flag for inching mode
IF NOP
THEN SET F_forward 'Flag advance condition inching
"" Edge detection and set flag for inching mode
IF N Edge_flag 'Flag edge detection Start button
AND Start 'S1: Start button
AND P1 'Automatic program
AND { Continuous 'S3: Contin. mode switch {0=inching mode}
oR N Continuous } 'S3: Contin. mode switch {0=inching mode}
THEN SET Edge_flag 'Flag edge detection push button start
SET F_Forward 'Flag go to next step condition inching
IF N Start 'S1: Start button
THEN RESET Edge_flag 'Flag edge detection push button start
7. The drllllng machlne grows ln statement llst
7-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
7.4 1he heme pesitien pregram
The home posltlon program
22
ls qulckly programmed for such
a small and slmple system. The home posltlon programcan
be very complex for larger systems, as lt should brlng the
machlne to home posltlon from any other posltlon.
ln our case, you can slmply programas follows:
C- 8- A-
P2 wlll look somewhat llke thls as a result:
"" Run e¸ector to home position
STEP
IF NOP
THEN RESET E¸ector 'O0.3: Y3: E¸ector
"" Run drill to home position
STEP
IF E¸_back 'I0.5: B6: E¸ector cylinder is back
THEN RESET Driller 'O0.2: Y3: Drill cylinder
"" Run clamp cylinder to home position
STEP
IF Drill_up 'I0.3: B4: Drill cyllinder is up
THEN RESET Aplus 'O0.0: Yl: Clamp the workpiece
SET Aminus 'O0.l: Y2: Release the workpiece
"" End home position program
STEP
IF Released 'I0.0: Bl: Clamp cylinder is released
THEN RESET P2 'Back to home position
Please observe that the home posltlon programautomatlcally
swltches off ln thls example. 0nce the home posltlon has
been achleved, program P2 ls swltched off.
22)
¥ou wlll flnd the pro|ect lncludlng the home posltlon programas
0rlll_05.ZlP on your C0.
7. The drllllng machlne grows ln statement llst
7-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
0ependlng on the operatlng phllosophy, lt must be clarlfled
under whlch condltlons the home posltlon programls called
up ln the flrst place. ¥ou certalnly would not want to allow the
home posltlon button to react ln the mlddle of an automatlc
sequence. lt mlght sufflce for the purpose of thls example to
ask whether the automatlc programhas been stopped (not
halted). The organlsatlon programls expanded for thls:
"" Back to home position
IF N Pl 'Automatic program
AND Em_Stop 'I0.l5: Sl0: Emergency stop switch {breaker¡
AND Home_pos 'I0.ll: S6: Back to home position button
THEN SET P2 'Back to home position
Flnally, we lnstalled a llght whlch should lndlcate lf the home
posltlon programls actlve. Thls ls very easy to programln the
organlsatlon program.
IF P2 'Back to home position
THEN SET L_Home 'O0.5: H2 Back to home position light
OTHRW RESET L_Home 'O0.5: H2 Back to home position light
IF Pl 'Automatic program
THEN SET L_Auto 'O0.7: H4: Automatic continuous mode light
OTHRW RESET L_Auto 'O0.7: H4: Automatic continuous mode light
1he dri||ing machine grews in |adder diagram
8-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 8
8. The drllllng machlne grows ln ladder dlagram
8-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
8. 1he dri||ing machine grews in |adder diagram 8-1 . . . . . . . . . . . . . . . . . . . . . .
8.1 Startlng and stopplng the automatlc program 8-3 . . . . . . . . . . . . . . . . . . . . . . . .
8.2 lnchlng mode 8-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3 Fdge detectlon 8-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3.1 Programmlng for edge detectlon 8-9 . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.ú The home posltlon program 8-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8. The drllllng machlne grows ln ladder dlagram
8-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The long preface merely served the purpose of brlnglng the
drllllng machlne program somewhat closer to the reallty of
modern machlne controllers. After all, the organlsatlon of
operatlng modes such as automatlc, manual, etc. must be
programmed flrst.
8.1 5tarting and stepping the autematic pregram
The automatlc program ls started uslng 'Start' and can then
work cycllcally (a query comes later on whether materlal ls
stlll avallable ln the drop magazlne).
however, lt may only be started lf the machlne ls ln home
posltlon, nelther stop, halt nor emergency stop ls actuated
and the back to home posltlon programand the manual
gram are not actlve.
we can therefore program as follows:
As the automatlc mode should now run ln contlnuous mode,
the start button must be deleted ln the flrst step ln the
matlc program.
Although the automatlc program runs endlessly, lt cannot be
halted any more. Two buttons are provlded for thls ln the
operatlon:
stops lmmedlately,
stops after the end of the cycle.
8. The drllllng machlne grows ln ladder dlagram
8-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
ST0P ls very easy to program, lt merely resets the automatlc
program.
hALT ls a blt more compllcated, as the hALT button can be
actuated anytlme durlng the programcycle but only becomes
effectlve at the end of the cycle. Therefore, we wlll need a flag
to note that hALT has been actuated. Thls flag must then
tervene at the end of the cycle.
The organlsatlon could be expanded ln thls way:
8. The drllllng machlne grows ln ladder dlagram
8-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
we can expand the last step ln automatlc mode:
lf a mlnlmal programls added to the programs P2 and Pú
now belng used, we can thus complle and use the modlfled
pro|ect
23)
.
23)
¥ou wlll flnd thls status as 0rlll_L3.ZlP on your C0.
8. The drllllng machlne grows ln ladder dlagram
8-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
8.2 tnching mede
lnchlng mode means that the automatlc sequence ls
cessed ln steps, the advancement from one step to the next
dependlng on addltlonal lnput from operatlng personnel. An
lnchlng push button ls requlred whlch ln our example ls
lmplemented wlth the start push button lnto practlce.
¥ou could formulate thls ln general as follows:
how thls condltlon could be worked lnto every step, of
course. however, that would be qulte tlme-consumlng and
would reduce clarlty. The comblned Ah0]0k llnk, whlch
fluences golng to the next step lndependently from the
cess condltlon, can be programmed ln the organlsatlon
gram and used as a flag ln automatlc mode.
8. The drllllng machlne grows ln ladder dlagram
8-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
we can programthe followlng ln the organlsatlon program:
to be able to lnsert thls flag lnto the automatlc programln
each step whlch must walt ln lnchlng mode:
As an example
2ú)
a step would look llke thls:
2ú)
¥ou wlll flnd the entlre pro|ect wlth thls supplement as 0rlll_Lú.ZlP
on your C0.
8. The drllllng machlne grows ln ladder dlagram
8-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
8.3 £dge detectien
The lnchlng mode, programmed ln thls way, now has a
acterlstlc vlewed as belng elther 'correct' or 'wrong',
lng on the appllcatlon.
lf the machlne ls ln lnchlng mode, lt ls sufflclent to rest on the
Start push button (keep lt held down) to ensure that the
quence ls contlnuously processed. lt ls demanded ln some
appllcatlons that the machlne can work exactly one step
ward when a push button ls actuated.
what we really want ln thls case ls for the machlne to go to
the next step when your flnger starts to actuate the Start
push button. The termfor thls ln automatlon technology ls
edge detectlon.
Colng from step to step should take place by means of the
rlslng edge but not the 1 slgnal.
8. The drllllng machlne grows ln ladder dlagram
8-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
8.3.1 Programmlng for edge detectlon
Fdge detectlon ls programmed very slmply uslng a flag.
ln thls programthe posltlve edge ls detected and swltches
the output 00.0 to 1 for exactly one cycle. ¥ou get a negatlve
edge when you reverse the loglc.
8. The drllllng machlne grows ln ladder dlagram
8-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
lf we want to have the lnchlng mode for the drllllng machlne
programmed
25)
ln such a way that the Start button has to be
actuated for each step, then we can expand our organlsatlon
program:
25)
¥ou wlll flnd the pro|ect as 0rlll_L5.ZlP on your C0.
8. The drllllng machlne grows ln ladder dlagram
8-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
8.4 1he heme pesitien pregram
The home posltlon program
26)
ls qulckly programmed for
such a small and slmple system. The home posltlon program
can be very complex for larger systems, as lt should brlng the
machlne to home posltlon from any other posltlon.
ln our case, you can slmply programas follows:
C- 8- A-
P2 wlll look somewhat llke thls as a result:
26)
¥ou wlll flnd the pro|ect lncludlng the home posltlon programas
0rlll_L6.ZlP on your C0.
8. The drllllng machlne grows ln ladder dlagram
8-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Please observe that the home posltlon programautomatlcally
swltches off ln thls example. 0nce the home posltlon has
been achleved, program P2 ls swltched off.
8. The drllllng machlne grows ln ladder dlagram
8-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
0ependlng on the operatlng phllosophy, lt must be clarlfled
under whlch condltlons the home posltlon programls called
up ln the flrst place. ¥ou certalnly would not want to allow the
home posltlon button to react ln the mlddle of an automatlc
sequence. lt mlght sufflce for the purpose of thls example to
ask whether the automatlc programhas been stopped (not
halted). The organlsatlon programls expanded for thls:
Flnally, we lnstalled a llght whlch should lndlcate lf the home
posltlon programls actlve. Thls ls programmable as an
example ln the orgranlsatlon program.
8. The drllllng machlne grows ln ladder dlagram
8-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
1imes and ceunters with f51 in statement |ist
9-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 9
9. Tlmes and counters wlth FST ln statement llst
9-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
9. 1imes and ceunters with f51 in statement |ist 9-1 . . . . . . . . . . . . . . . . . . . . . .
9.1 The tlme module 9-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.1 Let's begln wlth a slmple example 9-ú . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.2 The tlmer wlthout steps 9-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.3 The tlmer 0h delay 9-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.ú The swltch 0FF delay 9-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1.5 The flasher 9-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2 The counter module 9-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2.1 Count up lncrement 9-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2.2 Count backwards decrement 9-15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2.3 The counter wlthout the counter (module) 9-18 . . . . . . . . . . . . . . . . . . .
9.2.ú Comblnlng tlmes and counters 9-20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.3 Llmltatlons of uslng tlmes and counters 9-23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.ú Practlcal appllcatlon of tlmes and counters 9-2ú . . . . . . . . . . . . . . . . . . . . . . . . . .
9.ú.1 The garage door wlth tlmes]counters 9-2ú . . . . . . . . . . . . . . . . . . . . . . .
9. Tlmes and counters wlth FST ln statement llst
9-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
There wlll very unllkely be any automatlon pro|ects ln whlch
tlmes are not used and only a few ln whlch counters are not
used. For that reason we should deal wlth tlmes and counters
ln detall.
Tlmes and counters belong together, as a tlme module ls a
counter that counts clock pulses. however, the tlme module
ls somewhat easler to manage than a counter because some
counter functlons are hldden. Let's start wlth the tlmes.
9.1 1he time medu|e
27)
A tlme module can be represented as seen below:
A tlme module must have at least three connectlons:
lnput for the start
lnput to set the tlme
output that reports whether or not the module ls
actlve.
ln addltlon, lt ls posslble to dlsplay the elapsed tlme.
27)
¥ou wlll flnd all the tlme examples on the C0 under Tlme_en.ZlP
9. Tlmes and counters wlth FST ln statement llst
9-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
These lnputs and outputs recelve a name ln FST:
tlme module (tlmer) ltself ls called T. As there are
you thus have the tlmers T0 ... T255
tlme ls started by settlng thls module: SFT T0
set tlme, the nomlnal value, ls ln the tlmer preselect,
tlme module ltself becomes '1' after belng called up
and '0' after the tlme has elapsed
current tlme value, the actual value, ls ln the tlmer
words, Tw0 ... Tw255
9.1.1 Let's begln wlth a slmple example
when the lnput l0.6 on our control ls actuated, the output
00.6 should be actlve for a perlod of 5 seconds:
9. Tlmes and counters wlth FST ln statement llst
9-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The programcan read as follows:
STEP Start
IF I0.6 'Input to start the timer
THEN SET T0 'Pulse timer
WITH 5s
STEP Time_eval
IF T0 'Pulse timer
THEN SET O0.6 'Input showing pulse
OTHRW RESET O0.6 'Output showing pulse
IF N T0 'Pulse timer
AND N I0.6 'Input to start the timer
THEN JMP TO Start
IF NOP
THEN JMP TO Time_eval
Let's take a closer look at the program:
THEN SET T0
swltches on the tlme module. The tlme runs, the tlmer status
T0 ls actlve ('1').
WITH 5s
deflnes the tlme. here permlsslble values are 0.01 ...
Please observe the declmal polnt (not a declmal comma).
9. Tlmes and counters wlth FST ln statement llst
9-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln the onllne dlsplay we see the status, the current value
(actual value) and the preselect value (nomlnal value).
The query
IF T0 'Pulse timer
querles the 8oolean status of the tlme module (tlmer). lf the
tlmer ls '1', then the tlmer ls stlll actlve and the tlme ls not yet
elapsed. lf the status ls '0', then the tlme ls elapsed and the
tlmer has done lts work and ls ended (lnactlve).
9. Tlmes and counters wlth FST ln statement llst
9-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.1.2 The tlmer wlthout steps
SFT T0 restarts the tlmer. ln the sequencer used above as an
example, the step-by-step sequence ensures that the tlmer ls
not restarted untll the tlme ls ended or the lnput l0.6 has
come '0' after the tlme has elapsed.
lf you are not uslng a sequencer, the tlmer ls locked:
IF I0.6 'Input to start the timer
AND N Tl 'Pulse timer
THEN SET Tl 'Pulse timer
WITH 5s
IF Tl 'Pulse timer
THEN SET O0.7 'Display pulse timer without steps
OTHRW RESET O0.7 'Display pulse timer without steps
The usual tlme modules should then be programmed.
9. Tlmes and counters wlth FST ln statement llst
9-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.1.3 The tlmer 0h delay
The tlmer 0h delay ls characterlsed by the output becomlng 1
when the tlme ls over Ah0 the lnput ls stlll 1. here ls a
sentatlon of thls:
The tlmer 0h or swltch 0h delay can be programmed wlth or
wlthout steps.
Flrst an example wlth steps:
9. Tlmes and counters wlth FST ln statement llst
9-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
STEP Start
"" The time starts with input I0.5
IF I0.5 'Input for timer ON delay
THEN SET T2 'Timer ON delay with steps
WITH 5s
STEP Wait
"" If the input becomes 0, the time is canceled
IF N I0.5 'Input for timer ON delay
THEN RESET T2 'Timer ON delay with steps
JMP TO Start
"" If the time has elapsed and the input is still active, the
"" Output is switched on
IF N T2 'Timer ON delay with steps
AND I0.5 'Input for timer ON delay
THEN SET O0.5 'Output timer ON delay steps
STEP End
"" If the input becomes 0, the output is switched off
IF N I0.5 'Input for timer ON delay
THEN RESET O0.5 'Output timer ON delay steps
JMP TO Start
Fxample wlth steps
"" Start the time if it is not already or was started
IF N T3 'Timer ON delay without steps
AND I0.5 'Input for timer ON delay
AND N F0.0 'Edge flag for timer ON delay
THEN SET T3 'Timer ON delay without steps
WITH 5s
SET F0.0 'Edge flag for timer ON delay
"" Time module and output and edge flag are switched off,
"" as soon as the input becomes 0
IF N I0.5 'Input for timer ON delay
THEN RESET T3 'Timer ON delay without steps
RESET O0.4 'Display timer ON delay without steps
RESET F0.0 'Edge flag for timer ON delay
"" The output is switched on as soon as the time module is ended
"" and the input is still active
IF N T3 'Timer ON delay without steps
AND F0.0 'Edge flag for timer ON delay
AND I0.5 'Input for timer ON delay
THEN SET O0.4 'Display timer ON delay without steps
Fxample wlthout steps
9. Tlmes and counters wlth FST ln statement llst
9-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.1.ú The swltch 0FF delay
The swltch 0FF or tlmer 0FF delay lmmedlately turns on an
output wlth the lnput and allows lt to be turned on for the
preselected tlme after the lnput has become '0'.
9. Tlmes and counters wlth FST ln statement llst
9-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The tlmer 0FF delay wlth steps can be programmed as
follows:
STEP Start
IF I0.4 'Start timer OFF delay
THEN SET O0.3 'Timer OFF delay with steps
IF N I0.4 'Start timer OFF delay
AND O0.3 'Timer OFF delay with steps
THEN SET T4 'Timer OFF delay with steps
WITH 5s
STEP Wait
IF N T4 'Timer OFF delay with steps
THEN RESET O0.3 'Timer OFF delay with steps
JMP TO Start
lf you are not uslng steps, you can proceed as follows:
"" Switch on output, reset edge flag
IF I0.4 'Start timer OFF delay
THEN SET O0.2 'Timer OFF delay without steps
RESET F0.l 'Edge flag timer OFF delay
"" Start time, set edge flag
IF N I0.4 'Start timer OFF delay
AND O0.2 'Timer OFF delay without steps
AND N F0.l 'Edge flag timer OFF delay
THEN SET T5 'Timer OFF delay without steps
WITH 5s
SET F0.l 'Edge flag timer OFF delay
"" Time has ended
IF N T5 'Timer OFF delay without steps
AND F0.l 'Edge flag timer OFF delay
THEN RESET O0.2 'Timer OFF delay without steps
9. Tlmes and counters wlth FST ln statement llst
9-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.1.5 The flasher
Let's assume that we want have an output flash wlth a
quency of 2 seconds (0.5 hz). Then thls output should be '1'
for one second and '0' for one second, respectlvely. 0f
course, thls task can also be programmed wlth and wlthout
steps. Flrst the verslon wlth steps.
STEP Start
"" Start time of l sec. and switch on output
IF NOP
THEN SET T6 'Flash time with steps
WITH ls
SET O0.l 'Flash with steps
STEP Wait
"" If l sec. has ended, switch off output and start Off time
IF N T6 'Flash time with steps
THEN RESET O0.l 'Flash with steps
SET T6 'Flash time with steps
STEP End
"" After the OFF time has elapsed, ¸ump back
IF N T6 'Flash time with steps
THEN JMP TO Start
The verslon wlthout steps can be expressed conclsely as
follows:
"" The timer automatically starts every second
"" The output changes its status every second
IF N T7 'Flash time without steps
THEN SET T7 'Flash time without steps
WITH ls
LOAD N O0.0 'Output flashes without steps
TO O0.0 'Output flashes without steps
9. Tlmes and counters wlth FST ln statement llst
9-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.2 1he ceunter medu|e
28)
The counter can be vlewed ln the same way that the tlme
module can be represented.
For a comparlson wlth the tlme module, however, we requlre
addltlonal connectlons.
A few practlcal examples should showthe posslbllltles ln
handllng counters.
9.2.1 Count up lncrement
Let's assume the followlng task: The slgnal at an lnput should
be counted. An output should be turned on after 5 slgnals. A
reset lnput restores the counter and turns off the output at
any tlme.
28)
¥ou wlll flnd all the counter module examples on the C0under the
tltle Counter.ZlP
9. Tlmes and counters wlth FST ln statement llst
9-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
¥ou could programllke thls ln step program:
"" Load the set value
STEP Start
IF NOP
THEN LOAD V5
TO CP0 'Set value counter 0
SET C0 'Increment
"" Count and monitor the reset input
STEP Count
IF I0.l 'Reset counter
THEN JMP TO Start
IF I0.0 'Input signal being counted
THEN INC C0 'Increment
"" Evaluate counter
STEP Forward
IF I0.l 'Reset counter
THEN RESET C0 'Increment
JMP TO Start
IF N I0.0 'Input signal being counted
AND C0 'Increment
THEN JMP TO Count
IF N I0.0 'Input signal being counted
AND N C0 'Increment
THEN SET O0.0 'Shows end of counting
"" Reset
STEP Reset
IF I0.l 'Reset counter
THEN RESET O0.0 'Shows end of counting
JMP TO Start
IF NOP
THEN JMP TO Reset
9. Tlmes and counters wlth FST ln statement llst
9-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
A pure parallel loglc program wlthout steps requlres an edge
flag for the countlng lnput ltself as well as a beglnnlng. The
flag Fl, avallable ln every program, ls used here. The
tlon flag ls actlve for exactly one cycle after the programhas
been swltched on.
"" Switching on the program
"" or the input I0.l sets the set value to 5
IF FI 'Initialisation flag
OR I0.l 'Reset counter
THEN LOAD V5
TO CPl 'Nominal value counter l
SET Cl 'Counter l
RESET O0.l 'Counter result
"" Count
IF I0.0 'Input signal being counted
AND N F0.0 'Edge detection counter
THEN SET F0.0 'Edge detection counter
INC Cl 'Counter l
"" Reset edge flag
IF N I0.0 'Input signal being counted
THEN RESET F0.0 'Edge detection counter
"" Evaluate counter
IF N Cl 'Counter l
THEN SET O0.l 'Counter result
9.2.2 Count backwards decrement
0ecrementlng dlffers only marglnally from lncrementlng. The
backwards counter shows how many parts are stlll 'mlsslng',
the forwards counter shows how many parts have already
been counted.
9. Tlmes and counters wlth FST ln statement llst
9-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
After the command 'SFT CX', the counter's actual value ls
loaded lnto the start value. The nomlnal value ls not vlewed
any closer, as the target ls now 0. The countlng procedure
ltself uses the decrement command, 0FC.
here we have the result wlth steps.
"" Load the set value
STEP Start
IF NOP
THEN SET C2 'Decrement with steps
LOAD V5
TO CW2 'Actual value of counter2
"" Count and monitor the reset input
STEP Count
IF I0.3 'Reset decrement
THEN JMP TO Start
IF I0.2 'Counter input decrement
THEN DEC C2 'Decrement with steps
"" Evaluate counter
STEP Forward
IF I0.3 'Reset decrement
THEN RESET C2 'Decrement with steps
JMP TO Start
IF N I0.2 'Counter input decrement
AND C2 'Decrement with steps
THEN JMP TO Count
IF N I0.2 'Counter input decrement
AND N C2 'Decrement with steps
THEN RESET O0.2 'Counter result decrement steps
"" Reset
STEP Reset
IF I0.3 'Reset decrement
THEN RESET O0.2 'Counter result decrement steps
JMP TO Start
9. Tlmes and counters wlth FST ln statement llst
9-17 Festo P.8F-FSTú-L8-Fh en 0ú02hh
And here ls how you could program wlthout steps:
"" Switching on the program
"" or the input I0.l sets the nominal value to 5
IF FI 'Initialisation flag
OR I0.3 'Reset decrement
THEN SET C2 'Decrement with steps
LOAD V5
TO CW3 'Actual value counter 3
RESET O0.3 'Counter result decrement
"" Count
IF I0.2 'Counter input decrement
AND N F0.l 'Edge detection decrement
THEN SET F0.l 'Edge detection decrement
DEC C3 'Decrement without steps
"" Reset edge flag
IF N I0.2 'Counter input decrement
THEN RESET F0.l 'Edge detection decrement
"" Evaluate counter
IF N C3 'Decrement without steps
THEN SET O0.3 'Counter result decrement
9. Tlmes and counters wlth FST ln statement llst
9-18 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.2.3 The counter wlthout the counter (module)
29)
we admlt that thls may sound strange. 8ut lt ls really qulte
slmple.
The count commands 0FC 0ecrement and lhC lncrement
can be essentlally applled to nearly any word. ¥ou can select
an output word or a flag word.
0nly the comfort of the counter status ls no longer avallable.
however, the counter status sometlmes tends to be
some, for example, when multlple counter values should be
evaluated or when lt ls |ust a matter of an addlng a plece
counter whlch should constantly provlde lnformatlon on the
parts produced so far.
Let's assume the followlng task:
A plece counter should show ln a trafflc llght how far the
productlon ls.
The count slgnal comes at the lnput.
The reset lnput resets the counter to 0.
kF0 ls shown at the output lf the quantlty ls under 10.
¥ellow ls shown at the output lf the quantlty ls between
20.
Creen ls shown at the output lf more than 20 parts have
already been produced.
Another note:
A plece counter should usually retaln lts value even ln the
event of power loss. we consequently use a varlable whlch ls
remanent. For the FFC used ln the example, thls would be a
flag from the word range Fw0 to Fw255.
29)
¥ou wlll flnd the pro|ect descrlbed here as Counter_AL.ZlP on
9. Tlmes and counters wlth FST ln statement llst
9-19 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The programcould look llke thls:
"" Reset the piece counter
IF I0.l 'Input reset piece counter
THEN LOAD V0
TO FW0 'Piece counter
"" Count
IF I0.0 'Piece counter signal
AND N Fl.0 'Edge detection input signal
THEN INC FW0 'Peice counter
SET Fl.0 'Edge detection input signal
IF N I0.0 'Signal piece counter
THEN RESET Fl.0 'Edge detection input signal
"" Evaluation quantity in red range
IF FW0 'Piece counter
< Vl0
THEN SET O0.0 'RED
RESET O0.l 'YELLOW
RESET O0.2 'GREEN
"" Evaluation quantity in yellow range
IF { FW0 'Piece counter
< V20 ¡
AND { FW0 'Piece counter
>= Vl0 ¡
THEN RESET O0.0 'RED
SET O0.l 'YELLOW
RESET O0.2 'GREEN
"" Evaluation quantity in red range
IF FW0 'Piece counter
>= V20
THEN RESET O0.0 'RED
RESET O0.l 'YELLOW
SET O0.2 'GREEN
9. Tlmes and counters wlth FST ln statement llst
9-20 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.2.ú Comblnlng tlmes and counters
30)
Fxamples ln whlch tlmes and counters are comblned are also
lnterestlng. An example of such a comblnatlon ls the request
to measure the speed of a controller belng used, thus a
formance measurement.
ln a performance measurement we want to check how long an
lndlvldual cycle lasts. ln automatlon technology there are
three values of partlcular lnterest for thls:
cycle tlme of the controller's central unlt, whlch ls
completely lndependent of any sensors or actuators and
merely measures the cycle through the programs and
modules,
cycle tlme wlth connected lnputs]outputs, thus the
reactlon tlme of the system whlch passes untll an lnput
slgnal swltches to an output slgnal, and flnally
cycle tlme of the machlne.
ln prlnclple all three measurements are performed wlth nearly
ldentlcal programs: The counter counts a slgnal changlng
once per cycle as 1 upwards, respectlvely.
Fvery second (or mlnute or hour ...) the counter status ls read
and saved, and the counter starts over agaln from the
nlng. how we can calculate an lndlvldual cycle from the
counter status and the tlme.
30)
¥ou wlll flnd the programexample under Cycle.ZlP on the C0.
9. Tlmes and counters wlth FST ln statement llst
9-21 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Cycle tlme measurement
To get started the lnternal cycle tlme of the CPu should be
measured. For thls a flag word ls used, whlch ls counted up
once ln each CPu cycle. Fvery second the flnal status ls
recorded, saved and converted
31)
.
"" The flag word 0 is increased by l in each CPU cycle
IF NOP
THEN INC FW0 'Is increased by l in each CPU cycle
"" A timer is started once every second
IF N T0 'Measure every second
THEN SET T0 'Measure every second
WITH ls
""The counter value is saved every second at the same time
LOAD FW0 'Is increased by l in each CPU cycle
TO R0 'Clipboard cycle counter
""And the cycle counter restarted
LOAD V0
TO FW0 'Is increased by l in each CPU cycle
""Evaluation of the counter status
IF R0 'Clipboard cycle counter
<> V0
THEN LOAD Vl000
/ R0 'Clipboard cycle counter
TO Rl 'Duration of a cycle in ms
31)
For your tests please note: Most of the controls have a mlnlmum
cycle tlme. They wlll not get any shorter, regardless how small
your pro|ect ls. To calculate howmuch tlme the controller requlres
for each lnstructlon, two measurements must be performed. 0ne
wlth X llnes of lnstructlon and others wlth X÷¥ llnes of lnstructlon.
The tlme per lnstructlon can be calculated fromthe dlfferent
tlmes.
9. Tlmes and counters wlth FST ln statement llst
9-22 Festo P.8F-FSTú-L8-Fh en 0ú02hh
keactlon tlme measurement
For the reactlon tlme measurement, that ls, the measurement
of the tlme between when a slgnal ls created at an lnput untll
an output ls swltched over, we wlll need a llttle hardware: An
lnput and an output are wlred to the controller. Fvery tlme the
lnput ls swltched over ln the program, a modlfled output
nal results.
"" Switch output
IF N Il.0 'Input for reaction time measurement
THEN SET O0.7 'Output for reaction time measurement
oTHRW RESET O0.7 'Output for reaction time measurement
"" Count
IF Il.0 'Input for reaction time measurement
AND N F2.0 'Edge flag for reaction time measurement
THEN INC FW3 'Reaction time counter
SET F2.0 'Edge flag for reaction time measurement
IF N Il.0 'Input for reaction time measurement
THEN RESET F2.0 'Edge flag for reaction time measurement
"" Evaluate
IF N Tl 'Time for reaction time measurement
THEN SET Tl 'Time for reaction time measurement
WITH ls
LOAD FW3 'Reaction time counter
TO R2 'Clipboard cycle counter
LOAD V0
TO FW3 'Reaction time counter
"" Convert
IF R2 'Clipboard for reaction time
<> Vl000
/ R2 'Clipboard for reaction time
TO R3 'Reaction time in ms
9. Tlmes and counters wlth FST ln statement llst
9-23 Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.3 Limitatiens eI using times and ceunters
Tlmes and counters are dlgltal elements and use words that
are modlfled. here FST software also uses words ln the sense
of PLC, that ls, unlts 16 blts wlde. A 16-blt value can
expressed as a declmal take on values between 0 and
2 = 65535.
a matter of prlnclple a counter can also count to thls
value and subsequently beglns agaln from 0. An overrun
must be recognlsed ln the program ltself, as an overrun
blt ls not present.
tlme can therefore lnclude up to 65535 clock pulses. As
each FST tlmer works wlth a clock pulse of 10 ms =
the longest tlme wlth a tlme module can consequently be
65535 * 0 s = 655.35 s = 10 mln 55.35 s.
tlme module counts the lnternal tlme counter ln reverse
every 10 ms ln lncrements of 1. Thls clock pulse ls
pletely lndependent of all appllcatlons and processes.
Should a fault arlse ln the appllcatlon whlch should be
delayed, an lndetermlnate perlod of tlme between 10 and
0 ms wlll elapse from thls fault up to the flrst countlng
pulse. The result of thls ls that every FST tlme has an error
of up to ms. That ls why a tlme should never be
grammed ln the programwhlch ls smaller than 2 x
(and thls tlme wlll then have an maxlmum error of
that ls, maxlmum %).
9. Tlmes and counters wlth FST ln statement llst
9-2ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
9.4 Practica| app|icatien eI times and ceunters
9.ú.1 The garage door wlth tlmes]counters
32)
The garage door was programmed ln Chapter 3. The Carage
pro|ect used there should be expanded by two functlons:
movements of the garage door are counted. After
2000 cycles a dlsplay, produced wlth the ald of an output,
lnforms you that the mechanlcal parts must be servlced.
An addltlonal acknowledgement lnput resets the counter.
llmlt swltch slgnal '0oor ls closed' should be delayed
by one second to compensate for lnaccuracles whlch
occur when the llmlt swltch ls lnstalled.
The programto count the operatlng cycles ls best stored ln
an lndependent program. Thls can look the followlng way:
"" The cycle counter is reset with the acknowledgement input
IF I0.7 'Acknowledge cycle counter
THEN LOAD V2000
TO CP0 'Set value cycle counter
SET C0 'Cycle counter
"" The limit switch signal >Door is open<
"" sends the signal to count the door cycles
IF I0.0 'Limit switch garage door is open
AND N F0.0 'Edge detection cycle counter
THEN INC C0 'Cycle counter
SET F0.0 'Edge flag cycle counter
IF N I0.0 'Limit switch garage door is open
THEN RESET F0.0 'Edge detection cycle counter
"" After 2000 cycles, a note is displayed to have the machine serviced
IF N C0 'Cycle counter
THEN SET O0.7 'Servicing is necessary
OTHRW RESET O0.7 'Servicing is necessary
32)
¥ou wlll flnd thls example as Car_en_T.ZlP on your C0.
9. Tlmes and counters wlth FST ln statement llst
9-25 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The delay of the llmlt swltch ls a dlrect part of the door
troller's program. The followlng ls therefore supplemented:
""Pro¸ect: Garage
""Author: Bernhard Plagemann"" Open garage door
IF Open_in 'Push button inside Open
OR { Open_out 'Push button outside Open
AND Key ¡ 'Key switch outside
AND N Relay_clo 'Close garage door
AND N Close_In 'Push button inside Close
AND N Close_out 'Push button outside Close
THEN SET Relay_op 'Open garage door
""Stop garage door 'Limit switch garage door is open
OR Close_In 'Push button inside Close
OR Close_out 'Push button outside Close
THEN RESET Relay_op 'Open garage door
""Close garage door
IF { Close_In 'Push button inside Close
OR Close_out ¡ 'Push button outside Close
AND N F0.2 'Door is closed
AND N Relay_op 'Open garage door
AND N Open_In 'Push button inside Open
AND N Close_out 'Push button outside Close
THEN SET Relay_clo 'Close garage door
OTHRW RESET Relay_clo 'Close garage door
"" Signal >Door closed< delay
IF closed 'Limit switch garage is closed
AND N F0.l 'Edge detection timer ON delay
AND N T0 'Delay door is closed
THEN SET T0 'Delay door is closed
WITH ls
SET F0.l 'Edge detection timer OFF delay
IF N closed 'Limit switch garage is closed
THEN RESET F0.l 'Edge detection timer ON delay
RESET T0 'Delay door is closed
IF N T0 'Delay door is closed
AND closed 'Limit switch garage is closed
THEN SET F0.2 'Door is closed
OTHRW RESET F0.2 'Door is closed
9. Tlmes and counters wlth FST ln statement llst
9-26 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1imes and ceunters with f51 in |adder diagram
10-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 10
10. Tlmes and counters wlth FST ln ladder dlagram
10-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
10. 1imes and ceunters with f51 in the |adder diagram 10-1 . . . . . . . . . . . . . . . . . .
10.1 The tlme module 10-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.1 Let's begln wlth a slmple example 10-ú . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.2 The tlme-on delay 10-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.3 The swltch 0FF delay 10-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1.ú The tlme module ln detall 10-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2 The counter module 10-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2.1 Count up lncrement 10-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2.2 The unlversal counter 10-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2.3 Comblnlng tlmes and counters 10-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.3 Llmltatlons of uslng tlmes and counters 10-16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10. Tlmes and counters wlth FST ln ladder dlagram
10-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
There wlll very unllkely be any automatlon pro|ects ln whlch
tlmes are not used and only a few ln whlch counters are not
used. For that reason we should deal wlth tlmes and counters
ln detall.
Tlmes and counters belong together, as a tlme module ls a
counter that counts clock pulses. however, the tlme module
ls somewhat easler to manage than a counter because some
counter functlons are hldden. Let's start wlth the tlmes.
10.1 1he time modu|e
33)
A tlme module can be represented as seen below:
of a tlme module
A tlme module must have at least three connectlons:
lnput for the start
lnput to set the tlme
output that reports whether or not the module ls
actlve.
ln addltlon, lt ls posslble to dlsplay the elapsed tlme.
33)
¥ou wlll flnd all the tlme examples on the C0 entltled Tlme_L0.ZlP
10. Tlmes and counters wlth FST ln ladder dlagram
10-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
These lnputs and outputs recelve a name ln FST:
tlme module (tlmer) ltself ls called T. As there are
you thus have the tlmers T0 ... T255
tlme ls started by calllng up thls module ln a coll.
set tlme, the nomlnal value, ls ln the tlmer preselect,
TP255.
tlme module ltself becomes '1' after belng called up
and '0' after the tlme has explred
current tlme value, the actual value, ls ln the tlmer
words, Tw0 ... Tw255.
10.1.1 Let's begln wlth a slmple example
when the lnput l0.6 on our control ls actuated, the output
00.6 should be actlve for a perlod of 5 seconds:
10. Tlmes and counters wlth FST ln ladder dlagram
10-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The programcan read as follows:
Let's take a closer look at the program:
tlme ls started ln the flrst network. Asslgnlng the
name 'T0' causes the tlmer to be used as a pulse tlmer ln
the ladder dlagram.
tlme ls glven ln seconds at the tlme lnput. here
mlsslble values are 0.01 s ... 655.35 s.
ln the onllne dlsplay we see the status, the current value
(actual value) and the preselect value (set value):
10. Tlmes and counters wlth FST ln ladder dlagram
10-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
10.1.2 The tlme-on delay
The tlmer 0h or swltch 0h delay ls characterlsed by the
put becomlng 1 when the tlme ls over Ah0 the lnput ls stlll 1.
here ls a representatlon of thls:
10. Tlmes and counters wlth FST ln ladder dlagram
10-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The tlmer ls called 'T0h' ln the ladder dlagram.
10.1.3 The swltch 0FF delay
The swltch 0FF or tlmer 0FF delay lmmedlately turns on an
output wlth the lnput and allows lt to be turned on for the
preselected tlme after the lnput has become '0'.
10. Tlmes and counters wlth FST ln ladder dlagram
10-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The tlmer ls called T0FF ln the ladder dlagram and thus has
the characterlstlcs of the swltch 0FF delay.
10. Tlmes and counters wlth FST ln ladder dlagram
10-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
10.1.ú The tlme module ln detall
The ready-made tlme modules do not always sufflce. That ls
why the ladder dlagram also allows each lndlvldual
nent of a tlme module to be addressed lndlvldually.
ln thls way values can be loaded lnto the tlmer preselect |ust
as they are lnto the tlmer word. Thls enables a partlcular tlme
to be modlfled over the course of a process, for example.
The three components of the tlme module are:
status T
preselectlon TP
word Tw
The tlmer status ls a blt operand, lt can be used ln a coll.
Tlmer preselect and tlmer word are 16-blt operands, values
can also be loaded ('to'), read out, compared, counted up
(lncrement) or counted down (decrement).
The tlmers always work wlth a tlme constant of 10 ms
lf we enter the value 50 ln a tlmer preselectlon, a tlme of 50 x
10 ms = 500 ms = 0.5 s results.
The followlng example lllustrates dlrect access to the tlmer
components.
10. Tlmes and counters wlth FST ln ladder dlagram
10-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
10. Tlmes and counters wlth FST ln ladder dlagram
10-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
10.2 1he counter modu|e
3ú)
The counter can be vlewed ln the same way that the tlme
module can be represented. For a comparlson wlth the tlme
module, however, we requlre addltlonal connectlons.
A few practlcal examples should showthe posslbllltles ln
handllng counters.
10.2.1 Count up lncrement
Let's assume the followlng task: The slgnal at an lnput should
be counted. An output should be turned on after 5 slgnals. A
reset lnput restores the counter and turns off the output at
any tlme.
3ú)
¥ou wlll flnd examples of the counter module ln the ladder
dlagram on the C0under Count_L0.ZlP
10. Tlmes and counters wlth FST ln ladder dlagram
10-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The programcould look llke thls:
P|ease note
The status of the counter (here C1) ls '0' for a new, 'empty'
control, l.e. the counter ls lnactlve.
ln the programexample above thls results ln the output
00.0 belng swltched on. ln thls example, there ls no
entlatlon lf the counter becomes '0', because lt ls only
counted up to the counter preselect or because the
counter has not yet been actlvated.
10. Tlmes and counters wlth FST ln ladder dlagram
10-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
10.2.2 The unlversal counter
Many programmers use the counter modules ln a more
versal manner. FST can be used to count baslcally each multl-
blt operand wlth the commands l lncrement, count forwards
or 0 decrement, count backwards. ln the same way, each
multl-blt operand can be used ln a calcuatlon (e.g. add ÷1)
and compared (lf the value ls =25 ...).
The example above could be revlsed wlth thls condltlon:
10. Tlmes and counters wlth FST ln ladder dlagram
10-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
10.2.3 Comblnlng tlmes and counters
Fxamples ln whlch tlmes and counters are comblned are also
lnterestlng. A well-known example of such a comblnatlon ls
the request to measure the speed of a controller belng used,
thus a performance measurement
35)
.
ln a performance measurement we want to check how long an
lndlvldual cycle lasts. ln automatlon technology there are
three values of partlcular lnterest for thls:
cycle tlme of the controller's central unlt, whlch ls
completely lndependent of any sensors or actuators and
measures only ln the programs and modules,
cycle tlme wlth connected lnputs]outputs, that ls, the
reactlon tlme of the systemthat passes untll an output
slgnal ls swltched followlng an lnput slgnal, and flnally
cycle tlme of the machlne.
ln prlnclple all three measurements are performed wlth nearly
ldentlcal programs: The counter counts a slgnal changlng
once per cycle as 1 upwards, respectlvely.
Fvery second (or mlnute or hour ...) the counter status ls read
and saved, and the counter starts over agaln from the
nlng. how we can calculate an lndlvldual cycle from the
counter status and the tlme.
Cycle tlme measurement
To get started the lnternal cycle tlme of the CPu should be
measured. For thls a flag word ls used, whlch ls counted up
once ln each CPu cycle.
38)
¥ou wlll flnd thls example as Cycle_L0.ZlP on your C0.
10. Tlmes and counters wlth FST ln ladder dlagram
10-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Fvery second the flnal status ls recorded, saved and
converted
38)
.
38
) For your tests please note: Most of the controls have a mlnlmum
cycle tlme. They wlll not get any shorter, regardless howsmall your
pro|ect ls. To calculate howmuch tlme the controller requlres for
each lnstructlon, two measurements must be performed. 0ne wlth
X llnes of lnstructlon and others wlth X÷¥ llnes of lnstructlon. The
tlme per lnstructlon can be calculated fromthe dlfferent tlmes.
10. Tlmes and counters wlth FST ln ladder dlagram
10-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
10.3 Limitations oI usin¿ times and counters
Tlmes and counters are dlgltal elements and use words that
are modlfled. here FST software also uses words ln the sense
of PLC, that ls, unlts 16 blts wlde. A 16-blt value can
expressed as a declmal take on values between
0 and 2
a matter of prlnclple a counter can also count to thls
value and subsequently beglns agaln from 0. An overrun
must be recognlsed ln the program ltself, as an overrun
blt ls not present.
tlme can therefore lnclude up to 65535 clock pulses.
As each FST tlmer works wlth a clock pulse of 10 ms =
the longest tlme wlth a tlme module can
quently be 65535 * 0.01 s = 655.35 s = 10 mln 55.35 s.
tlme module counts the lnternal tlme counter ln reverse
every 10 ms ln lncrements of 1. Thls clock pulse ls
pletely lndependent of all appllcatlons and processes.
Should a fault arlse ln the appllcatlon whlch should be
delayed, an lndetermlnate perlod of tlme between 10 and
0 ms wlll elapse from thls fault up to the flrst countlng
pulse. The result of thls ls that every FST tlme has an error
of up to -10 ms. That ls why a tlme should never be
grammed ln the programwhlch ls smaller than 2 x 10 ms
(and thls tlme wlll then have an maxlmumerror of
that ls, maxlmum -50 %).
5ub-pregrams with f51
11-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 11
11. Sub-programs wlth FST
11-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
11. 5ub-pregrams with f51 11-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.1 lmportlng and namlng modules 11-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 Transfer and return parameters 11-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2.1 Fxample of return parameters ln statement llst 11-7 . . . . . . . . . . . . . . .
11.2.2 Fxample of transfer parameters ln statement llst 11-9 . . . . . . . . . . . . . .
11.2.3 Fxample of transfer and return parameters
ln statement llst 11-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2.ú Fxample of return parameters ln ladder dlagram 11-1ú . . . . . . . . . . . . . .
11.2.5 Fxample of return parameters ln ladder dlagram 11-15 . . . . . . . . . . . . . .
11.3 Sub-programs wlth FST: Creatlng your own modules 11-17 . . . . . . . . . . . . . . . . . .
11.3.1 My own shlft module 11-17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.ú 0lfference between CFM]CMP 11-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11. Sub-programs wlth FST
11-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
So far you have only become acqualnted wlth parallel
grams and not yet wlth sub-programs. Parallel programs and
sub-programs dlffer ln that
programs, once started, are processed
cally lrrespectlve of whether or not the program whlch
started thls parallel programcontlnues to be actlve.
are processed exactly once and then |ump
back to the selectlng maln program. Should a
gram be processed multlple tlmes, lt must be speclflcally
actlvated each tlme. A sub-programls also deleted, |ust
llke the maln programcalllng lt up, lf thls maln programls
deleted.
FST allows use of 200 sub-programs, dlvlded lnto
gram modules (CMP Call Module Program) and
modules (CFM Call Functlon Module) per pro|ect.
Program modules and functlon programs dlffer ln that
modules cause a change of task when called up
before they are executed. Thls means that program
ules can also contaln steps (ln statement llst).
modules do not cause a change of task when
called up. Functlon modules are net allowed to contaln
steps.
11. Sub-programs wlth FST
11-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
Fvery sub-program can use lnput and output parameters.
matter of prlnclple, up to 7 transfer parameters (to the
module) and 7 return parameters (from the module to the
programcalllng up) are avallable.
There are no local flags wlthln the module. Sub-programs
also use the global flags.
FST provldes a multltude of modules partlally speclflc to the
processor and drlver.
ln addltlon, you can create your own modules. Thls chapter
wlll show you how you can use exlstlng modules.
11.1 tmperting and naming medu|es
hot every pro|ect uses all the modules posslble. ¥ou wlll flnd
an overvlew of the avallable modules ln the FST
tlon and help. lf all these modules were present ln every
|ect, you would soon lose track. That ls why modules are
ported lnto the pro|ect before belng used.
P|ease nete
lf the CPu ls changed ln an exlstlng pro|ect, all the
modules have to be lmported agaln.
Fach module recelves lts own module number whlle belng
lmported. ¥ou can choose any number between 0 and 99.
we recommend always uslng the same numbers ln your own
pro|ects.
11. Sub-programs wlth FST
11-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
¥ou can lmport modules
the menu Program, entry lmport
rlght-cllcklng the sub-programCMPs or CFMs, then call
lmport.
¥ou are then dlsplayed all the modules avallable for the set
CPu.
11. Sub-programs wlth FST
11-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
how select a module and you can glve lt a type and a
number:
The flash module ls lmported as ln thls example. lt ls
avallable ln the sub-dlrectory CFMs.
11. Sub-programs wlth FST
11-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
11.2 1ransIer and return parameters
0f course, there may be modules that |ust have somethlng to
be taken care all done. however, a concrete asslgnment
usually has to be transferred to a module and a result ls
manded.
There are transfer and return parameters avallable for thls,
wlth up to 7 parameters ln each dlrectlon. These parameters
always have the names Fu32 ... Fu38.
Cautien
Transfer and return parameters must always be
ferred and called up ln dlrect connectlon wlth the module
lnvolved. 0ther modules must not be called up as long as
the parameters are nelther transferred nor collected.
11.2.1 Fxample of return parameters ln statement llst
The flash module ls a module to whlch parameters are not
transferred but whlch returns parameters. The flash module
sends four flashlng blts ln the return parameter.
ln the followlng example
37)
the flash module was lmported
flrst as
IF NOP
THEN CFM 0 'Flashing
LOAD FU32 'First module parameter
TO FW0 'Flash bits from flash module
37)
¥ou wlll flnd thls example as Flash.ZlP on your C0. lt contalns a
program ln statement llst and one ln ladder dlagram.
11. Sub-programs wlth FST
11-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The ú blts wlth the lowest values flash ln flag word 0 at the
frequencles 2, 1, 0.5 and 0.25 hz.
Collectlon of the return parameters, ln the above example
LOAD FU32 'First module parameter
TO FW0 'Flash bits from flash module
must always take place lmmedlately after the sub-program
has been called up. ho other modules may be called up ln
between. The return value must be saved dlrectly ln another
varlable.
11. Sub-programs wlth FST
11-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
11.2.2 Fxample of transfer parameters ln statement llst
use the functlon module Fú to start programs cycllcally, every
3 seconds, for example. The programnumber and the tlme
merely need to be transferred to the module. There ls no
return parameter.
ln the followlng example
38)
module Fú was lmported as
IF NOP
THEN CFM l " Start cyclical program processing
WITH Vl " Program number, 0 to 63
WITH V3000 " Time in ms, 0:deactivate
¥ou see that the transfer parameters are attached to the
module call wlth the ald of the keyword wlTh. ln thls example
flxed numbers and constants are used to transfer the transfer
parameters.
however, varlables could also be used. For example, as
follows:
IF NOP
THEN CFM l " Start cyclical program processing
WITH Rl " Program number, 0 to 63
WITH R2 " Time in ms, 0:deactivate
The transfer values to be transferred are located ln both
lsters k1 and k2 ln thls example.
The onllne help of the FST software llsts whlch parameters are
to be transferred and ln what order. ¥ou can recelve
ance ln enterlng the parameters. To do thls, lnsert a module
by chooslng the entry Module Call ln the lnsert menu.
38)
¥ou wlll flnd thls example as P_cyc.ZlP on your C0.
11. Sub-programs wlth FST
11-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
¥ou wlll be asked whlch module should be called up
11. Sub-programs wlth FST
11-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
... and then whlch parameters should be used:
P|ease nete
Constants (vxxx) or multl-blt operands can be used as
parameters. The ldentlfler v must precede the constant.
ln the above example the constant 2 would be transferred
for programnumber 2 and the constant 3000 for 3000 ms.
11.2.3 Fxample of transfer and return parameters ln statement llst
The module LA00 addes two 32-blt values. Fvery 32-blt value
ls located ln two flag words, as FST flag words are always
wlde. As a consequence, ú parameters are transferred
(both the values to be added) and two parameters are
turned (the result).
Let's assume that the numbers 100 ú23 and 77 000 should be
added. The result would be 177 ú23.
100 423
77 000
LAßß
177 423
11. Sub-programs wlth FST
11-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
As we must transfer 16-blt words, we have to convert the
numbers.
Bigher va|ue werd
100 ú23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
÷
77 000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
=
177 ú23
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Lewer va|ue werd
100 ú23 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1
÷
77 000
0 0 1 0 1 1 0 0 1 1 0 0 1 0 0 0
=
177 ú23
1 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1
The ú lndlvldual values each 16 blts wlde are:
Lower value
word from
100 ú23
3ú 887 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1
hlgher value
word from
100 ú23
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
11. Sub-programs wlth FST
11-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Add
Lower value
word from
11 ú6ú 0 0 1 0 1 1 0 0 1 1 0 0 1 0 0 0
hlgher value
word from
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
kesult
Lower value
word from
177 ú23
ú6 351 1 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1
hlgher value
word from
177 ú23
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
ln the followlng example
39)
the module LA00 was lmported
as
IF NOP
THEN CFM 0 " Add 32~bit values
WITH FW0 " lst operand, lower value word
WITH FWl " lst operand, higher value word
WITH FW2 " 2nd operand, lower value word
WITH FW3 " 2nd operand, higher value word
LOAD FU32 " Lower value word of result
TO FW4 ' Lower value word result
LOAD FU33 " Higher value word of result
TO FW5 ' Higher value word result
39)
¥ou wlll flnd thls example as LA00.ZlP on your C0.
11. Sub-programs wlth FST
11-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
The result of the addltlon ls now located ln the flag words
Fwú and Fw5, see screenshot.
11.2.ú Fxample of return parameters ln ladder dlagram
The flash module ls a module to whlch parameters are not
transferred but whlch returns parameters. The flash module
sends four flashlng blts ln the return parameter. ln the
lng example
ú0)
the flash module was lmported flrst as CFM0.
ú0)
¥ou wlll flnd thls example as Flash.ZlP on your C0. lt contalns a
program ln statement llst and one ln ladder dlagram.
11. Sub-programs wlth FST
11-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The ú blts wlth the lowest values flash ln ouput word 0 at the
frequencles 2, 1, 0.5 and 0.25 hz.
11.2.5 Fxample of return parameters ln ladder dlagram
use the functlon module Fú to start programs cycllcally, every
for example. The programnumber and the tlme
merely need to be transferred to the module. There ls no
return parameter.
ln the followlng example module Fú was lmported as CFM1.
11. Sub-programs wlth FST
11-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln thls example flxed numbers and constants are used to
transfer the transfer parameters.
however, varlables could also be used. For example, as
follows:
The transfer values to be transferred are located ln reglsters
k1 and flag word 5000. The onllne help of the FST software
llsts whlch parameters are to be transferred and ln what
order.
P|ease nete
Constants (vxxx) or multl-blt operands can be used as
parameters. The ldentlfler v must precede the constant.
ln the above example the constant ú would be transferred
for programnumber ú and the constant 1000 for 1000 ms.
11. Sub-programs wlth FST
11-17 Festo P.8F-FSTú-L8-Fh en 0ú02hh
11.3 5ub-pregrams with f51: Creating yeur ewn medu|es
¥ou can create your own sub-programs llke normal programs.
They can even also use transfer and return parameters.
11.3.1 My own shlft module
A module
ú1)
ls supposed to shlft the blts ln a word by a
speclfled number of places. The module requlres three
transfer parameters and a return parameter. The transfer
parameters are:
word belng shlfted
number of places that lt should be shlfted
dlrectlon of the shlft (1 = rlght, 0 = left).
The return parameter ls the flnlshed word.
The module call ls qulte slmple ln programperformlng the
call:
"" This program calls up a module representing a shift register
IF I0.0 'Input 0.0
AND N F0.0 'Edge detection
THEN SET F0.0 'Edge detection
CMP 0 'My shift register
WITH FWl 'The flag word to be shifted
WITH V3 "Shift three times
WITH V0 "Right=l, Left =0
LOAD FU32 'First module parameter
TO FW2 'The result of shifting
IF N I0.0 'Input 0.0
THEN RESET F0.0 'Edge detection
ú1)
¥ou wlll flnd thls example as My_CMP.ZlP on your C0.
11. Sub-programs wlth FST
11-18 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The shlft reglster ltself ls now wrltten ln the as follows:
""I wrote this program module myself
STEP Start
"" The transfer parameters are written in flag words first
IF NOP
THEN LOAD FU32 'First module parameter
TO FWl0 'The value to be shifted
LOAD FU33 'Second parameter
TO FWll 'Shift how often?
LOAD FU34 'Third parameter
TO FWl2 'Right = l, Left = 0
STEP Shift
"" Then shift as long as demanded
IF { FWll 'Shirft how often?
> V0 ¡
AND { FWl2 'Right = l, Left = 0
= Vl ¡
THEN LOAD FWl0 'The value to be shifted
SHR
TO FWl0 'The value to be shifted
DEC FWll 'Shift how often?
IF { FWll 'Shirft how often?
> V0 ¡
AND { FWl2 'Right = l, Left = 0
= V0 ¡
THEN LOAD FWl0 'The value to be shifted
SHL
TO FWl0 'The value to be shifted
DEC FWll 'Shift how often?
IF FWll 'Shirft how often?
= V0
THEN NOP
STEP Forward
""Finally, the new value is written in the return parameter
IF NOP
THEN LOAD FWl0 'The value to be shifted
TO FU32 'First module parameter
11. Sub-programs wlth FST
11-19 Festo P.8F-FSTú-L8-Fh en 0ú02hh
11.4 ßiIIerence between CfM{CMP
As represented above, CFMand CMP dlffer only ln that a CMP
causes a change of task when called up and a CFMdoes not.
The task change prlnclple ls represented once more as a
remlnder:
to 6ú programs can be created wlth FST. Fach one can
be actlvated and thus becomes a task.
processor swltches among these tasks:
ascendlng order of the programnumber therefore
from P0 to P63
the exact polnt when a complete step has been fully
processed or at the exact polnt when a return |ump
occurs ln the ladder dlagram
the exact polnt when a CMP ls called up.
Calllng up a programmodule (CMP) causes a change of task.
¥ou can also use steps wlthln a programmodule. They also
each cause a change of task.
Calllng up a functlon module (CFM) does not cause a change
of task. ke steps may be used wlthln a functlon module, as
the functlon module would never come any further than the
flrst step wlthln the module.
11. Sub-programs wlth FST
11-20 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Recegnising errers with f51: 1he f51 errer pregram
12-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 12
12. kecognlslng errors wlth FST: The FST error program
12-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
12. Recegnising errers with f51: 1he f51 errer pregram 12-1 . . . . . . . . . . . . . . . . . .
12.1 Ceneral lnformatlon on errors ln a FST system 12-3 . . . . . . . . . . . . . . . . . . . . . . . .
12.2 The reactlon to an error 12-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.3 The error program 12-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.3.1 The error reactlon wlth the error program 12-9 . . . . . . . . . . . . . . . . . . . .
12.3.2 The garage door wlth error program 12-10 . . . . . . . . . . . . . . . . . . . . . . . .
12.3.3 0escrlptlon of an error 12-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12. kecognlslng errors wlth FST: The FST error program
12-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
12.1 Cenera| inIormation on errors in a f51 system
Fvery controller knows lnternal error messages. ¥ou wlll flnd a
llst of the FST error numbers ln the appendlx. Such an error ls
reported ln the 'error word' and dlsplayed ln the onllne
trol panel. The followlng ls dlsplayed ln dolng so:
£rror type Composition oI the Ct rep|y
Ceneral error =·Frror number·,·programnumber·,·step number·
1)
CPX error (ú2) =·ú2·,·CPXerror number·,·CPXmodulenumber·
l]0 error (11, 12) =·Frror number·,·255·,·number of the lnput or output word·
1)
The error number corresponds to the value of the error word, the programnumber ln whlch the
error appeared, should the programnot have any steps (e.g. for L0k programs), step 0 ls
dlsplayed.
lf the error dld not appear whlle a programwas belng
cessed, then Program ho. 255 ls dlsplayed. lf the program
does not have any steps for example, every ladder dlagram
program Step ho. 0 ls dlsplayed.
8oth the error word (Fw) and the status blt F can also be
shown ln the onllne dlsplay.
12. kecognlslng errors wlth FST: The FST error program
12-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
Please observe: ¥ou wlll flnd the error word dlsplayed ln the
'user deflned' area of the onllne dlsplay. Fnter the Fwor F as
operand there.
The controller automatlcally changes the error word as an
error has been reglstered. The followlng lmage shows error
message 6 ln both the control panel and the onllne dlsplay:
12. kecognlslng errors wlth FST: The FST error program
12-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The error word ls also avallable ln the user program. wlth
THEN LOAD Vl33
TO EW
or
error no. 133 ls produced.
12. kecognlslng errors wlth FST: The FST error program
12-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
12.2 1he reaction to an error
The normal reactlon wlthout any change ln the baslc settlng ls
as follows:
As soon as the content of the error dlffers from 0, that ls, as
soon as the error status has swltched to 0h,
controller swltches to Stop,
kuh LF0 turns red and
outputs swltch off.
Thls reactlon ls called a 'hard error reactlon'.
uslng Controller Settlngs, kun Mode the followlng two
tures can be modlfled lndependent from each other:
error output swltches on when an error occurs. whlch
output can be freely set and]or
outputs remaln swltched on.
12. kecognlslng errors wlth FST: The FST error program
12-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln the process the controller can stlll be reached from
slde. ln an operator termlnal, for example, the error word can
be read out and lnterpreted for trouble shootlng.
0nly the very flrst error that occured ls saved. Any
quent errors are lgnored.
when a pro|ect ls downloaded the error word ls automatlcally
deleted.
Should the controller ltself react to an error ln any form
soever, lt must be able to process a program. That ls what the
error programls for.
12. kecognlslng errors wlth FST: The FST error program
12-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
12.3 1he error pro¿ram
The error programcan be entered under 'Controller Settlngs'
ln the tab kun Mode.
Fnterlng ln the error programmeans:
program 0 means that there ls not an error program.
programnumber from 1 ... 63 means that the
gram entered ls started ln the event of an error.
12. kecognlslng errors wlth FST: The FST error program
12-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
12.3.1 The error reactlon wlth the error program
lf an error programexlsts then the followlng wlll occur ln the
event of an error:
program ln whlch the error occurred ls stopped,
other programs are halted (they are not stopped but
rather 'doze') and
error programls actlvated.
The error word ls evaluated ln the error program. Afterwards
the followlng can be done:
error can be deleted and the rest of the programs can
be actlvated agaln or
the outputs and programs can be reset (ma|or errors).
To be able to react to the error, you requlre ls module F22.
¥ou can lmport module F22 from the FST module llbrary lnto
the current pro|ect (see also sectlon 11.1).
F22: Settlng the error handllng
lnput parameters
Fu32 = 0 Çuery error data
= 1 Çuery error data and delete errors
= 2 Contlnue processlng program,
Çuery error data and delete errors
= 3 Frrors that cannot be rectlfled,
Stop program
keturn parameters
Fu32 Frror number
Fu33 Program number
Fu3ú Step number
Fu35 Always 0 (error address)
12. kecognlslng errors wlth FST: The FST error program
12-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
12.3.2 The garage door wlth error program
ú2)
Let's assume that the llmlt swltches for the garage door
gram should be monltored. lf both llmlt swltches transmlt a
at the same tlme, there must be an error. Thls error
should be slgnaled wlth the output 00.5 untll the error ls no
longer present. The programs should then be 'woken' agaln,
that ls, the controller contlnues to work.
The monltorlng program P2 ls supplemented for thls:
"" Monitor limit switches
IF open 'Limit switches garage door is open
AND closed 'Limit switches garage door is closed
THEN LOAD Vl00
TO EW
Frror 100 ls thus the new error number for a defectlve llmlt
swltch ln the garage door drlve.
As soon as the error occurs, the error programls actlvated
and the rest of the programs 'sleep'. The error ls dlsplayed ln
the upper rlght of the onllne wlndow ln onllne mode:
ú2)
¥ou wlll flnd thls programexample as Car_Frr.ZlP on your C0.
12. kecognlslng errors wlth FST: The FST error program
12-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The error programdlfferentlates between system errors and
llmlt swltch errors:
"" System error which is not programmed
"" Hard reaction
IF N { EW
= Vl00 ¡
THEN CFM 22 " Setup error handling
WITH V3 " 0:query, l:query+del,
" 2:query+del+continue, 3:stop
RESET Pl2
"" Limit switch error
"" Wait for the limit switch to be repaired
IF { EW
= Vl00 ¡
AND { open 'Limit switches garage door is open
EXOR closed ¡ 'Limit switches garage door is closed
THEN CFM 22 " Setup error handling
WITH V2 " 0:query, l:query+del,
" 2:query+del+continue, 3:stop
RESET Pl2
12. kecognlslng errors wlth FST: The FST error program
12-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
12.3.3 0escrlptlon of an error
Known errors are dlsplayed wlth a text ln onllne mode. Thls
text ls taken from the flle errorlpc.txt. Thls flle ls located ln the
followlng dlrectory:
verslon: \FSTú
verslon: \FSTú\0Fu
here you can supplement the followlng, for example:
0perating with f51: Cennecting and pregramming
eperater termina|s
13-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 13
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
13. 0perating with f51: Cennecting and pregramming
eperater termina|s 13-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.1 Connectlng the operator termlnal 13-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.1.1 The FXT port ln the FFCs (front end controller) 13-5 . . . . . . . . . . . . . . . .
13.1.2 Communlcatlon between FF0 and the programmlng PC 13-6 . . . . . . . .
13.2 FF0 0eslgner and FST 13-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.2.1 Showlng a varlable on the dlsplay 13-10 . . . . . . . . . . . . . . . . . . . . . . . . . .
13.2.2 Modlfylng a varlable from the dlsplay 13-12 . . . . . . . . . . . . . . . . . . . . . . .
13.3 The FF0 ln the Fthernet network 13-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.3.1 The FF0 0eslgner pro|ect for Fthernet communlcatlon 13-1ú . . . . . . . . .
13.3.2 Multlple controllers ln the network wlth a FF0 13-17 . . . . . . . . . . . . . . . .
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
hardly any machlne can get by these days wlthout operator
termlnals. The more sophlstlcated the deslgn of the operator
guldance, the easler lt ls to traln operatlng personnel. The
more creatlvlty and tlme lnvested ln the deslgn of debuggers,
the faster a defectlve proxlmlty swltch can be found and
changed ln case of emergency every mlnute of downtlme
saved translates lnto great savlngs.
operator termlnal from Festo
(here type FF0 50)
ln thls chapter the foundatlon ls lald for connectlng the Festo
FF0 operator termlnal.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
13.1 Cennecting the eperater termina|
0perator termlnals are usually connected vla a serlal port.
For CPX-FFC, plug ln the FF0 uslng the connectlon cable type
FFC-K8C7 or FFC-K8C8 (artlcle no. 539 6ú2 or 539 6ú3). FF0s
have a 15-pln Sub-0 lnterface for connectlng to the controller
(PLC lnterface). A cable for connectlng to the controller ls
qulred, dependlng on the CPu. The K8C3, Th 189 ú29 cable
ls requlred for the C0M port of the lPC FFC FC20, FC21, FC22,
FC23.
A K8C6, artlcle no. 189 ú32 ls used for the C0M port of the
hC16 CPu or the CP3X modules, whereby the adapter
cluded wlth the cable ls unnecessary and can be dlsposed of.
The K8C6, artlcle no. 189 ú32 ls requlred for all the remalnlng
lnterfaces, that ls, for FC2X CPus (FXT port), FC3X CPus, all
lPC FFC standard lnterfaces, hC0X CPus and hC20 CPus.
    
 PC wlth FF0 0eslgner
 Serlal connectlon
 Front end dlsplay (FF0)

 Controller
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
13.1.1 The FXT port ln the FFCs (front end controller)
lf a dlsplay ls connected to the FXT port of a FFC, lt must be
actlvated flrst. For thls:
º The C0MFXT drlver must be lntegrated ln the drlver
conflgurarlon.
º The FXT port must be opened ln the programand the
actlvated. The modules 0penC0Mand F31
(actlvate Cl) are requlred for thls.
The FXT port ls now opened ln an lnltlallsatlon step
ú3)
and
the Cl ls actlvated on thls lnterface.
ú3)
¥ou wlll flnd thls programon your C0 ln the allocatlon llst as
FF0_FXT.ZlP, ln the ladder dlagramas FF0_FL0.ZlP.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
STEP Init
"" Open the EXT serial port
"" ATTENTION: The COMEXT driver must be entered in the driver
"" configuration!
IF NOP
THEN CFM 0 " Open serial port with 9600, 8, N
WITH V0 " Serial port
IF FU32 'First parameter for modules
= V0
THEN NOP
STEP
"" Activate the CI on this port
IF NOP
THEN CFM l " Activate CI
WITH V0 " Serial port
WITH V2 " 0=disable CI {Default¡, l=enable CI
The dlsplay can now get the necessary data vla the FXT port.
Please observe:
The module F31 used to actlvate the command lnterpreter
two transfer parameters.
flrst one sets the lnterface used. use ho. 0 to select
the FXT port for the FFCs.
second parameter deflnes the reactlon of the
mand lnterpreter. v2 should be entered here for
munlcatlng wlth the FFCs to prevent the lnterface from the
FF0 belng accldentally turned off.
13.1.2 Communlcatlon between FF0 and the programmlng PC
0f course, a pro|ect, whlch ls created wlth the FF0 0eslgner
descrlbed later, must be loaded lnto the FF0. The cable
FF0Z-PC (artlcle no. 533 53ú) ls requlred for communlcatlon
between the PC and the dlsplay.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
lf you would llke to have access slmultaneously to the
controller and the FF0 and also use a C0M port for the
controller, then set the software FF0 0eslgner to C0M2 and
the FST to C0M1 or vlce versa. ¥ou wlll flnd the settlng ln the
FF0 0eslgner ln the menu Transfer, 0ptlons:
To be able to communlcate wlth the dlsplay from the PC, thls
must be swltched on ln the conflguratlon mode.
To do thls, actuate the Fnter key on the dlsplay untll a system
menu appears on the dlsplay. Select the entry CFC uslng the
cursor keys and conflrm by presslng Fnter. how ln
flguratlon mode" the dlsplay can communlcate wlth PC but
no longer wlth the controller.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
13.2 f£ß ßesigner and f51
The FF0 0eslgner ls used to programthe FF0s
úú)
. The
ware ls an lndependent wlndows appllcatlon. uslng the FF0
follows slmple rules:
Start FF0 0eslgner
ú5)
:
Start a new pro|ect uslng the menu Flle, hew or cllck on the
hew lcon.
úú)
FF0 front end dlsplay
ú5)
¥ou wlll flnd the FF0 0eslgner pro|ect on your C0under the name
FF0_new.dpr
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Fnter the pro|ect name.
Set the dlsplay type or read out the dlsplay belng used vla
the menu Pro|ect, Panel Setup.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Select a dlsplay
13.2.1 Showlng a varlable on the dlsplay
Let's assume that the number of parts already produced ls
saved ln flag word 10 of the controller. Thls value ls shown on
the dlsplay. An explanatory text ls placed ahead:
how select a numerlc value for the PLC
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The cursor turns lnto a cross-halr wlth whlch you can pull up
the area to dlsplay the controller's value.
As soon as you release the mouse button, the lnput wlndow
opens for the value to be transferred:
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
here you can enter the data to be dlsplayed. Thls should be a
flag word ln our example.
what ls more, you can also modlfy the fleld wldth. A 16-blt
value wlthout any precedlng slgns requlres at least 5 dlglts
(e.g. 65000) for the maxlmum value.
0n the FF0 0eslgner dlsplay you wlll now see a substltute
symbol for the value whlch wlll be retrleved later from the
PLC:
13.2.2 Modlfylng a varlable from the dlsplay
Let's assume that the nomlnal value for tlme ls saved for a
whlle ln flag word 11. Thls tlme should be able to be modlfled
from the dlsplay. To do thls call up the 'kange' page ln the top
of the wlndow already belng used and enter that lt ls
lble to read and wrlte, as well as lf lt ls reasonable the
range wlthln whlch a value ls permlsslble.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The followlng could then appear on the dlsplay:
when the pro|ect has been downloaded lnto the FF0 and the
FF0 has been started, you can modlfy the nomlnal value by
presslng the key. The FF0 swltches to data entry mode
and the value can be modlfled wlthln the speclfled llmlts. To
do thls, enter the value you want uslng the numerlcal keys
and press Fnter to conflrm.
lt ls posslble that some FF0s do not have thls key. Thls
tlon must then be allocated to a functlon key or a touch cell
uslng the keyboard macro edltor.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
13.3 1he f£ß in the £thernet netwerk
Chapter 1ú descrlbes how the FST programmable controls are
lntegrated ln a network. 0f course, FF0s are also part of thls
network.
The prerequlslte for thls ls acqulrlng the Fthernet lnterface for
the FF0 lncludlng the adapter plug, deslgnatlon FF0Z-lFT,
artlcle no. 533 533. Attach the Fthernet module as per the
assembly lnstructlons.
13.3.1 The FF0 0eslgner pro|ect for Fthernet communlcatlon
For communlcatlon vla the network, the FF0 0eslgner pro|ect
must be lnformed that Fthernet should be used lnstead of the
usual PLC lnterface. To do thls, call up the entry
Controllers" ln the Pro|ect menu.
0pen the controller by cllcklng on the menu button:
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Select Festo Fasy lP and open the Controller settlng.
P|ease nete
Fnter the lP address of the controller (not the FF0) here
wlth whlch the FF0 should communlcate. The controller
must recelve thls lP address by means of the FST pro|ect.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln addltlon, the FF0 ltself must recelve an lP address. To do
thls, call up the entry Setup" ln the Pro|ect menu.
0nce there, select the rlder 0evlces" and enter the
panel's lP address.
P|ease nete
Fnter the lP address of the FF0 (not the controller) here.
As soon as
pro|ect has been downloaded lnto the FF0,
Fthernet connectlons have been establlshed,
controller has recelved a pro|ect wlth the TCPlP drlver
and the correspondlng lP address,
communlcatlon takes place between the FF0 and the
controller vla the network.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-17 Festo P.8F-FSTú-L8-Fh en 0ú02hh
13.3.2 Multlple controllers ln the network wlth a FF0
Multlple controllers can communlcate wlth a FF0 wlth the ald
of the Fthernet network. To do thls access to more than one
controller Multlple Controllers" must be entered ln
Controllers".
Cllcklng allows all the exlstlng controllers ln a network
to be entered consecutlvely.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-18 Festo P.8F-FSTú-L8-Fh en 0ú02hh
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-19 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Should a varlable of a controller now be accessed by FF0, thls
controller must be named. wlth lnsert, 0ata Flelds, humerlc,
for example, the wlndow already used ls opened.
13. 0peratlng wlth FST: Connectlng and programmlng operator termlnals
13-20 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The button dlrectly next to the varlable address now opens
not only the selectlon of the varlable but also the controller
selectlon.
ketwerking with f51
1ú-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 14
1ú. hetworklng wlth FST
1ú-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
14. ketwerking with f51 14-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.1 Prerequlslte for uslng Fthernet the TCP]lP drlver 1ú-3 . . . . . . . . . . . . . . . . . . . .
1ú.1.1 Fxcurslon lnto lP address and network masks 1ú-6 . . . . . . . . . . . . . . . .
1ú.1.2 Can the controller be found ln the network! 1ú-7 . . . . . . . . . . . . . . . . . .
1ú.1.3 0hCP server 1ú-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.1.ú Program sensltlve lP addresses 1ú-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.2 Programmlng and trouble shootlng ln the network 1ú-13 . . . . . . . . . . . . . . . . . . . .
1ú.3 Communlcatlng among the controllers ln the network 1ú-16 . . . . . . . . . . . . . . . . .
1ú.3.1 lP_Table 1ú-17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.3.2 Fasy_S and Fasy_k 1ú-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.3.3 Fxample 1ú-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.3.ú Monltorlng data communlcatlon 1ú-21 . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.ú Communlcatlng wlth wlndows appllcatlons uslng 00F 1ú-22 . . . . . . . . . . . . . . . . .
1ú.ú.1 uslng 00F to wlndows 1ú-22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5 Some rules for uslng Fthernet 1ú-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.1 Fthernet ls standardlsed 1ú-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.2 Fthernet has standardlsed cables and plugs 1ú-31 . . . . . . . . . . . . . . . . . .
1ú.5.3 hu8s and swltches 1ú-33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.ú From the productlon llne to the offlce vla Fthernet 1ú-3ú . . . . . . . . . . . . .
1ú.5.5 FasylP 1ú-36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1ú.5.6 The rules for uslng Fthernet (10 M8lt]s) 1ú-36 . . . . . . . . . . . . . . . . . . . . .
1ú. hetworklng wlth FST
1ú-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Communlcatlon for automatlon technology has never been as
lmportant as lt ls today. And we're not talklng about
lng and dlstrlbutlng lnput]output data. Fleldbuses have been
taklng care of that for a long tlme ln a fast, secure manner.
what ls meant ls communlcatlon between the controllers and
between the wlndows offlce world and and the controllers ln
productlon. Fthernet, the network standard at the offlce, has
proved ltself to be the ldeal medlumfor communlcatlon, even
ln productlon. use of Fthernet ls slmple and secure wlth FST.
14.1 Prerequisite Ier using £thernet the 1CP{tP driver
Fvery FST CPu can be supplled wlth an Fthernet lnterface. lf
the hardware requlrement the Fthernet lnterface ls
fled, the software requlrement must also be met. Thls ls the
TCP]lP drlver.
The TCP]lP drlver ls entered ln FST as are all drlvers ln the
drlver conflguratlon. To do so, open the '0rlver Conflgutlon'
by double-cllcklng.
1ú. hetworklng wlth FST
1ú-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
The TCP]lP drlver has already been pre-lnstalled at the
factory for CPX-FFC.
ln the drlver conflguratlon wlndow you can call up the drlvers
avallable on thls CPu by double-cllcklng on an empty locatlon.
Please note as wlth all drlvers that drlvers are
clflc
ú6)
. lf you change the CPu durlng a pro|ect, all the drlvers
must be lnserted anew lnto the pro|ect.
ú6)
The TCP]lP drlver for the FFC Compact ls TCPlPFFC, and for the FFC
Standard lt ls TCPlPFC2.
1ú. hetworklng wlth FST
1ú-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The addresses ln partlcular are lmportant ln the followlng
dlalog:
lP address An lP address lc composed of ú bytes, that ls, ú numbers
between 0 and 255.
The addresses 0.0.0.0 and 255.255.255.255 are not
slble. ¥ou can freely select the address ln a closed, local
network conslstlng excluslvely of your controllers and your
programmlng PC. lf your network ls connected to your
pany's network, addresslng must be arranged wlth the lT
department.
lP netmask The mask llmlts usage of the addresses. Fach and every blt
of an lP address corresponds to a blt ln the network mask.
lf the blt ln the network mask ls '1', then the blt ln the lP
address must be ldentlcal between the two partners
munlcatlng.
lP address of the gateway Should your controller network be connected to another
network wlth the ald of a gateway, thls gateway's address
must be entered here. lf you are not uslng a gateway, the
gateway address can remaln 0.0.0.0.
1ú. hetworklng wlth FST
1ú-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.1.1 Fxcurslon lnto lP address and network masks
ln the above example the controller's lP address ls stated as:
168.192.0.3
lt ls wrltten ln blnary as:
1 0 1 0 1 0 0 0 . 1 1 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 1 1
The usual network mask for sub-networks ln automatlon ls:
255.255.255.0
lt ls wrltten ln blnary as:
1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0
The address of an arbltrary communlcatlon parter wlthout
uslng the gateway must be as follows:
1 0 1 0 1 0 0 0 . 1 1 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 . X X X X X X X X
ln numbers thls means: 168.192.0.X
The last byte, deslgnated here as X, may have the values
(0 must remaln avallable for Fthernet servlce tools,
255 must remaln avallable for broadcast messages).
A network mask of 0.0.0.0 ls not permlsslble.
when the TCP]lP drlver ls added to the FST pro|ect, the
troller gets the ablllty to communlcate vla Fthernet. ln terms
of lnformatlon technology, we can say that the TCP]lP drlver
turns the controller lnto a 'server', that ls, lnto a devlce that
can answer querles. Such a devlce ls called a 'slave' ln
bus technology.
1ú. hetworklng wlth FST
1ú-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Thls does not apply thls ls very lmportant untll after the
pro|ect ls downloaded ln the controller wlth the TCP]lP drlver.
Thls pro|ect lncludlng the TCP]lP drlver can only be
loaded vla the kS232 lnterface, as the controller cannot
munlcate vla Fthernet wlthout the TCP]lP drlver.
To repeat:
To enable a FST controller to communlcate vla Fthernet, a
pro|ect must be downloaded wlth the TCP]lP drlver and
wlth the ald of the serlal port to be controlled.
The TCP]lP drlver has already been pre-lnstalled at the
factory for CPX-FFC.
1ú.1.2 Can the controller be found ln the network!
As soon the TCP]lP drlver ls located ln the controller, the
troller can be recognlsed ln the network.
A dlagnostlc tool for the network, the TCP]lP appllcatlon, ls
part of the FST software.
¥ou wlll flnd thls programon your FST C0 ln the subdlrectory
'Tools, TCPlPAppllcatlon'. lnstall thls programon your
puter and start lt.
The TCP]lP appllcatlon's |ob ls to dlsplay all the avallable
controllers ln the network. ¥ou can recognlse each controller
wlth lts lP address, hardware address and pro|ect name. For
all the current CPus the CPu type and verslon of the TCP]lP
drlver ls also dlsplayed.
The TCP]lP appllcatlon provldes very fast help for the most
frequent errors:
that do not match
addresslng.
1ú. hetworklng wlth FST
1ú-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Actlvatlng 'Check Allve' wlll show you the TCPlP appllcatlon
wlth a green check that communlcatlon wlth a controller ls
posslble or wlth the closed slgn that communlcatlon ls not
posslble.
The TCP]lP appllcatlon ls now looklng cycllcally for connected
devlces and dlsplays dlrectly lf communlcatlon ls posslble.
ln the wlndow above you can see that the programmer PC on
whlch the TCPlP appllcatlon ls started has the lP address
10.10.2ú.162, but the connected controllers have addresses
from the number range 192.168.0.XXX. Communlcatlon
tween these devlces ls not posslble, as lt ls forbldden by the
network mask 255.255.255.0.
1ú. hetworklng wlth FST
1ú-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Communlcatlon ls posslble after the programmlng PC has
recelved another lP address.
ln the followlng example the lP address ls doubled, whlch
makes communlcatlon wlth these devlces lmposslble:
1ú. hetworklng wlth FST
1ú-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
lf all the addresses are correctly set up, communlcatlon can
occur. For each lP address, you can see the Fthernet address
(also called a MAC or hardware address), the pro|ect name,
the kernel verslon, the TCP]lP drlver verslon and the CPu
type
ú7)
.
lf there are multlple PCs ln the network ln addltlon to the
trollers, the TCT]lP appllcatlon wlll only show these other PCs
lf the TCT]lP appllcatlon has been started there as well.
ú7)
For older CPus lt can be that not all the lnformatlon can be shown.
1ú. hetworklng wlth FST
1ú-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.1.3 0hCP server
0hCP servers, whlch automatlcally asslgn an address to new
devlces, are used ln many local networks. The FST TCP]lP
drlver supports such 0hCP servers. To do thls the lP address
must merely remaln 0.0.0.0 ln the drlver conflguratlon.
Should the lP address be 0.0.0.0, as ln the example above,
and a 0hCP server be ln the network, then the controller wlll
automatlcally asslgn an address.
1ú. hetworklng wlth FST
1ú-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln thls example the addresses 10.10.2ú.XXX are asslgned by
a 0hCP server.
when the 0hCP server ls used, the programmlng complexlty
ls somewhat greater for communlcatlon between the
trollers, as a speclflc target lP address ls requlred for each
send]recelve. These lP addresses must be lnterchangeable at
flrst. lf the lP address has been asslgned to the controller by
the 0hCP server, the address must read out ln the program
and subsequently be broadcasted to all the connected
trollers ln a prevlously agreed flag word. Then the target
dress can then be read out from thls flag word for
catlon.
1ú.1.ú Program sensltlve lP addresses
An lP address may need to be set up from outslde for some
pro|ects. For example, lt ls concelvable that a machlne's
should be set up by means of one or more rotary
swltches. For thls purpose a module ls avallable for settlng up
(and querylng) the lP address: lP_lP.
1ú. hetworklng wlth FST
1ú-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
14.2 Pregramming and treub|e sheeting in the netwerk
Let's assume you have a productlon llne wlth 10 controllers:
Conveyor control, parts supply, part storage, drlll, test
tlon, packlng statlon. The controllers can all work away |ust
great. lf you want to make a change or search for errors ln the
system, then take your programmlng PC and go from
troller to controller: Plug change test decouple next
controller plug change test decouple next controller
...
lt ls much easler when the controllers are networked vla
Fthernet. Fach FST CPu ls avallable ln a verslon wlth an
Fthernet connectlon. Fach controller recelves an address. And
your programmlng PC ls ready to be connected to the
work at any spot, so that you can access all the statlons. The
only thlng you need ls the wlrlng, on one hand, and the
stallatlon of the TCP]lP drlver ln the controller, on the other
hand.
After the TCP]lP drlver has been loaded lnto the controller
uslng the tradltlonal kS232 lnterface, the controller has
subsequently rebooted automatlcally, the TCT]lP appllcatlon
has slgnaled by means of the green check that lt ls ready for
communlcatlon, thls controller can be addressed wlth the ald
of the lP address ln the network.
The connectlon merely needs to be reconflgured ln the
To do thls, open the Fxtras menu and select
1ú. hetworklng wlth FST
1ú-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
under the rlder Communlcatlon you wlll flnd the posslblllty of
settlng up the Fthernet card and an lP address determlned
there lnstead of the kS232 lnterface.
1ú. hetworklng wlth FST
1ú-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
P|ease nete
Please observe:
º TCP]lP use must be selected.
º The lP address must be the address of the controller
belng communlcated wlth.
º The marklng 'Save ln Pro|ect' means that the settlng
made here ls pro|ect sensltlve. when a pro|ect ls
started, the usual values (mostly kS232 communlcatlon)
are used at flrst. Should 'Save ln Pro|ect' not be
lected, thls settlng wlll apply to any subsequent new
pro|ects.
Cllcklng 0K allows you to communlcate wlth the controller vla
Fthernet.
Contrary to kS232, Fthernet also provldes the posslblllty of
communlcatlng slmultaneously wlth multlple controllers.
Slmply open FST multlple tlmes, select varlous pro|ects from
the varlous lP addresses and you can slmultaneously observe
multlple controllers ln dlfferent wlndows.
1ú. hetworklng wlth FST
1ú-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
14.3 Cemmunicating ameng the centre||ers in the netwerk
2 modules are baslcally used to communlcate among
trollers. Fasy_k to collect data (recelve) and Fasy_S to send
data. 8efore these modules can be used, a table or an lndex
llst of all the controllers to be communlcated wlth must be
complled uslng lP_TA8LF. As matter of prlnclple,
tlon takes place ln 3 steps:
1ú. hetworklng wlth FST
1ú-17 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.3.1 lP_Table
A table of all the controllers to be communlcated wlth ls
plled uslng lP_Table (there can be conslderably more
trollers present ln the network, here we are only deallng wlth
the controllers from whlch data should be collected or to
whlch data should be sent).
tndex tP address
1 192.168.0.5ú
2 192.168.0.55
3 192.168.0.56
etc.
table
As already mentloned above for the 0hCP server, the lP
dress must be speclfled dynamlcally at thls polnt when the
controllers are newly asslgned thelr lP address by the 0hCP
server each tlme after lt ls swltched on. The procedure ls as
follows:
Precedure
1. The controller ls swltched on.
2. The controller recelves an lP address from the 0hCP server.
3. The controller detects lts own lP address.
*)
ú. The controller broadcasts lts own lP address to all the other
trollers ln the network ln a flag fleld reserved for thls controller.
*)
5. The other controllers use the lP address from thls flag fleld.
*)
*)
To be programmed by the user
1ú. hetworklng wlth FST
1ú-18 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.3.2 Fasy_S and Fasy_k
An understandlng of communlcatlon ls requlred to use
Fasy_S and Fasy_k.
1ú.3.3 Fxample
The followlng example
ú8)
sends the flag word 5 of the cllent
to the flag word 10 of the server. The status of the data
transfer ls entered ln flag word 1 of the cllent.
ú8
) ¥ou wlll flnd thls program example as Fasy_S.ZlP on your C0.
1ú. hetworklng wlth FST
1ú-19 Festo P.8F-FSTú-L8-Fh en 0ú02hh
STEP
"" A table of all the controllers is compiled with IP_Table
"" with which communication should take place.
"" IP_Table must be called up once for each controller.
IF NOP
THEN LOAD K0
TO FW2 'Counter for TimeOut
CFM 0 " Enter/query IP address in table
WITH Vl " l:enter, 2:query
WITH Vl " Index number in IP table
WITH Vl92 " IP address
WITH Vl68 " IP address
WITH V0 " IP address
WITH Vl55 " IP address
IF FU32 'Module parameter
= V0
THEN NOP
STEP Send
"" Now data is being sent to the controller with index l
IF NOP
THEN CFM 2 " Send operand range to controller
WITH Vl " Index number in IP table
WITH Vl " Operand, l:M, 2:E, 3:A, 4:R, ll:Strings
WITH Vl " Number of operands to be sent {max. 256¡
WITH V5 " No. of the first operand to be sent
WITH Vl0 " Num. of the first operand in the target CPU
WITH Vl " Address of the flag word for the status
STEP Check
"" Now it is checked whether the data transfer was successful or not
"" Data communication was successful
IF FWl 'Status of Easy_S
= V0
THEN LOAD V0
TO FW2 'Counter for TimeOut
JMP TO Send
"" Data communication produced no answer with the specified time
"" {approx. 50 ms¡
IF FWl 'Status of Easy_S
= Vl28
THEN CV FW2 'Counter for TimeOut
JMP TO Send
1ú. hetworklng wlth FST
1ú-20 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The followlng lmage shows the flags for the two partlclpatlng
statlons: The cllent, whlch sends the flag word 5, ls on the
top, and the server, whlch recelves the data ln flag word 10, ls
on the bottom.
1ú. hetworklng wlth FST
1ú-21 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.3.ú Monltorlng data communlcatlon
hearly all communlcatlon ln automatlon technology must be
monltored. The tlmeouts are slmply counted ln the above
example. Tlmeouts are perfectly normal ln a commensurately
large network wlth a lot of communlcatlon. An lndlvldual
out ls therefore usually not of any lmportance. however, lf too
many tlmeouts occur, the connectlon could be completely
lnterrupted. The counter status should thus be evaluated and
the proper error message sent out.
ln addltlon, there ls also the posslblllty of testlng the prlnclple
ablllty to communlcate. A module ls avallable whlch releases
the Fthernet Plng, for example.
1ú. hetworklng wlth FST
1ú-22 Festo P.8F-FSTú-L8-Fh en 0ú02hh
14.4 Cemmunicating with Windews app|icatiens using ßߣ
Communlcatlon between the automatlon and the offlce world
ls of tremendous lmportance today. 0f course, thls
catlon can be custom programmed for the appllcatlon. The
FasylP protocol for communlcatlng wlth a FST controller vla
Fthernet ls released |ust llke the Cl commands wlth whlch
communlcatlon takes place vla the kS232.
0f course, lt ls easler to use ready-made tools. These lnclude
the 00F server and the 0PC server.
1ú.ú.1 uslng 00F to wlndows
00F ls a data exchange procedure whlch Mlcrosoft already
lntroduced wlth wlndows 3.1 and whlch supports and uses
all the subsequent wlndows verslons. lt constltutes a method
wlth whlch dlfferent wlndows programs can exchange data
wlth one another. The 'lPC 0ata Server' ls thus a wlndows
programwhlch makes data avallable ln the format deflned by
00F.
All wlndows appllcatlons understandlng thls format can now
exchange data wlth the lPC 0ata Server. The lPC 0ata Server
gets]sends thls data from]to connected FST controllers vla
Fthernet.
The 'lPC 0ata Server' must be lnstalled separately. ¥ou wlll
flnd thls programon your FST C0 ln the subdlrectory Tools.
After you have lnstalled the 00F server, you wlll flnd the entry
lPC 0ata Server ln your programmenu. Please start the lPC
0ata Server.
1ú. hetworklng wlth FST
1ú-23 Festo P.8F-FSTú-L8-Fh en 0ú02hh
0pen the Conflg. menu.
1ú. hetworklng wlth FST
1ú-2ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
The lPC 0ata can communlcate wlth connected controllers vla
both Fthernet and kS232. Thls applles to all the FST
trollers, even older FPC systems (but only vla kS232). lf the
kS232 lnterface ls belng used, only one controller per
face can be communlcated wlth. Should your computer be
equlpped wlth ú serlal ports, the lPC 0ata Server can
munlcate wlth up to ú connected controllers vla kS232.
The posslbllltles vla Fthernet are more extenslve:
catlon can take place wlth up to ú8 controllers. 0pen the
flguratlon for 'lPCs (TCP]lP)'.
1ú. hetworklng wlth FST
1ú-25 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln the flrst wlndow you wlll see the access to the flrst 16
nected systems. Start wlth the flrst one lt wlll be called
lPC_1 later.
Flrst, communlcatlon to thls lPC_1 ls 'Fnabled'.
Afterwards, choose whlch data should be accesslble. Fach
telegram always transmlts 256 words. Cllck on 'Cet lnput
words', for example, then all 256 lnput words are accesslble.
Cllck on 'Cet Flag words from 0' (as ln the prevlous example),
then the flag words 0 ... 255 are accesslble. Altogether the
lnput and output words, the reglster, the tlmer preselect and
at most ú x 256 = 102ú flag words from a controller can be
made avallable to a wlndows computer.
P|ease nete
For use of the lPC 0ata Server vla the serlal port lt ls not
necessary to select a certaln varlable range. ¥ou can then
dlrectly access any operands vla the 00F server.
1ú. hetworklng wlth FST
1ú-26 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Should communlcatlon wlth the speclfled lP address already
be posslble, the 00F server wlll be lnformed of thls
ately.
Startlng now the data speclfled ln the conflguratlon ls
able to all 00F-enabled wlndows appllcatlons. The followlng
llngulstlc rule applles here:
00F programname for Fthernet communlcatlon:
lPC_0ATA
00F programname for kS232 communlcatlon:
FPC_0ATA
Controller name for Fthernet communlcatlon:
lPC_1 ... lPC_ú8
Controller name for kS232 communlcatlon:
FPC_1 ... FPC_ú
varlable name: 0perand deslgnatlons ln accordance wlth
FST Cl commands must use the orlglnal
(Cerman) abbrevlatlons:
Fw lnput word
Aw output word
Mw flag word
Tv tlmer preselect, etc.
1ú. hetworklng wlth FST
1ú-27 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln practlce:
lf data ls belng retrleved from the controller to Fxcel, then
proceed as follows:
ln the cell ln whlch the data should be seen, the followlng ls
entered as a formula:
=lPC_0ATAllPC_1!Mw5
Please observe separatlon between the appllcatlon, controller
number and the operand deslgnatlon:
ln practlce lt looks llke thls:
1ú. hetworklng wlth FST
1ú-28 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln thls procedure data ls retrleved from the controller to a
wlndows appllcatlon. To send data from a wlndows
tlon to the controller, the access from wlndows to the 00F
data must be programmed. For thls, Fxcel requlres a small
macro wlth the followlng syntax:
Sub Sendvalue()
Channel =
Appllcatlon.00FPoke Channel,
Appllcatlon.00FTermlnate Channel
Fnd Sub
Applled to the communlcatlon wlth the controller wlth the lP
address 192.168.0.55, conflgured ln the 00F server as lPC_1.
Sub Sendvalue()
Channel =
Appllcatlon.00FPoke Channel,
Appllcatlon.00FTermlnate Channel
Fnd Sub
0r formulated generally:
Sub Sendvalue()
Channel = Program
of the
Appllcatlon.00FPoke Channel,
of the aus
der dle 0aten geholt werden (Cells from whlch data ls
Appllcatlon.00FTermlnate Channel
Fnd Sub
1ú. hetworklng wlth FST
1ú-29 Festo P.8F-FSTú-L8-Fh en 0ú02hh
ln dolng so the macro 'Sendvalue' ls asslgned to a swltchlng
element to send to the value because of a request. The
ú9)
looks llke thls:
The macro ltself looks llke thls ln the macro edltor:
ln the manual for the 00F server you wlll flnd more examples,
partlcularly of the usual process vlsuallsatlons such as Flx,
lntouch, Slmpllclty etc. For vlP, communlcatlon vla 00F ls not
necessary but posslble, as vlP contalns lts own drlver for FST
communlcatlon.
ú9)
¥ou wlll flnd thls Fxcel flle as 00F-Fxcel.XLS on your C0.
1ú. hetworklng wlth FST
1ú-30 Festo P.8F-FSTú-L8-Fh en 0ú02hh
14.5 5eme ru|es Ier using £thernet
Fthernet ls the most frequently used network across the
globe. Fthernet ls the network wlth the most hardware and
software support. Fthernet ls the network technology wlth the
most experts and the greatest know-howworldwlde.
however, Fthernet ls not yet very wldespread ln automatlon
technology. That ls why lt ls worth to see what's golng on ln
the other camp and watch the Fthernet experts.
1ú.5.1 Fthernet ls standardlsed
8us access by Fthernet ls standardlsed ln lFF802.3, or rather,
the method by whlch Fthernet posltlons data on a cable.
Fthernet ls a Multl Master System, that ls, each user ls
pable of accesslng the network sendlng data. A Multl Master
Systemmust resolve the bus access confllct, or rather, clarlfy
what should happen lf two or more statlons want to send data
at the same tlme. Fthernet resolves thls confllct ln that each
statlon always also monltors whlch data ls |ust arrlvlng vla the
network when lt sends data. lf multlple statlons send at the
same tlme, the slgnal on the bus ls falslfled. Therefore, the
data to be heard are dlfferent from the data whlch has been
sent. Thls sltuatlon ls recognlsed, all the statlons cancel the
sendlng process and walt an arbltrarlly deflned tlme before
attemptlng to send the data agaln. Thls procedure ls called
CSMA]C0: Carrler Sense Multlple Access]Colllslon 0etectlon.
1ú. hetworklng wlth FST
1ú-31 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Thls procedures results ln the data belng able to be sent very
qulckly, as a statlon wantlng to send data must only walt untll
the cable ls 'free', then lt takes place. however, thls
cedure also results ln Fthernet belng able to collapse. lf too
many statlons want to send data at the same tlme, then a
colllslon can come about after the flrst attempt durlng the
followlng attempts. At the same tlme more statlons are added
whlch also wlsh to send data and flnally the reply tlmes of
Fthernet lncrease rapldly. The reply tlme of an Fthernet
tem lncrease llnearly up to a bus load of 60 %. lf thls ls
ceeded, the systemwlll soon come to a stand.
1ú.5.2 Fthernet has standardlsed cables and plugs
The flrst Fthernet cables were standardlsed ln 1980. ln 1985,
the 'thln' coax cable 108ase 2 was standardlsed and the
twlsted palr cable 108ase T has been ln exlstence slnce 1990.
Thls ls stlll the most frequently used wlrlng method for
Fthernet even today.
108ase T ls based on the star and a data transfer speed of
Thls means that each statlon ls connected ln the
shape of a star to a star dlstrlbutor, the hu8. The declslve
advantage of thls star topology ls that errors can be spotted
very easlly ln the network: Fach cable can be lndlvldually
tested, plugged and removed wlthout the other statlons
belng lnvolved.
Flbre optlc cable connectlons have also been standardlsed for
several years, as have hlgher data transfer speeds. however,
ls more than satlsfactory for the fleld of control and
automatlon technology and offers greater flexlblllty ln cable
length and wlrlng. Should such a 10 M8lt]s network be
nected wlth 100 M8lt]s statlons, dual-speed hu8s are used
so that both data transfer speeds can mlx as necessary.
1ú. hetworklng wlth FST
1ú-32 Festo P.8F-FSTú-L8-Fh en 0ú02hh

Today hubs are avallable ln deslgns wlth up to 128
tlons, ln both 110 ... 230 v AC and ln 2ú v 0C deslgns.
hubs can be cascaded so that systems wlth several hundred
statlons are posslble.
1ú. hetworklng wlth FST
1ú-33 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.5.3 hu8s and swltches
A hu8 ls merely an ald ln wlrlng and trouble shootlng. For the
rest, all the data ls always transmltted vla the cables.
ever, experlence has shown (thls may not always apply) that
partlcularly ln larger networks communlcatlon between
tlons located close to one another ls more extenslve than
between statlons separated by great dlstances.
A swltch ls |ust a hu8 wlth the addltlonal characterlstlc that
data arrlvlng on a connectlon ls forwarded to the exact
nectlon bearlng the target address of the telegram. Swltches
can 'learn' the correct connectlons. The flrst data telegram ls
sent to all connectlons to begln wlth. The conflrmatlon wlll
reveal whlch connectlon ls correct. From now on only thls one
wlll be served. Subgroups are formed wlth swltches. Thls
usually drastlcally reduces the total data quantlty.
1ú. hetworklng wlth FST
1ú-3ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.5.ú From the productlon llne to the offlce vla Fthernet
The connectlon from productlon to the offlce ls partlcularly
easy wlth Fthernet. ln dolng so, the completely lncalculable
data quantlty ln the offlce comes together wlth the
grammed, predlctable data quantlty ln productlon. when the
offlce bus load gets to hlgh due to data quantlty
ably more than then the CPus ln productlon are
stantly confronted wlth the task of observlng the data trafflc
ln the Fthernet network. Thls causes the cycle of the program
processlng to rlse. lf clearly addressed telegrams are causlng
the data quantlty, conventlonal swltches are enough to
tlvely protect the offlce and productlon from each other.
ever, should broadcast messages (messages 'to all') sent
cycllcally by wlndows or hovell users be causlng the data
trafflc, then the offlce and productlon must be separated
uslng routers or speclal swltches. The router ls conflgured ln
such a way that targeted telegrams transmlttlng data
tween productlon and the offlce may pass, but broadcast
messages may not. Thls achleves effectlve protectlon
tween the offlce and productlon.
1ú. hetworklng wlth FST
1ú-35 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Swltch
Swltch
Swltch Swltch
kouter
separates offlce and
productlon
1ú. hetworklng wlth FST
1ú-36 Festo P.8F-FSTú-L8-Fh en 0ú02hh
1ú.5.5 FasylP
FasylP ls the name of the protocol wlth whlch controllers
munlcate. FasylP ls ldeally sulted for communlcatlon ln
tomatlon technology because lt
completely transparently wlthln local networks,
thus ls able to work on the same cable as a wlndows or
hovell network or the llke
TCP]lP as lts medlum of transportatlon
conflgured ln a hlghly slmple manner
also be used as a master slave system, lf necessary
communlcate wlth any wlndows appllcatlon by means
of 00F or 0PC.
1ú.5.6 The rules for uslng Fthernet (10 M8lt]s)
lndustrlal appllcatlons whlch should exchange data
under real-tlme condltlons, a bus load of no more than
ls recommended (lncludlng broadcast telegrams).
lndlvldual cable between the hu8 and statlon so-
called patch cable may be a maxlmumof 100 mlong.
more than 3 hu8s may ever be sltuated between two
statlons.
must comply to at least category 5 and be double
screened (palrwlse and ln thelr entlrety).
screenlng must be lald over a large area to ground
the ald of PS1 ZF30).
1he W£ß server in the centre||er
15-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 15
15. The wF8 server ln the controller
15-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
15. 1he W£ß server in the centre||er 15-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.1 what ls a wF8 server! 15-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2 wF8 Server and FST 15-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2.1 hecessary browser settlngs 15-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2.2 Some rules for the FST wF8 server 15-6 . . . . . . . . . . . . . . . . . . . . . . . . .
15.2.3 where the hTML pages! 15-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3 hTML pages for the wF8 server 15-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3.1 The flrst hTML page 15-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3.2 A llttle blt more text 15-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3.3 Accesslng the process 15-1ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15. The wF8 server ln the controller
15-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.1 What is a W£ß server?
A wF8 server ls a computer that makes data avallable so that
lt can be accessed uslng a browser. There are now mllllons of
servers avallable on the lnternet. For example, you can access
the Festo server at http:]]www.festo.com. lf a browser
Fxplorer or hetscape or 0pera or ...) contacts
thls address, data ls transferred correspondlng to a preclsely
deflned syntax. The browser lnterprets thls syntax and
plays the data as speclfled. The PC, whlch dlsplays the data
wlth the ald of the browser, ls the cllent wantlng to know
somethlng from or share somethlng wlth the server.
The data made avallable by the server dlffers greatly.
pendlng on the orlgln, the sub|ect matter can be pneumatlc
cyllnders and valve termlnals (www.festo.com),
abled controllers, offlclal government publlcatlons
(www.whltehouse.gov), polltlcal propaganda, erotlclsm ... or
productlon data. lf productlon data ls meant, then lt could
deal wlth the wF8 server ln a controller.
15. The wF8 server ln the controller
15-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.2 W£ß 5erver and f51
}ust as wlth the TCP]lP drlver, a drlver ls also requlred to use
the wF8 server ln the controller. ln addltlon, the wF8 server
drlver absolutely requlres the TCP]lP drlver. That means that
two drlvers are requlred ln the pro|ect for thls example.
As soon as a pro|ect wlth both of these drlvers has been
downloaded, the controller can be addressed ln the network
and observed wlth a browser (wF8 server). Connect the
troller and a PC by Fthernet, start the browser on the PC and
enter the controller's lP address:
15. The wF8 server ln the controller
15-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.2.1 hecessary browser settlngs
Three essentlal settlngs are necessary on your browser so
that the connectlon to the controller really works:
the browser must search the network and not |ust
vla a connected modem.
¥ou wlll flnd thls settlng, e.g. for MS lnternet Fxplorer 5
under Tools, lnternet 0ptlons, Connectlons.
the browser may not access dlrectly vla a proxy
when you are uslng a dlrect connectlon wlthout an
tranet.
¥ou wlll flnd thls settlng, e.g. for MS lnternet Fxplorer 5
under Tools, lnternet 0ptlons, Connectlons, Settlngs.
lt could be necessary to turn off the browser's local
cllpboard lf the controller's data ls not refreshed.
¥ou wlll flnd thls settlng, e.g. for MS lnternet Fxplorer 5
under Tools, lnternet 0ptlons, Ceneral, Temporary
ternet Flles, Settlngs.
15. The wF8 server ln the controller
15-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.2.2 Some rules for the FST wF8 server
¥ou should be famlllar wlth some rules when uslng the
a matter of prlnclple, names wlth 8÷3 characters are
necessary, therefore, e.g. lndex.htm (not: lndex.html)
page lndex.htm can be part of the FST wF8 server lf
the 'lnternal Pages' are actlvated ln the drlver
atlon (default settlng).
FST wF8 server checks whether a page maln.htm
exlsts for each call-up. lf the page exlsts (and a certaln
page ls not expllcltly called up), then maln.htmls
played. lf maln.htmdoes not exlst, then the lndex.htm,
whlch always exlsts, ls dlsplayed.
15.2.3 where are the hTML pages!
Fvery FST controller knows drlves |ust llke your PC. The FFC
based controllers have A: and 8: drlves, the A: drlve not belng
able to be changed by the user, and the 8: drlve belng
cesslble for the pro|ect and the appllcatlon flles. All PS1
based CPus (not the hC0X CPus, as they correspond ln
technlcal terms to the FFC) also know the C: drlve, whlch ls
mostly used for the appllcatlon data.
There are two ways of transferrlng flles to the controller. 0n
the one hand, flle transfer can be called up from the FST
ware, on the other hand, flles can be transferred uslng the
TCP]lP appllcatlon.
15. The wF8 server ln the controller
15-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Transferrlng flles uslng the FST software
use the entry Flle Transfer ln the onllne menu or the lcon for
the flle transfer.
Then you wlll see the flles ln the controller.
15. The wF8 server ln the controller
15-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Thls ls drlve A: ln thls example: Thls drlve cannot be changed.
After swltchlng to drlve 8: the pro|ect flles and drlvers can be
recognlsed.
15. The wF8 server ln the controller
15-9 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The wF8 pages whlch can be dlsplayed uslng the browser
now also belong ln the subdlrectory wF8. To transfer flles,
cllck the 0ownload arrow.
Tranferrlng flles uslng the TCP]lP appllcatlon
The entry 'FST Flle Transfer' ls ln the TCP]lP Appllcatlon.
lf lt ls called up, only the correct lP address of the controller
needs to be entered to establlsh the connectlon.
P|ease note
The lP address can also be copled from the Search wlndow
of the TCP]lP appllcatlon.
klght-cllcklng the lP address makes a small menu avallable
contalnlng the entry 'Copy lP address'.
15. The wF8 server ln the controller
15-10 Festo P.8F-FSTú-L8-Fh en 0ú02hh
After connectlng, the controller and the PC can now be seen
next to one another.
15. The wF8 server ln the controller
15-11 Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.3 h1ML pa¿es Ior the W£ß server
¥ou have already seen above that the wF8 server of the FST
controller ltself already contalns data that the browser can
dlsplay. Thls start page of the wF8 server ls normally called
lh0FX.hTM and can lndeed also be called up under thls name
for FST wF8 server.
All the controller's operands can be accessed from thls page.
The pages lntegrated ln the wF8 server are programmed ln
such a way that they are refreshed cycllcally approxlmately
every 5 seconds.
when the varlables change, the dlsplay wlll also change.
Fven lf you may flnd lt qulte excltlng ln the beglnnlng that the
wF8 server comes wlth flnlshed wF8 pages, the wF8 server
really only makes sense lf you are deslgnlng your own pages
orlented to your own use.
To make the lntroductlon easler, some baslc technlques are
descrlbed. The easlest place to flnd lnstructlons for bulldlng
hTML pages ls on the lnternet. hTML and the FST controllers
are, for example, descrlbed at http:]]fstdemo.beck-lpc.com.
15.3.1 The flrst hTML page
An hTML page ls plaln text. Any text edltor sufflces for wrltlng
the flrst page. (word can only be used lf the text ls saved as a
text flle or lf word causes an hTML page to be produced.)
15. The wF8 server ln the controller
15-12 Festo P.8F-FSTú-L8-Fh en 0ú02hh
A slmple hTML page can be wrltten llke thls:
flrst hTML
hello world
Please observe that 'hTML Tags' are always ln uppercase]
lowercase characters and are always ended wlth a precedlng
]:
are thus the beglnnlng and end of an hTML page.
lf the above hMTL text ls saved ln the flle maln.htm, thls flle ls
transferred to the 8: drlve (or the C: drlve for PS1 CPus) and
thls page ls dlsplayed uslng the browser when the controller
ls called up.
15. The wF8 server ln the controller
15-13 Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.3.2 A llttle blt more text
A llttle more deslgn makes the page look sllghtly more
lnterestlng:
flrst hTML
Thls ls an example for the FST book
Thls ls not an hTML course,
lt ls slmply a very small lntroductlon.
15. The wF8 server ln the controller
15-1ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
15.3.3 Accesslng the process
Changlng the font slze, uslng graphlcs or llnks to other
ternet sltes are all technlques that are part of all lnternet
pages and whlch do not take lnto account any partlcularltles
ln automatlon technology. however, access to the process's
varlables ls declslve for an operatlng console for a productlon
llne. The FST wF8 server provldes a speclal hTML tag whlch
speaks the 'controller's language'.
The followlng ls used to read an operand:

The command lnterpreter
50)
of the FST controller ls
dressed wlth FSTCl. The dlsplay command uses 0Fw0 for the
lnput word 0 (Fw0).
The modlfy command ls used to change an operand. As the
change of an operand should not occur statlcally (then the
changed word could be permanently programmed), a llnk tag
ls used:
the outputs 0 ... 7 to
50)
ln chapter 18 an extremely shortened overvlew ls provlded of the
The Cl ls descrlbed ln detall ln the FST manual.
To address lnputs, outputs, flags etc. for thls purpose lt ls necess-
ary to use the orlglnal (Cerman) names: F - lnput, A - output,
M- flag etc.
15. The wF8 server ln the controller
15-15 Festo P.8F-FSTú-L8-Fh en 0ú02hh
The above example can also be expanded:
flrst hTML
Thls ls an example for the FST book
Thls ls not an hTML course,
lt ls slmply a very small lntroductlon.
The lnput word 0 has the value :
the ouputs 0 ... 7 to
the ouputs 0 ... 7 to
15. The wF8 server ln the controller
15-16 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Accesslng the process's varlables ls the basls for vlsuallslng
and operatlng a process wlth the ald of the wF8 browser.
1ips and tricks Be|pIu| yet Iun
16-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 16
16. Tlps and trlcks helpful yet fun
16-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
16. 1ips and tricks Be|pIu| yet Iun 16-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.1 Allocatlonllst 16-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.2 Statement llst 16-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.3 updatlng the pro|ect 16-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16.ú Flndlng syntax errors 16-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16. Tlps and trlcks helpful yet fun
16-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
16.1 A||ecatien |ist
º ¥ou can copy the allocatlon llst vla the wlndows cllpboard
both from or to Fxcel. lf you would prefer to edlt ln Fxcel,
then the best way to start ls wlth an entry ln the allocatlon
llst, whlch you then copy to Fxcel. There you can edlt as
you please, mark the entlre llst and copy lt back to the
allocatlon llst edltor.
16. Tlps and trlcks helpful yet fun
16-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
º lf you wlsh, you can also create the allocatlon llst ln word.
For thls, create a table ln word. Mark the entlre table and
copy lt to FST.
16. Tlps and trlcks helpful yet fun
16-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
º ¥ou can sort the allocatlon llst as you please. lt ls sorted
by default ln alphabetlcal and numerlc order by operand
address. That ls why l0.0 ls the flrst entry. Cllck as you
do ln wlndows the column lcon., e.g. symbol, and the
allocatlon llst ls sorted accordlng to the symbol name.
16. Tlps and trlcks helpful yet fun
16-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
16.2 5tatement |ist
º The FST statement llst has a clear prlorlty: Ah0 comes
before 0k. ln a mlxed loglc Ah0 wlll thus always be llnked
flrst, then 0k. The garage door example could thus also
be programmed wlthout brackets.
""Open garage doors
IF Open_in 'I0.2: Push button inside Open
OR Open_out 'I0.2: Push button outside Open
AND Key 'I0.6: Key switch outside
AND N Relay_clo 'O0.l: K2: Close garage door
AND N Close_in 'I0.3: Push button inside Close
AND N Close_outs 'I0.5: Push button outside Close
AND N open 'I0.0: Limit keys garage door is open
THEN SET Relay_op 'O0.0: Kl: Open garage door
16. Tlps and trlcks helpful yet fun
16-7 Festo P.8F-FSTú-L8-Fh en 0ú02hh
16.3 Updating the preject
FST allows entlre pro|ects to be downloaded
51)
. however, as
long as the pro|ect changes contaln no new modules or the
llke, a 'update Pro|ect' ls posslble. ¥ou wlll flnd thls entry ln
the 0nllne menu. ln update Pro|ect the pro|ect changes are
analysed and a comparably small flle ls transferred
lng |ust these changes. The changes are then lntegrated lnto
the pro|ect ln the runnlng CPu operatlon.
51)
0ld 'FST pros' may remember that you could also download
lndlvldual programs lnFST. Thls ls not posslble anymore.
16. Tlps and trlcks helpful yet fun
16-8 Festo P.8F-FSTú-L8-Fh en 0ú02hh
16.4 finding syntax errers
lf there ls an error ln your pro|ect, FST wlll not completely
complle the pro|ect and wlll also not transfer lt to the
troller. The message wlndow shows whlch error has been
found and where lt ls suspected to be. The followlng example
shows such an error.
The llne
CZ0P00Vl.AWL{5¡ Invalid sequence of setence
part
polnts out where the error can be found:
CZ0POOVl.AWL{5¡ Invalid sequence of sentence part
| | | +~~ Explanation of the error
| | +~~~~~ Program lines which the error is suspected
| +~~~~~~~~~~~ Version l
+~~~~~~~~~~~~~~ Program 0
0ouble-cllcklng the error locatlon (here CZ0P00v1.AwL(5))
leads dlrectly to the program.
£rrer messages
17-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 17
17. Frror messages
17-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
17. £rrer messages 17-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.1 Ceneral FST error numbers 17-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.2 Festo fleldbus error 17-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.3 AS-lnterface error 17-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.ú Pk0Fl8uS-0P (CP62) error 17-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17. Frror messages
17-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
17.1 Cenera| f51 errer numbers
£rrer
number
Meaning
0 ho error
2 Checksum error ln pro|ect flle Pk0}FCT.kuh.
º 0ownload complete pro|ect agaln
6 Program0 must be started but ls not avallable.
º Create and download Program 0.
7 Attempt to set or restore a non-exlstlng programor lts status.
º Change the programor download the mlsslng program.
9 The programcannot be started due to errors ln the pro|ect flle Pk0}FCT.kuh.
º Check the pro|ect and download lt agaln. A drlver could posslbly be used but lt ls not
loaded, or a drlver ls loaded but cannot be used because the condltlons for lt are not
met. The hardware needed for the drlver may not be avallable or ls not conflgured
properly. The controller may not have enough memory.
11 l]0 card defect, short clrcult at the output or no power supply.
º keplace l]0card, clear short clrcult or connect power supply.
12 l]0card cannot be found.
º Check l]0card.
º Check the swltch settlng on the card and ln the l]0conflguratlon.
13 watchdog explred
A drlver, module or l0scrlpt blocked the run-tlme systemfor more than 1 second and
trlggered a restart.
1ú The drlver to be started cannot be found. A requlred drlver cannot be found or ls not
executable because of an lnltlallsatlon error.
The envlronment (hardware, parameters) mlght not be avallable correctly for the drlver.
º lntegrate the drlver, correctly set the parameters ln the drlver conflguratlon and check
the hardware.
36 hested CMP]CFMor CMP]CFMcannot be found when calllng up.
Change programstructure
39 0ouble error, error ln program.
º Fllmlnate source of error.
ú2 CPXdlagnosls
º Clear CPX error
17. Frror messages
17-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
£rrer
number
Meaning
57 The pro|ect flle (Pk0}FCT.kuh) cannot be read.
º 0ownload pro|ect agaln.
59 Arlthmetlc error.
º Modlfy program.
17.2 feste Iie|dbus errer
£rrer
number
Meaning
1ú Crltlcal drlver error
Pro|ect cannot be started when there ls a error reactlon.
Thls error occurs when the fleldbus drlver could not be found or lf problems occur when
startlng the flrmware of the CP61.
60 Actual conflguratlon ls not a superset of the set conflguratlon.
º Correct the fleldbus conflguratlon or connect any mlsslng users
17. Frror messages
17-5 Festo P.8F-FSTú-L8-Fh en 0ú02hh
17.3 A5-tnterIace errer
£rrer
number
Meaning
700 ho conflguratlon data avallable for the ASl drlver
º Create conflguratlon flle
701 Master not avallable
º Check the rotary swltch settlng of the master. Check conflguratlon:
For the hC20 only the master wlth swltch settlng 1 or ú can be used, for hC16 settlng 1
702 Master not avallable
º Check the rotary swltch settlng of the master. Check conflguratlon:
For the hC20 only the master wlth swltch settlng 1 or ú can be used, for hC16 settlng 2
703 Master not avallable
º Check the rotary swltch settlng of the master. Check conflguratlon:
For the hC20 only the master wlth swltch settlng 1 or ú can be used, for hC16 settlng 3
70ú Master not avallable
º Check the rotary swltch settlng of the master. Check conflguratlon:
For the hC20 only the master wlth swltch settlng 1 or ú can be used, for hC16 settlng ú
711 Fallure of a slave
º Check the slave, replace lt, check the conflguratlon, address 1
712 Fallure of a slave
º Check the slave, replace lt, check the conflguratlon, address 2
713 Fallure of a slave
º Check the slave, replace lt, check the conflguratlon, address 3
71ú Fallure of a slave
º Check the slave, replace lt, check the conflguratlon, address ú
17. Frror messages
17-6 Festo P.8F-FSTú-L8-Fh en 0ú02hh
17.4 PR0ftßU5-ßP (CP62) errer
£rrer
number
Meaning
1001 The drlver cannot make a connectlon to the card.
Probable causes:
card address does not agree wlth the value for the drlver conflguratlon.
valld conflguratlon data for the card (SyCon)
100ú Conflgured slave not on the bus (only ln the event of a reactlon")
1005 lnput address range exceeded (offset)
1006 0utput address range exceeded (offset)
1he f51 Ct cemmand interpreter
18-1 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Chapter 18
18. The FST Cl command lnterpreter
18-2 Festo P.8F-FSTú-L8-Fh en 0ú02hh
Contents
18. 1he f51 Ct Cemmand tnterpreter 18-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.1 The FST operands ] varlables 18-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.1.1 0lsplaylng operands 18-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.1.2 Modlfylng operands 18-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18.2 Some other commands 18-ú . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18. The FST Cl command lnterpreter
18-3 Festo P.8F-FSTú-L8-Fh en 0ú02hh
A FST controller communlcates wlth the programmlng PC or
wlth any other devlce connected to the programmlng
face wlth the ald of a clearly deflned, very slmple command
code, whlch ls deslgnated by the FST Cl (Command
preter). ¥ou wlll flnd detalls on the FST Cl ln the FST manual.
An overvlew of the most lmportant Cl commands should
flce here.
18.1 1he f51 eperands { variab|es
The most lmportant operands are:
0perand designatien Address range £xamp|e bit
addressing
£xamp|e werd
addressing
lnputs F0.0 ... F255.15 F0.12 Fw1ú7
0utputs A0.0 ... A255.15 Aú7.3 Aw0
Flag M0.0 ... M9999.15 Mú312.1ú Mw9999
keglster k0 ... k255 k36
Programs P0 ... P63 P1ú
Programstatus PS0 ... PS63 PS1ú
Programmodules 8AP0 ... 8AP99 8AP12
Functlonmodules 8AF0 ... 8AF99 8AF99
Tlmer status T0 ... T255 T1ú
Tlmer preselect (set value) Tv0 ... Tv255 Tv1ú
Tlmer word (actual value) Tw0 ... Tw255 Tw1ú
Counter status Z0 ... Z255 Z33
Counter preselect Zv0 ... Zv255 Zv33
Counter word (actual
value)
Zw0 ... Zw255 Zw33
18. The FST Cl command lnterpreter
18-ú Festo P.8F-FSTú-L8-Fh en 0ú02hh
0perand designatien £xamp|e werd
addressing
£xamp|e bit
addressing
Address range
Frror word F F
Constants K0 ... K65535
K$0 ... K$FFFF
K-32767 ... ÷32767
K10
18.1.1 0lsplaylng operands
The 0lsplay command dlsplays operands. Fxample:
0Fw0 0lsplay lnput word 0
0k5 0lsplay reglster 5
18.1.2 Modlfylng operands
The Modlfy command modlfles operands. Fxample:
MAwú=33 Modlfy output word ú to the value 33
MM300.1ú=1 Modlfy flag 300.1ú to the value 1
18.2 5eme ether cemmands
Meaning £xamp|e
Call up FST Cl
Start pro|ect kuh k
Stop pro|ect Stop S
Start a certaln program kP1
0310d
Cenditiens eI use Ier "£|ectrenic decumentatien"
t. Pretectien rights and scepe eI use
The flle of your cholce ls sub|ect to
safeguardlng provlslons. Festo or
thlrd partles have protectlon rlghts for
thls electronlc documentatlon whlch
Festo provldes on portable data
age devlces (dlskettes, C0 k0M,
trldge dlscs), as well as ln lnternet
and]or lntranet, always referred to ln
the followlng as
tatlon". ln so far as thlrd partles have
whole or partlal rlght of access to thls
electronlc documentatlon, Festo has
the approprlate rlghts of use. Festo
permlts the user the use under the
lowlng condltlons:
1. 5cepe eI use
a) The user of the electronlc
tatlon ls allowed to use thls
tatlon for hls own, excluslvely
pany-lnternal purposes on any
number of machlnes wlthln hls
ness premlses (locatlon). Thls rlght of
use lncludes excluslvely the rlght to
save the electronlc documentatlon on
the central processors (machlnes)
used at the locatlon.
b) The electronlc documentatlon may
be prlnted out on a prlnter at the
tlon of the user as often as deslred,
provldlng thls prlntout ls prlnted wlth
or kept ln a safe place together wlth
these condltlons of use and other user
lnstructlons.
c) wlth the exceptlon of the Festo
Logo, the user has the rlght to use
tures and texts fromthe electronlc
cumentatlon for creatlng hls own
chlne and systemdocumentatlon. The
use of the Festo logo requlres wrltten
consent fromFesto. The user hlmself
ls responslble for ensurlng that the
plctures and texts used match the
chlne]system or the relevant product.
d) Further uses are permltted wlthln
the followlng framework:
Copylng excluslvely for use wlthln the
framework of machlne and system
cumentatlon from electronlc
ments of all documented suppller
components.
0emonstratlng to thlrd partles
lvely under guarantee that no data
materlal ls stored wholly or partly ln
other networks or other data storage
devlces or can be reproduced there.
Passlng on prlntouts to thlrd partles
not covered by the regulatlon ln ltem
3, as well as any processlng or other
use, ls not permltted.
2. Cepyright nete
Fvery "Flectronlc document" recelves
a copyrlght note. Thls note must be
lncluded ln every copy and ln every
prlntout.
Fxample: © 2003, Festo AC & Co. KC,
0-73726 Fssllngen, Cermany
3. 1ransIerring the autherizatien eI
use
The user can transfer hls authorlzatlon
of use ln the scope of and wlth the
mltatlons of the condltlons ln
ance wlth ltems 1 and 2 completely to
a thlrd party. The thlrd party must be
made expllcltly aware of these
tlons of use.
tt. £xperting the e|ectrenic
mentatien
when exportlng the electronlc
mentatlon, the llcence holder must
observe the export regulatlons of the
exportlng country and those of the
purchaslng country.
ttt. Cuarantee
1. Festo products are belng further
developed wlth regard to hardware
and software. The hardware status
and, where appllcable, the software
status of the product can be found on
the type plate of the product. lf the
electronlc documentatlon, ln whatever
form, ls not supplled wlth the product,
l.e. ls not supplled on a data storage
devlce (dlskette, C0 k0M, cartrldge
dlsc) as a dellvery unlt wlth the
evant product, Festo does not
tee that the electronlc documentatlon
corresponds to every hardware and
software status of the product. ln thls
case, the prlnted documentatlon from
Festo accompanylng the product ls
alone declslve for ensurlng that the
hardware and software status of the
product matches that of the electronlc
documentatlon.
2. The lnformatlon contalned ln thls
electronlc documentatlon can be
amended by Festo wlthout prlor notlce
and does not commlt Festo ln any way.
tv. Liabi|ity{|imitatiens eI |iabi|ity
1. Festo provldes thls electronlc
mentatlon ln order to asslst the user ln
creatlng hls machlne and system
cumentatlon. ln the case of electronlc
documentatlon whlch ln the form of
portable data storage devlces
ettes, C0 k0M, cartrldge dlscs) does
not accompany a product, l.e. whlch
are not supplled together wlth that
product, Festo does not guarantee
that the electronlc documentatlon
separately avallable ] supplled
matches the product actually used by
the user. The latter applles
larly to extracts of the documents for
the user's own documentatlon.
The guarantee and llablllty for
ately avallable ] supplled portable
data storage devlces, l.e. wlth the
ceptlon of the electronlc documenta-
tlon provlded ln lnternet]lntranet, ls
llmlted excluslvely to proper
tlon of the software, whereby Festo
guarantees that ln each case the
evant portable data storage devlce or
software contalns the latest status of
the documentatlon. ln respect of the
electronlc documentatlon ln lnternet]
lntranet lt ls not guaranteed that thls
has the same verslon status as the
last prlnted edltlon.
2. Furthermore, Festo cannot be held
llable for the lack of economlc success
or for damage or clalms by thlrd
partles resultlng from the use of the
documentatlon by the user, wlth the
exceptlon of clalms arlslng from
frlngement of the protectlon rlghts of
thlrd partles concernlng the use of the
electronlc documentatlon.
3. The llmltatlons of llablllty as per
paragraphs 1 and 2 do not apply lf, ln
cases of lntent or wanton negllgence
or the lack of warranted quallty,
lty ls absolutely necessary. ln such a
case, the llablllty of Festo ls llmlted to
the damage recognlzable by Festo
when the concrete clrcumstances are
made known.
vt. 5aIety guide|ines{decumentatien
Cuarantee and llablllty clalms ln
formlty wlth the regulatlons
tloned above (ltems lll. and lv) can
only be made lf the user has observed
the safety guldellnes of the
tatlon ln con|unctlon wlth the use of
the machlne and lts safety guldellnes.
The user hlmself ls responslble for
surlng that the electronlc
tlon, whlch ls not supplled wlth the
product, matches the product actually
used by the user.

You might also like