SIEMENS Pr~gramma~ble Controller Order No.: Programming I n s t r u c t i o n s GWA 4NEB 810 2120-02 a Fig. 1 S5-101U programmable c o n t r o l l e r CONTENTS THE PROGRAMMING LANGUAGE STEP 5 programming language Program s t r u c t u r e PRINCIPLE OF OPERATION OF THE PC Program processing "RUN and "STOP" modes Memor ies NOTES ON PROGRAM DEVELOPMENT Power-up B a t t e r y mon it o r ing Ren t e n t i v e / n o n - r e n t e n t i v e flags I n t e r r u p t processing I n t e r c o m p a t i b i lit y between LAD, CSF and STL Operation i n the SINEC L 1 l o c a l area network PROGRAM START-UP Loading and dumping a program Program t e s t Page 1.1 1.1 Page 4.2.1 4.2.2 4.2.3 4.2.4 2.1 2.2 2.2 3.1 3.2 3.2 3.2 3.4 3.7 4.1 4.2 Search f u n c t i o n Signal status d i s p l a y F o r c i n g o f o u t p u t s and flags F o r c i n g o f t i m e r s and counters 5.1.7 5.1.8 5.2 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 PROGRAMMING EXAMPLES Basic operations Binary l o g i c operations S e t t i n g / r e s e t t i n g operations Load and t r a n s f e r o p e r a t i o n s Timer f u n c t i o n s Counter f u n c t i o n s Comparison ( r e l a t i o n a l ) operations Arithmetic operations Other f u n c t i o n s Supplementary o p e r a t i o n s Logic o p e r a t i o n s (word mode) Conversion f u n c t i o n s S h i f t operations Jump o p e r a t i o n s Cond it ion codes 6. OPERATION SET 5. 5.1 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 1. The programming language 1.1 STEP 5 programming language The user programs are w r i t t e n i n t h e STEP 5 programning language. The statements o f t h i s language p e r m i t n o t o n l y t h e programning o f simple b i n a r y functions but also the programming o f complex d i g i t a l f u n c t i o n s . Depending on t h e programmer used, a l l t h r e e methods o f r e p r e s e n t a t i o n statement l i s t (STL) 1 adder d iagram (LAD) c o n t r o l system f l o w c h a r t (CSF) are p o s s i b l e so t h a t the method o f programming can be adapted t o t h e p a r t i c u l a r a p p l i c a t i o n . Only STL p r o gramming i s p o s s i b l e w i t h t h e handh e l d 605U programmer. The machine code generated by t h e 6701675 p r o grammers i s i d e n t i c a l f o r a l l t h r e e methods o f r e p r e s e n t a t i o n .. 1.2 to +o to 3lN 19 239 i d r c f t l 2lh 19 239 Idrcctl K C 117-15 DIN L 3 705 DIN 4 0 719 DIN 1 9 2 3 i , l r r l f t i F i g . 2: Methods o f r e p r e s e n t a t i o n w i t h t h e STEP 5 programming language Program structure The u s e r program c o n s i s t s o f up t o 1024 statements and can be w r i t t e n as a program b l o c k (PB) or f u n c t i o n block (FB). WFy PBl at FBI can k exwwted on %c S5+1O1U programable contrallsr, Program block Function block A program block can be programmed and documented i n a11 t h r e e methods o f r e p r e s e n t a t i o n (STL, LAD and CSF). A p r o gram b l o c k can be t r a n s l a t e d from one method o f r e p r e s e n t a t i o n i n t o t h e two o t h e r methods w i t h t h e 6701675 programmers p r o v i d e d c e r t a i n programming r u l e s are observed (see Section 3.4). For users f a m i l f a r w i t h c o n t a c t o r s and r e 1 ays, t h e LAD method i s recommended s i n c e t h e ladder diagram has v e r y c l o s e s i m i l a r i t i e s w i t h schematic c i r c u i t diagrams. F u n c t i o n b l o c k s can o n l y be w r i t t e n and documented i n STL form. Jump o p e r a t i o n s make i t p o s s i b l e t o enhance t h e s t r u c t u r i n g o f t h e user program and thus a l s o i t s c a p a b i l i t i e s . Short, constant response times t o i n t e r r u p t s can be implemented w i t h l o a d and t r a n s f e r operations i n c o n j u n c t i o n w i t h jump o p e r a t i o n s (see S e c t i o n 3.4). Program b l o c k s are used e s p e c i a l l y when a CRT-based programmer i s a v a i l a b l e and programming o r document a t i o n i s t o be made i n graphic form. Note: Supplementary operations must n o t be used i n PB1. 2. Principle of operation 2.1 Program processing Cr> The c o n t r o l f u n c t i o n s o f the lOlU are d e f i n e d by a user program. I n order t o be able t o scan the user program c y c l i c a l l y statement by s t a t e ment, t h e CPU has t o perform the f o l l o w ing functions: 1. I n t h e case o f a c o l d r e s t a r t (power s w i t c h from " O f f " t o "On" o r mode s e l e c t o r from "Stop" t o "Run"), t h e process o u t p u t image* i s erased, i.e. a l l o u t p u t s are s e t t o zero. Cold restart Erase process output image I Cycle checkpoint Read process input image 2. The process i n p u t image* i s updated, i.e. a l l s i g n a l statuses o f the i n p u t s are scanned and w r i t t e n i n t o t h e process i n p u t image. The user program (PB1 o r FBI) i s scanned and processed statement by statement. When scanning the s i g n a l statuses o f t h e inputs, the CPU accesses t h e process i n p u t image and n o t t h e a c t u a l inputs. When l a t c h i n g and u n l a t c h i n g t h e outputs ( c o i l s ) , o n l y t h e process output image i s o v e r w r i t t e n t o begin with. 12nd statement I H Last statement 4. Once t h e user program has been p r o cessed, t h e process output image i s t r a n s f e r r e d t o t h e actual outputs. Transfer process output image to the outputs 5. P o i n t s 2, 3 and 4 are handled c y c l i c a l ly. Fig. 3: A scanning o p e r a t i o n from c y c l e checkp o i n t t o c y c l e checkpoint takes approx. 70 ms f o r 1024 statements ( b i n a r y ) . I f a scanning c y c l e i s not completed w i t h i n 300 ms due t o program e r r o r s o r f a u l t s , an i n t e r n a l monitor responds, t h e PC e n t e r s t h e "Stop" s t a t u s and a l l o u t p u t s ( c o i l s ) are switched o f f . * P r i n c i p l e o f operation o f t h e S5-101U Process 1/0 image: I n t e r n a l memory area i n which t h e s i g n a l s t a t u s ( " 0 " or "1") o f t h e i n p u t s / o u t p u t s i s stored. I The "Run" and "Stop" modes "RUN" mode "STOP" mode I n t h e "RUN" mode, t h e program i s scanned c y c l i c a l l y from c y c l e checkpoint t o c y c l e checkpoint. The PC i s brought i n t o t h e "RUN" mode by s w i t c h i n g t h e mode s e l e c t o r t o "RUN1' s e l e c t i n g t h e "PC RUN1' f u n c t i o n o f t h e programner (mode s e l e c t o r i n "RUN" position) and on recovery o f t h e power supply i f t h e mode s e l e c t o r i s a t "RUN" and was i n t h e "RUN" p o s i t i o n p r i o r t o t h e power f a i l u r e . I n t h e "STOP" mode, t h e program i s n o t scanned and t h e outputs ( c o i l s ) are disabled. While t h e PC i s i n t h e "STOP" state, a l l t i m e r s and counters and t h e process 1/0 image r e t a i n t h e values o r s t a t e s t h e y had i n t h e l a s t scanning c y c l e p r i o r t o t h e PC e n t e r i n g t h e "STOP" state. I f t h e PC i s switched t o "RUN", 7 ) are t h e t i m e r s and counters (0 reset. The n o n - r e t e n t i v e f l a g s and t h e process 1/0 image are erased. The PC i s brought i n t o t h e "STOP" mode by - s w i t c h i n g t h e mode s e l e c t o r t o "STOP" s e l e c t i n g t h e "PC STOP" f u n c t i o n on t h e programmer f a u l t s o r e r r o r s i n program scanning, e.g. time-out o r operations t h a t can n o t be i n t e r p r e t e d by the PC. The cause f o r t h e PC e n t e r i n g t h e 'STOP" s t a t e can be t r a c e d w i t h t h e a i d o f t h e "DISPLAY ESTACK" f u n c t i o n o f t h e programner (see Section 4.2 o f Operating Instructions). p - - ... - Memories The PC has an i n t e r n a l program memory, the data of which can be supported f o r three years by a backup b a t t e r y . There are a l s o two d i f f e r e n t memory submodules (see Fig. 4 ) . The memory submodules are used f o r p r o gram dumping o r f o r copying the program should o n l y one memory submodule be used f o r a number o f PCs. On power-up o r when the PC i s switched t o "RUN", t h e contents of the memory submodule a r e always copied i n t o t h e i n t e r n a l memory and processed there. Memory submodu le EPROM EEPROM Program dump PG 615 ( w i t h adapter 984-2UAll) PG 670 ( w i t h adapter 984-OUAll) PG 675 PG 615 PG 670 ( w i t h o u t 984 adapter) PG 675 Program erasure Only w i t h s p e c i a l UV lamp (erasure time: 30 min) D i r e c t i n the PC w i t h t h e above programmers and t h e PG 605U p r o r ammer Programmer f u n c t i o n : PG PC) 9 - Program mod i fication via programmer On 1~ erasure o f e n t i r e program p o s s i b l e possible Fig. 4: Differences between the EPROM and EEPROM submodules. 3. Notes on program development Power up When t h e power supply i s switched on o r on recovery of t h e power supply a f t e r a power f a i l u r e , t h e PC assumes t h e f o l l o w i n g s t a t e s w i t h o u t having t o t a k e any a d d i t i o n a l measures i n t h e user program: POWER OFF l POWER ON Current p o s i t i o n o f mode select o r o f t h e PC on power-up - L Operating mode o f PC p r i o r t o power-up STOP RUN STOP RUN F i g . 5: Automatic mode s e t t i n g f o l l o w i n g power-up Prevention o f automatic r e s t a r t i n general Flag* F 63.7 can be used t o prevent automatic r e s t a r t on power-up. This f l a g i s s e t by t h e operating system o f t h e PC on power-up i f t h e "RUN" mode i s s e t and was s e t p r i o r t o power-down. I n order t o enable manual r e s t a r t , f l a g F 63.7 i s r e s e t i n t h e "STOP" mode. It can a l s o be r e s e t by t h e user program (e.g. i n c o n j u n c t i o n w i t h an i n p u t s i g n a l ) . * I n t e r n a l r e 1ay e q u i v a l e n t )+F63.7; "1" I I ! l I User- I---F 63 - 7 & "9" Operating mode f o l l o w ing power-up - - YE S --------t I NO STOP STOP S TOP RUN A f a u l t has occurred i n program scanning and t h e reason f o r t h i s i s stored i n t h e i n t e r r u p t stack. P r e v e n t i n q automatic r e s t a r t on b a t t e r y f a i l ure Flag F 63.6 can be used t o prevent autom a t i c r e s t a r t on b a t t e r y f a i l u r e ( r e t e n t i v e f l a g s reset). F l a g F 63.6 i s s e t by t h e o p e r a t i n g system o f t h e PC on power-up i f t h e backup b a t t e r y f a i l s o r i s n o t connected. The PC must be s e t t o t h e "RUN" mode i n t h i s case. F l a g F 63.6 i s r e s e t by t h e "ERASE PROGRAM" f u n c t i o n o r by t h e user p r o gram (e.g. i n c o n j u n c t i o n w i t h an i n p u t signal). Programming example Programning example I * Error ident i f ier* set 3.2 Battery monitoring Flag F 63.6 i s used f o r m o n i t o r i n g t h e battery. This f l a g i s s e t by t h e operating system o f the PC on power recovery and d u r i n g t h e normal scanning c y c l e i f f a i l u r e o f the b a t t e r y backup v01 tage i s detected. The PC must be i n t h e "RUN" s t a t e . Flag F 63.6 i s r e s e t by t h e "ERASE PROGRAM" f u n c t i o n o f t h e programner o r by the user program. The user can t h e r e f o r e determine how t h e PC i s t o r e a c t t o backup b a t t e r y f a i l ure. The S5-101W has a t o t a l o f 512 f l a g s . The f l a g area i s subdivided as f o l l o w s : Retentive f l a g s (F 0.0 - ...F 31.7) Non-retentive f l a g s ( F 32.0.. .F 63.7) - retain their last state prior t o power-down on power-up ( w i t h backup battery only) r e t a i n t h e i r l a s t s t a t e when t h e mode i s changed from "STOP" t o "RUN" ( w i t h and w i t h o u t backup b a t t e r y ) are r e s e t l i k e t h e n o n - r e t e n t i v e f l a g s on power-up ( w i t h o u t backup battery) can also be r e s e t b y t h e user p r o gram ( " ERASE PROGRAM" f u n c t i o n ). By using r e t e n t i v e f l a g s , t h e l a s t s t a t u s o f the p l a n t o r machine p r i o r t o t h e PC l e a v i n g t h e "RUN" mode can be stored. On r e s t a r t , t h e p l a n t o r machine can resume operations a t t h e p o i n t a t which i t was stopped. - - - - are r e s e t when t h e PC mode changes from "STOP" t o "RUN" and on power-up. Flags F 61.0 - F 62.7 are reserved as c o o r d i n a t i n g f l ags f o r operation i n t h e SINEC L 1 l o c a l area network; f l a g s F 63.0 - F 63.7 are reserved as system f l a g s . Since they are a f fected by t h e PC o p e r a t i n g system, they must n o t be used as f l a g s i n t h e normal sense. Interrupt processing When an i n t e r r u p t s i g n a l (e.g. emergency o f f ) from t h e process i s r e ceived by the PC, t h e l a t t e r i n t e r r u p t s c y c l i c scanning o f t h e user program and i n i t i t a t e s t h e processing o f a specific interrupt routine. I n t e r r u p t processing w i t h t h e S5-101U i s defined e x c l u s i v e l y by t h e user program so t h a t each i n p u t and o u t p u t can be used f o r i n t e r r u p t processing. I n order t o achieve minimum response times, t h e i n p u t s and outputs are r e ferenced d i r e c t , i.e. o u t s i d e c y c l i c program scanning. The l o a d / t r a n s f e r operations "LPB" ( i n p u t s ) and "TPB" ( o u t p u t s ) are a v a i l a b l e f o r t h i s purpose. A more o r l e s s constant response time i s achieved i f t h e scanning o f t h e i n p u t s programmed by t h e user as i n t e r r u p t i n p u t s i s u n i f o r m l y d i s t r i b u t e d over t h e e n t i r e user program. Fig. 6 shows a user program w i t h i n t e r r u p t processing. Task: When i n p u t I 0.0 becomes "l", outputs Q @.g. Q 0.7 are t o assume F3.7. I n t h e s t a t e o f f l a g s F 3.a order t o keep t h e response time as s h o r t and constant as possible, t e n i n t e r r u p t scans should be w r i t t e n i n t h e user program. .. ... STEP 5 program (STL) Expl anat ions 1 s t i n t e r r u p t scan: b y l o a d i n g PB 0, I 0.0 i s scanned d i r e c t , i.e. bypassing t h e process image, and mapped IfF 0.0 (and consequently on F a jump i s made t o t h e I 0.0) i s "l", i n t e r r u p t r o u t i n e . F 10.0 d e f i n e s t h e r e t u r n address. @.a. 2nd in t e r r u p t scan User program 1 0 t h i n t e r r u p t scan Interrupt routine F l a g b y t e FB3 i s t r a n s f e r r e d d i r e c t i n t o p e r i p h e r a l b y t e PB 0, i.e. d i r e c t t o t h e outputs. The process o u t p u t image i s updated. F 11.0 ( o n l y By scanning f l a g s F 10.0 one f l a g i s used), t h e user program i s continued a t t h e r e t u r n address l a s t defined. Fig. 6: Example o f a user program w i t h i n t e r r u p t scanning ... 3.5 Intercompatibility between LAD, CSF and STL General Each o f t h e methods o f representat i o n i n t h e STEP 5 programming languages has s p e c i f i c p r o p e r t i e s and l i m i t a t i o n s . Consequently, a program b l o c k w r i t t e n i n STL cannot s i m p l y be d i s p l a y e d as an LAD o r CSF and t h e g r a p h i c methods of representation, LAD and CSFy may n o t always be f u l l y compatible. I n o t h e r words, one form cannot a l ways be t r a n s l a t e d back i n t o t h e other form. I f t h e program has been e n t e r e d as an LAD o r CSF, i t can always be t r a n s l a t e d back i n t o STL form. F i g . 7: Range and l i m i t a t i o n s o f t h e methods o f r e p r e s e n t a t i o n i n t h e STEP 5 programming language Input Output The aim o f t h i s s e c t i o n i s t o e s t a b l i s h a number o f r u l e s , which, i f adhered to, w i l l ensure complete c o m p a t i b i l i t y between t h e t h r e e methods o f r e p r e s e n t a t i o n . These r u l e s are c l a s s i f i e d as f o l l o w s : - Rules f o r c o m p a t i b i l i t y between t h e graphic methods o f r e p r e s e n t a t i o n (LAD and CSF) I f these r u l e s are followed, i n p u t i s p o s s i b l e i n one graphic f o r m and d i s p l a y i n t h e others. . F i g . 8: Graphic i n p u t - Rules f o r c o m p a t i b i l i t y between t h e statement l i s t and t h e g r a p h i c methods o f representat ion. Ifthese r u l e s are observed, i t i s p o s s i b l e t o e n t e r a program i n any i f t h e t h r e e methods o f r e p r e s e n t a t i o n , graphic o r not, and t o have i t d i s played i n t h e o t h e r two forms. Input Output F i g . 9: I n p u t i n t h e f o r m o f a statement l i s t I n p u t as LAD and d i s ~ l a vas CSF (STL) Rule: Do n o t exceed t h e d i s p l a y boundaries f o r LAD. Excessive n e s t i n g may cause t h e LAD d i s p l a y boundary t o be exceeded (8 l e v e l s ) max . 4 CSF Example o f maximum LAD n e s t i n g f o r d i s p l a y as CSF I n p u t as CSF and d i s p l a y as LAD (STL) Rule 1: Do n o t exceed t h e d i s p l a y boundaries f o r LAD. Too many i n p u t s on a CSF box cause t h e ladder diagram d i s p l a y boundary t o be exceeded. Fig. 11: Example of a maximum AND box i n CSF f o r m f o r d i s p l a y as an LAD Rule 2: The o u t p u t o f a complex e l e ment (memory, comparator, t i m e r and counter) must n o t be ored. Fig. 12: Only AND boxes a r e allowed in.CSFs a f t e r a complex element. I n ~ u as t STL and d i s p l a y as LAD o r CSF Rule 1: A complex element must n o t have a preceed ing operation. Rule 2: The i n p u t s and o u t p u t s o f comp l e x elements must be programmed i n t h e order i n which t h e y a r e assigned parameters on t h e screen i n g r a p h i c mode. Times and counts a r e e x c e p t i o n s s i n c e t h e r e l e v a n t v a l u e must f i r s t be s t o r e d i n t h e accumulator w i t h a l o a d operation. STL LAD I n a d d i t i o n , e v e r y unused i n p u t o r o u t p u t must be assigned an NOP 0 operation. I n t h e case o f t i m e r s and counters, t h e s e t i n p u t and t h e i n p u t f o r l o a d i n g t h e t i m e (TW) o r count (ZW) must be d i s abled together. CSF F i g . 13: Example f o r a s s i g n i n g NOP o p e r a t i o n s t o unused i n p u t s and outputs 3.6 Operation in the SINEC L1 local area network The SINEC L1 l o c a l area network i s used f o r i n t e r c o n n e c t i n g programnabl e cont r o l le r s o f t h e low-end performance range and operates on the Master-Slave principle. The CP 530 comrnun ic a t i o n s processor i s always t h e Master, and the slaves t h e CPUs o f a l l small PCs. Each slave i s assigned a s1 ave number under which i t i s referenced. Data can be i n t e r changed between t h e master and up t o 30 slaves, as w e l l as between the i n d i v i d u a l slaves. I n the case o f the S5-101U, t h e slave number, t h e coordinating f l a g s and t h e send and r e c e i v e mailboxes are d e f i n e d as f o l l o w s : I n a d d i t i o n t o t h e a c t u a l data, c o n t r o l and s e c u r i t y i n f o r m a t i o n , which t h e STEP 5 user program can access through a c o o r d i n a t i n g f l a g word, i s a l s o t r a n s m itted The a c t u a l data a r e deposited i n a r e c e i v e mailbox and a send mailbox which t h e user can access w i t h load and t r a n s f e r operations. . Slave n u m k The slave number i s stored a t the beginning o f t h e user program (PBlIFB1) together w i t h an i n d e n t i f i e r . header SF 63.0 LKF .. Identifier Nos. 1...30 RECEIVE c o o r d i n a t i n q f l aq b.yte (KME) SEND c o o r d i n a t i n g f l aq b y t e (KMS) F l a g b y t e FB 61 i s used. F l a g b y t e FB 62 i s used. M61.7 . . . I I 1-r~ M62.7 M 61.0 . M 62.0 Receive error in last transfer ERROR with master Send error In last transfer SLAVE FAIL A slave in the network has failed BUS-RUN BUS is in RUN state Slave permits programmer access PG-BIT Programmer requests the bus access INTERRUPT This message is accompanied by an interrupt EMPF-ERK Operating system may accept data from the bus into SEND-ERK User releases send mailbox for sending t o the bus t h e receive mailbox Bit from bus master Bit for bus master The c o o r d i n a t i n g f l a g s are a f f e c t e d b y t h e o p e r a t i n g system o f the PC and can t h e r e f o r e n o t be used as f l a g s i n t h e normal sense. Receive mailbox The r e c e i v e mailbox i s i n data block DB1 (DW 40 DW72) and has the f o l l o w i n g structure : ... DL 40 LENGTH o f n e t (0.. .64) DR 40 SOURCE-SLAVE No. (0.. .30) DW 40 DL 41 1 s t itern o f data DR 41 2nd i t e m o f d a t a DW 4 1 DL 42 3 r d i t e m o f data DR 42 4th item o f data DW 42 Nett data DL 71 6 1 s t i t e m o f data DR 71 62nd item o f d a t a DW 7 1 DL 72 63rd i t e m of data DR 72 64th i t e m o f d a t a DW 72 l ) Slave No. 0 = Master Send mailbox The send mailbox i s i n data block DB 1 (DW88.. .DW 112) and has t h e following structure: DL 80 LENGTH o f n e t t data (0.. .64) DR 80 DESTINATION SLAVE No. DW 80 (0.. .30) DL 8 1 1 s t i t e m o f data DR 8 1 2nd i t e m o f d a t a DW 8 1 DL 82 3 r d i t e m o f data DR 82 4 t h itern o f d a t a DW 82 Nett data DL 111 DL 112 6 1 s t i t e m o f data 63rd i t e m o f data . DR 111- 62nd i t e m o f d a t a DR 112 64th i t e m o f d a t a p DW 111 p - DW 112 l ) Slave No. 0 = Master For more d e t a i l e d i n f o r m a t i o n on the SINEC L1 l o c a l area network, please r e f e r t o t h e I n s t r u c t i o n s (4NEB 811-0545) and Programming I n s t r u c t i o n s (4NEB 811-0546) o f the SINEC L1 network . Program Start =up 4. The hand-held PG 605U/615 programmer and t h e CRT-based PG 670 and PG 675 programmers can be used f o r loading and t e s t i n g programs. The f o l l o w i n g s e t t i n g s are necessary on t h e PG 670 and PG 675 programners i n c o n j u n c t i o n w i t h t h e S5-1101 U p r o grammable c o n t r o l l e r : PG 670: S5-150 AK S5-130 W PG 675: S5-150 S NO Loading and dumping a program 4.1 Before loading t h e program, t h e "ERASE PROGRAM" f u n c t i o n must be executed. This deletes - t h e i n t e r n a l program memory o f t h e PC t h e b i n a r y process I / O image a l l flags - e r r o r i d e n t i f i e r s and t h e causes o f interrupts. - When t h e program has been loaded, i t i s t r a n s f e r r e d from t h e programmer memory t o t h e i n t e r n a l memory o f t h e PC. I f an EEPROM submodule i s plugged i n , t h e program i s a u t o m a t i c a l l y dumped. Once t h e program has been t r a n s f e r r e d t o t h e PC memory, i t i s no longer i n t h e programner memory and must be brought back i n t o t h e l a t t e r before program c o r r e c t i o n s can be made* ( o u t p u t FBl/PBl) Dumping o f t h e program i n an EPROM submodule i s p o s s i b l e on the PG 615 ( w i t h adapter), PG 670 ( w i t h 984 adapter) and PG 675 programmers. To dump t h e program i n an EPROM submodule, proceed as shown i n Fig. 14. . * Put PC to STOP r------II I I Erase program t Load program into programmer Transfer pmgram from programmer to PC JI Carry out any program corrections 4 - Transfer program' from PC to programmer S e t PC to RUN 4 JI Test pmgram I JI \Ir I i L Dump program Set PC t o STOP + .I .r \ I s program execut ing properly? 4 1 I I I I Put PC t o STOP $ * I I I I I I I JI Plug EEPROM submodule in I I Transfer program' from PC to programmer r * Tmnsfer pmg-am from programmer t o Pc b' Wait until programming i s completed 2 T J R Necessary only in the case of the 605U progmmmer End Fig. 14: Schematic o f a program l o a d i n g o p e r a t i o n f o l l o w e d by t h e dumping o f t h e program i n an EEPROM submodule 4.1 4.2 Program test F a u l t s causing t h e PC t o e n t e r t h e "STOP" s t a t u s can be i d e n t i f i e d w i t h the a i d o f the i n t e r r u p t stack (see I n s t r u c t i o n s , Section 4.2) 4.2.1 Search function The programmer "Search" f u n c t i o n available f o r locating points i n user program. I n the t e s t phase, f o r instance, p o i n t s i n a program c o n t a i n i n g a f i n i t e operand can be displayed, an output n o t a c t i n g as expected. The f o l l o w i n g search keys can be Statements, e.g. A I 1.0 merands, e.g. I 1.0 - Labels (FB 1 o n l y ) Addresses - 4.2.2 The f o l l o w i n g debugging f u n c t i o n s are available f o r tracing l o g i c errors i n program scanning. is the all dee.g. used: Search runs are i m p o r t a n t i n conjunction w i t h the f o l l o w i n g f u n c t i o n s : - Input/correction - Display - Program-dependent s i g n a l s t a t u s d i s p l a y For more d e t a i l s , please r e f e r t o the Operating I n s t r u c t i o n s o f the programmers. Signal status display The f o l l o w i n g programmer f u n c t i o n s are a v a i l a b l e f o r d i s p l a y i n g the s i g n a l statuses o f b i n a r y and d i g i t a l operands: D i r e c t signal status display Program-dependent s i g n a l s t a t u s d i s p l a y The status o f any operands can be observed a t the c y c l e checkpoint (Sect i o n 2.1) w i t h the a i d o f t h i s f u n c t i o n . This t e s t f u n c t i o n enables the s i g n a l s t a t u s o f an operand and t h e r e s u l t o f the l o g i c o p e r a t i o n t o be observed when the selected statement i s processed. 4.2.3 Forcing of outputs and flags The "FORCE" f u n c t i o n enables d e f i n i t e b i n a r y and d i g i t a l operands t o be i n f luenced w i t h t h e PC i n t h e "RUN" mode. The desired statuses o f t h e operands are entered from t h e programmer b y t e b y byte and t r a n s f e r r e d t o t h e PC. The f o l l o w i n g can be forced: - QB 0.. QB 3 FB O...FB 63 - . I n t h i s way, i t i s p o s s i b l e t o f o r c e d e f i n i t e outputs on system s t a r t u p w i t h o u t t h e user program and check t h e c o r r e c t w i r i n g o f actuators and i n d i c a t o r s e t c . When f o r c i n g w h i l e a user program i s executing, t h e operand statuses entered are t r a n s f e r r e d once t o t h e PC and program scanning resumed w i t h these statuses entered may be m o d i f i e d by t h e c u r r e n t program. 4.2.4 Forcing of timers and counters Timers and counters can be forced i n both o p e r a t i n g modes o f the PC, u s i n g t h e 605U, 615 and OP 393 programmer on l y . Programming (from v e r s i o n 1.lonwards) Programming (from v e r s i o n 1.2 onwards) Data words DW 0 t o DE 15 i n data block DB 1 are reserved f o r t h e p r e s e t values f o r t i m e r s and counters. I n t h e user program, reference i s made t o t h e associated data word when t i m e r s and counters are s t a r t e d . l t o DW 15 i n data b l o c k Data words DW ! DB 1 are reserved f o r t h e p r e s e t values f o r t i m e r s and counters. I n t h e user program, reference i s made t o t h e associated data word when t i m e r s and counters are s t a r t e d . C P DWP to T 15 I f both t i m e r s counters are t o be forced, d i f f e r e n t numbers should be used, e.g. T B-DW C 0-DW 0 15 to to T 15-DW C 16-DW 15 31 16 t i m e r s and 16 counters can be forced. The f o l l o w i n g program i s r e q u i r e d i n t h e PC: A maximum o f 16 timers/counters i n any combination can be forced. The f o l l o w i n g program i s r e q u i r e d i n t h e PC: ~ D W 0 SIT Q L I T i s replaced by LDW ~ M D1 S C 1 LKC i s rep1aced by LDW ; L D 16 ~ SC 1 LKT i s r e p l aced by LDW i LKC i s r e p l aced by LDW (16.. .31) Make sure t h a t t h e r e are meaningful time values i n the data words used when changing from t h e "STOP" t o the "RUN" mode. It i s advisable t o f o r c e t h e t i m e r s / counters ( w i t h t h e preset values) i n t h e "STOP" s t a t u s o f t h e PC. Forcing w i t h t h e programmer The data word assigned t o a t i m e r o r counter i s loaded w i t h t h e p r e s e t value, u s i n g t h e " D i r e c t s i g n a l s t a t u s d i s p l ay" f u n c t i o n o f t h e programmer. The data block f o r t h e preset value can be s e l e c t e d on the programmer ( b u t DB1 i s mandatory f o r t h e S5-101U PC). For f u r t h e r information, p1ease r e f e r t o t h e Programning I n s t r u c t i o n s o f t h e 605U programmer i n t h e S e c t i o n e n t i t l e d "PROGRAM TEST-Forc i n g o f t i m e r s and counters." 5. Programming examples 5.1 Basic operations 5.1.l Binary logic operations AND logic Original ISTEP 5 representation Statement A I 1.1 A I 1.3 A I 1.7 = a 1.0 A "1" s i g n a l appears a t o u t p u t Q 1.0 when a l l t h e i n p u t s have "1" s i g n a l s simultaneously. There are no r e s t r i c t i o n s imposed on t h e number o f scans and t h e prog r ammi ng sequence. A "0" s i g n a l appears a t o u t p u t Q 1.0 if a t l e a s t one o f t h e i n p u t s has a "0" s i g n a l . OR logic l STEP 5 representation Original Statement list I l.Zl'J.5 .5 Q 1.2 0 I 1.2 0 I 1.7 0 I 1.5 = a 1.2 A "1" s i g n a l appears a t o u t p u t Q 1.2 if a t l e a s t one o f t h e i n p u t s has a "1" s i g n a l . A "0" s i g n a l appears a t o u t p u t Q 1.2 when a l l i n p u t s have "0" s i g n a l s s i mu1taneously. L adder diagram ( Control system flowchart Q 1.2 There a r e no r e s t r i c t i o n s imposed on t h e number o f scans and t h e programmi ng sequence. AND before OR logic Original STEP 5 r e p r e s e n t a t i o n Ladder Statement d iagram list C o n t r o l system flowchart A "1" s i g n a l appears a t o u t p u t Q 1.1 when t h e output o f a t l e a s t one o f t h e AND gates i s "1". A "On s i g n a l appears a t o u t p u t Q 1.1 when n e i t h e r o f t h e AND gates has "1" a t i t s output. OR before AND logic STEP 5 r e p r e s e n t a t i o n Ladder Statement diagram list Original ai. I ai.1 A "1" s i g n a l appears a t o u t p u t Q 1.1 if i n p u t I 1.0 o r I 1.1 and one o f t h e i n p u t s I 1.2 o r I 1.3 have a "1" signal. A "0" s i g n a l appears a t o u t p u t Q 1.1 when i n p u t I 1.0 has a "0" s i g n a l and t h e AND gate has a "0" a t i t s o u t p u t . C o n t r o l system flowchart OR before AND logic Original STEP 5 representation Statement Ladder diagram list C o n t r o l system flowchart A "1" s i g n a l appears a t output Q 2.0 when both OR gates have "1" s i g n a l s a t t h e i r outputs. A "0" s i g n a l appears a t o u t p u t Q 2.0 when a t l e a s t one of t h e OR gates has a "0" s i g n a l a t t h i s output. Scanning for "0" signal status Original 11.5 11.6 STEP 5 representation Ladder Statement diagram list A 11.5 AN1 1.6 = Q2.g Q 2.0 A "1" s i g n a l appears a t o u t p u t Q 2.6 o n l y when i n p u t I 1.5 has a "1" s i g n a l and i n p u t I 1.6 a "0" signal. C o n t r o l system flowchart 11.5 a 11.6 11.6 a Q 2 . 0 5.1.2 Setting /resetting operations RS flip-flop for latched signal outputs Original I STEP 5 r e p r e s e n t a t i o n Ladder diagram Statement list C o n t r o l system flowchart I 1 1 4 I17 Q1 5 A I17 S Q15 I 1.7 Q 1 5 R Q15 R a HOP #f A "1" a t s i g n a l I 1.7 s e t s t h e f l i p flop. I f t h e s i g n a l a t i n p u t I 1.7 changes t o "ON, t h i s s t a t u s i s maintained, i.e. t h e s i g n a l i s latched. A "1" a t i n p u t I 1.4 r e s e t s t h e flip-flop. Q 15 I f t h e s e t ( i n p u t I 1.7) and r e s e t ( i n p u t I 1.4) s i g n a l s a r e a p p l i e d simultaneously, t h e scan o p e r a t i o n l a s t programmed ( i n t h i s case A I 1.4) remains e f f e c t i v e d u r i n g p r o c e s s i n g of t h e remaining program. :' ....:.:':.*..::'L,::.: ....:.. @$@E;:@: is Ift h e s i g n a l a t i n p u t I 1.4 changes t o "OU, t h i s s t a t u s i s maintained. ...%..:. o n l y necessary if program i s t o be represented i n LAD o r CSF f o r m on t h e 670/675 programmer. When programming w i t h LAD o r CSF, these NOP @ operations a r e automat i c a l l y in c l uded. S..: RS flip-flop with flags Original STEP 5 r e p r e s e n t a t i o n Statement Ladder diagram list C o n t r o l system flowchart A 113 = 0 14 I A "1" a t i n p u t I 1.6 s e t s t h e f l i p flop. Ift h e s i g n a l a t i n p u t I 1.6 changes t o "OM, t h i s s t a t u s i s maintained, i.e. t h e s i g n a l i s latched. A "1" a t i n p u t I 1.3 r e s e t s t h e flip-flop. I f t h e s i g n a l a t i n p u t I 1.3 changes t o "OM, t h i s s t a t u s i s maintained. I f t h e s e t ( i n p u t I 1.6) and r e s e t ( i n p u t I 1.3) s i g n a l s a r e a p p l i e d s i mu1taneously, t h e scanning o p e r a t i o n l a s t programmed ( i n t h i s case A I 1.6) remains e f f e c t i v e d u r i n g p r o c e s s i n g o f t h e remaining program, i.e. f l a g F 1.7 i s s e t ( s e t t i n g s i g n a l has p r i o r i t y over t h e r e s e t t i n g s i g n a l ). 5.4 Implementation of a transition-sensitive pulse (pulse edge evaluation) Original l STEP 5 representation Ladder diagram Statement list I Control system flowchart - I A I 1.7 ANF 4.0 = F 2.6 A F 2.0 S F 4.0 AN1 1.7 The AND l o g i c c o n d i t i o n ( A I 1.7 and AN F 4.0) i s f u l f i l l e d a t each p o s i t i v e - g o i n g edge o f t h e s i g n a l a t i n p u t I 1.7 and f l a g s F 4.0 and F 2.0 ("Pulse edge f l a g s " ) are s e t i f t h e r e s u l t of t h e l o g i c operation (RLO) i s "1". The AND l o g i c c o n d i t i o n A I 1.7 and AN F 4.0 i s no longer f u l f i l l e d a t t h e n e x t program scan s i n c e f l a g F 4.0 has been set. F l a g 2.0 i s reset, i.e. i t i s o n l y "1" d u r i n g a s i n g l e program pass o r scan. Binary scaler (T or trigger flip-flop) Original l STEP 5 representation Statement list Ladder diagram Control system flowchart A 1l.d ANF 1.6 S 0 1.0 A 11.0 A F1.0 .R....:Q 1.0 $g$&$$$ ANI '; A Q S F AN1 ANQ a I. 1.0 1.0 1.0 1.0 Output Q 1.0 changes i t s s t a t e on a pos i t i v e - g o i n g t r a n s i t i o n a t i n p u t 1.fl. A negative-going change a t t h e i n p u t has no e f f e c t on t h e output. Ifa d e f i n e d frequency i s a p p l i e d t o t h e i n p u t , t h e r e f o r e , h a l f t h e i n p u t frequency appears a t t h e output. 5.1.3 Load and transfer operations Load and transfer @eration L 00 Parameters Function e r ation I W QB Q W F B F W 0 R DL DW P B T CT C K ti3) K F ~ ) K y3) Ks3) KT ~ ) K c3) Function Load ff. IB Parameters T 0 to 5 an i n p u t (from PI1 ) 0 to 4 an i n p u t word (from P I I ) 0 to3 . anoutput yte ( f r o m PI$ ) 0 to 2 an o u t p u t word ( f r o m PIO) aflagbyte Oto63 0 t o 62 a f l a g word 1 t o 255 data (right-hand byte) It o 255 data ( l e f t - h a n d byte) 1 t o 255 data (word) 0 to 5 a peripheral byte o f t h e d i g i t a l 1/0 modules (bypassing t h e PIO) 0 t o 15 a time ( b i n a r y ) (BCD) 0 t o 15 0 t o 15 a count ( b i n a r y ) 0 t o 15 (BC01 random b i t a constant as (16 b i t s ) b i t pattern 0 t o FFFF a constant i n hexadecimal code 32768 t o a constant as + 32767 f i x e d - p o i n t number 0 t o 255 a constant, f o r each 2 bytes byte 2random aconstant,2ASCII alphacharacters numeric characters 0.0 t o a time (constant) 999.3 0 t o 999 a count (constant) !jte P - 00 Transfer ff I B Oto5 I W Oto4 Q B Oto3 QW Ot02 FB FB D R 0 t o 63 0 t o 62 1 t o 255 D L 1 t o 255 D W 1 t o 255 an i n p u t b e (from PI1 an i n p u t word (from P I I ) an o u t p u t ( f r o m P I 0 $jF an o u t p u t word ( f r o m PIO) a f l a g byte a f l a g word data ( r i g h t - h a n d byte) data (left-hand byte) d a t a (word) Ij) Load and t r a n s f e r o p e r a t i o n s a r e abs o l u t e operations, i.e. t h e y a r e c a r r i e d o u t independently o f t h e r e s u l t o f t h e previous l o g i c operation. Graphics programming o f l o a d and t r a n s f e r operations i s o n l y p o s s i b l e i n d i r e c t l y i n connection w i t h t i m e r and counter operation, otherwise o n l y i n statement lists. When l o a d i n g / t r a n s f e r r i n g FW, I W and QW, t h e f o l l o w i n g r e l a t i o n s h i p between t h e accumulator contents and t h e b y t e belonging t o a p a r t i c u l a r word applies: Note: The p r o g r a n a b l e c o n t r o l le r has two accumulators (16 b i t s ) f o r r e l a t i o n a l and a r i t h m e t i c operations and f o r d i g i t a l logic. Loading i m p l i e s t h a t the contents of accumulator 1 are relocated to accumulator 2 and t h a t accumulator 1 i s reloaded i n keeping w i t h the operand o f the l o a d operation. After two load operations, therefore, i n f o r m a t i o n can be obtained, f o r example, on the contents of the accumulators i n connection w i t h r e l a t i o n a l o r comp a r i s o n operations. The t r a n s f e r operation always t r a n s f e r s t h e contents o f accumulator 1 t o t h e operand s p e c i f i e d i n the t r a n s f e r operation. The contents are n o t changed. contents contents 15 ......... 15 ......... When loading an FB, IB, QB o r PB, t h e b y t e i s always loaded i n t h e low b y t e o f t h e accumulator. 0 i s w r i t t e n i n t o t h e h i g h b y t e o f t h e accumulator. When t r a n s f e r r i n g an FB, IB, QB o r PB, i t i s always t h e low b y t e of t h e accumulator that i s transferred. 1) P I 1 process image o f i n p u t s 2) PI0 process image o f o u t p u t s 3 ) Four-byte i n s t r u c t i o n w i t h t h e opcode i n bytes 0 / 1 and t h e constant i n b y t e s 213 Loading and transferring a time (see also under timer and counter operations) T1orpoy STEP 5 representation Statement Ladder list diagram Original Control system flowchart A I 2.0 i{iir.O L T10 T FW20 FW20 Transfer t(l!lk!~-~FW~o pq-bFw20 MOP Q MOP BI: During graphic input, FW 20 was assigned t o o u t p u t BI o f t h e timer. The programmer a u t o m a t i c a l l y s t o r e s t h e corresponding load and t r a n s f e r o p e r a t i o n i n t h e user program. I n t h i s way, t h e contents o f t h e memory l o c a t i o n addressed w i t h T 10 are loaded i n t o accumul a t o r 1. The contents o f accumulator 1 are then t r a n s f e r r e d t o FW 20. The t i m e T10 i n b i n a r y code i n t h i s example can be traced a t FW 20. Outputs B1 and D1 are d i g i t a l outputs. The time appears i n b i n a r y code (BCD w i t h time base) a t o u t p u t B1 (DE). 5.1.4 Timer functions Timers are r e s t a r t e d on power r e c o v e r y following a powerfail condition. Pulse Original STEP 5 representation Control system flowchart diagram The t i m e r i s s t a r t e d d u r i n g t h e f i r s t scanning c y c l e i f t h e r e s u l t o f t h e The t i m e r r e l o g i c o p e r a t i o n i s "l". mains u n a f f e c t e d d u r i n g subsequent scann i n g r e s u l t i n g i n "1" s i g n a l . The t i m e r i s loaded w i t h t h e s p e c i f i e d value (10). The number t o t h e r i g h t o f t h e p o i n t i n d i c a t e s t h e t i m e base: 0 5 0.01 S 2 5 1 s 120.1 S 3 G l O s The t i m e r i s s e t t o "0" ( r e s e t ) i f t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "0". B1 and DE are d i g i t a l o u t p u t s . The t i m e appears a t o u t p u t B 1 (DE) i n BCD. The AT and OT scans r e s u l t i n a "1" s i g n a l as long as t h e t i m e r i s running. Extended pulse Original STEP 5 representation Statement Ladder list diagram Control system flowchart A I 2 0 L KT10 2 S ET1 NOPB NOPQ NOPQ A T 1 = Q 1.0 The t i m e r i s s t a r t e d d u r i n g t h e f i r s t scanning c y c l e i f t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "It1. The t i m e r remains u n a f f e c t e d i f t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "0". The AT o r OT scan r e s u l t s i n a "1" s i g n a l as long as t h e t i m e r i s r u n n i n g . I 2.0 J-L--vQ1.O &k-A-& "ON" delay Original STEP 5 representation Statement Ladder !list diagram The t i m e r i s s t a r t e d during t h e f i r s t scanning c y c l e i f t h e r e s u l t o f t h e l o g i c operation i s "1". The t i m e r remains unaffected during subsequent processing i f the r e s u l t o f the l o g i c operation i s "1". The t i m e r i s set t o "0" ( r e s e t ) i f t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "0". The AT o r OT scan r e s u l t s i n a "1" s i g n a l when t h e time has elapsed and t h e r e s u l t o f t h e l o g i c operation i s s t i l l present a t t h e input. Control system flowchart 6 1: ge The t i m e r i s loaded w i t h t h e s p e c i f i e d value ( 9 ) . The number t o t h e r i g h t o f t h e p o i n t i n d i c a t e s t h e time base: 0 a 0.01 S 2e 1S 1 2 0.1 S 3 a 1 0 s Outputs B 1 and DE are d i g i t a l outputs. The time appears a t output B1 (DE) i n BCD. Latching "ON" delay Original STEP 5 representation Statement Ladder list diagram Control system flowchart I The t i m e r i s s t a r t e d d u r i n g t h e f i r s t scanning c y c l e i f t h e r e s u l t o f t h e l o g i c operation i s "1". The t i m e r i s unaffected if t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "0". I The AT o r OT scans r e s u l t i n a "1" s i g n a l when t h e time has elapsed. The s i g n a l s t a t u s o n l y becomes "ON i f t h e t i m e r i s r e s e t w i t h t h e RT operation. I1 Q1.3 . 6 d "OFF" delay Original STEP 5 representation Ladder Statement diagram list Control system flowchart A I 1 4 L KT1000 004 Q 0.4 A T 5 = a 0.4 The t i m e r i s s t a r t e d d u r i n g t h e f i r s t scanning c y c l e i f t h e r e s u l t o f t h e l o g i c operation i s "0". The t i m e r remains unaffected during subsequent processing i f t h e r e s u l t o f t h e l o g i c operation The t i m e r i s s e t t o "0" ( r e s e t ) i f t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "1". The A T o r OT signal i f the the r e s u l t o f s t i l l present scan r e s u l t s i n a "l" t i m e r i s running o r i f t h e l o g i c operation i s at t h e i n p u t . The t i m e r i s loaded w i t h t h e s p e c i f i e d value (9). The number t o t h e r i g h t o f t h e p o i n t i n d i c a t e s t h e time base: 2 2 1 s 0 =^ 0.01 S l? 0.1 S 3 1 1 0 s Outputs B1 and DE are d i g i t a l outputs. The time appears a t output B1 (OE) i n BCD . Clock pulse generator A clock pulse generator can be cons t r u c t e d from a s e l f - c l o c k i n g t i m e r with a T f l i p - f l o p (binary scaler) a t i t s output. Timer T 7 i s r e s t a r t e d w i t h f l a g F 2.0 each t i m e i t s t i m e elapses, i.e. f l a g F 2.0 has a "1" s i g n a l f o r one c y c l e each t i m e t h e t i m e e lapses These pulses from f l a g F 2.g a c t on the following T f l i p - f l o p with the r e s u l t t h a t a pulse t r a i n w i t h a mark-space r a t i o o f 1 : 1 appears a t output Q 6.6. The p e r i o d durat i o n of t h i s pulse t r a i n i s t w i c e as great as t h e t i m e o f t h e s e l f c l o c k i n g timer. . F2 0 U 5.1.5 Counter functions Set counter Original I STEP 5 / representation Statement Ladder list diagram I / C o n t r o l system flowchart I 2.1 KC1 Sg Ill The counter i s s e t during t h e f i r s t scanning c y c l e i f the r e s u l t o f t h e l o g i c operation i s "1". The counter remains unchanged during subsequent processing ( i r r e s p e c t i v e o f whether t h e r e s u l t of t h e l o g i c o p e r a t i o n i s "1" o r "0"). The counter i s s e t again (pulse edge e v a l u a t i o n ) a t t h e next f i r s t scanning c y c l e i f the r e s u l t o f t h e l o g i c operation i s "1". I n t h e above example, t h e s t a r t i n g value of t h e counter i s 150. B1 and DE are d i g i t a l outputs. The count appears a t output B 1 (DE) i n BCD. Reset counter Original l STEP 5 representation Ladder Statement diagram list The counter i s r e s e t when t h e r e s u l t o f t h e l o g i c o p e r a t i o n i s "1". The counter remains unchanged i f t h e l o g i c o p e r a t i o n becomes "0". C o n t r o l system flowchart Original STEP 5 r e p r e s e n t a t i o n Statement Ladder diagram list I 1 l KCQl8 C o n t r o l system flowchart A I 2.1 L K C 918 a1 0 A C 1 = Q 10 The value o f t h e addressed counter i s incremented by 1. The CU f u n c t i o n i s e f f e c t i v e o n l y on a p o s i t i v e - g o i n g pulse edge ( f r o m "0" t o "l") o f t h e r e s u l t o f t h e l o g i c operation programmed b e f o r e CU. A counter w i t h two d i f f e r e n t i n p u t s can be used as an upldown counter b y means o f t h e two separate pulse-edge f l a g s f o r CU and CD. Counting down STEP 5 r e p r e s e n t a t i o n Statement Ladder list diagram Original 120KCfl25 C o n t r o l system flowchart A L 1 0 CDC 1 S C 1 A I 21 F 100 I21 F 10B A C 1 The value o f t h e addressed counter i s decremented by 1. The CD f u n c t i o n i s e f f e c t i v e o n l y on a p o s i t i v e - g o i n g pulse edge ( f r o m "0" t o " l " )o f t h e l o g i c o p e r a t i o n programmed b e f o r e CD. A counter w i t h two d i f f e r e n t i n p u t s can be used as an up/down counter b y means o f t h e two separate pulse-edge f l a g s f o r CU and CD. 5.1.6 Comparison (relational) operations Comparing for equal to STEP 5 representation Statement Ladder list diagram Original I B 0 IB1 Control system flowchart L IB0 L IB1 ! =F = (21.0 IB1 IB1 Q 1.0 The operand f i r s t s p e c i f i e d i s compared w i t h the subsequent operation i n keeping w i t h the comparison function. The r e s u l t of the comparison i s flagged by c o n d i t i o n codes CC0 and CC1. for I B O = I B l IB 0 IB 1 IB 0 > IB 1 CC1 CC0 0 0 0 1 RL0 1 0 1 0 0 The numerical representation o f the operands i s taken i n t o account, i.e. the contents o f t h e accumulators are interpeted as being f i x e d - p o i n t numbers. A f t e r a comparison f o r equal to, a jump can be made t o a l a b e l (+ 127 words) w i t h the jump operation JZ = (if RLO = 1). ... Comparing for not equal to STEP 5 representat~on Ladder Statement diagram list Original I B 0 IB1 Control system flowchart L 180 L I B 1 > IB 1 0 1 0 1 0 1 0 1 The numerical representation o f the operands i s taken i n t o account, i.e. the contents o f the accumulators are i n t e r p r e t e d as being f i x e d - p o i n t numbers. Following a comparison f o r n o t equal to, a jump can be made t o a l a b e l (+ 127 words) w i t h the jump operation JN = ( i f RLO = 1). ... Comparing for greater than STEP 5 representation /Statement Ladder diagram i Iis t Or~glnal 180 I B I L IB0 L IB1 > F = 81 2 Control system flowchart 1B017J Q1 2 I B ~ c2 Q1 2 ~ IBI o c2 - j ~ a12 Q The numerical r e p r e s e n t a t i o n o f t h e operands i s taken i n t o account, i.e. the con t e n t s o f the accumulators are i n t e r p r e t e d as being f i x e d - p o i n t numbers. The operand f i r s t s p e c i f i e d i s compared w i t h t h e subsequent operand i n keeping w i t h t h e comparison f u n c t i o n . The r e s u l t o f t h e comparison i s flagged by c o n d i t i o n codes CC0 and CC1. A f t e r a comparison f o r g r e a t e r than, a jump can be made t o a l a b e l ( + 127 words) w i t h the jump o p e r a t i o n 3 = ( i f RLO = 1). lc~lc;lRio for 1 IB 0 = IB 1 IB 0 < IB 1 IB 0 > IB 1 ... Comparing for less than STEP 5 representation Ladder Statement diagram \is t Original IB0 I IB1 I Control system flowchart L IBO L IB1 F = 01.4 IB0 - I1B ~ 1 0C 2] 7 k . 4 IB1 - - Q1.4 01.4 The operand f i r s t s p e c i f i e d i s cornpared w i t h the subsequent operand i n keeping w i t h the comparison f u n c t i o n . The r e s u l t o f the comparison i s f l a g g e d by c o n d i t i o n codes CC0 and CC1. for IB 0 = IB 1 IB 0 < IB 1 IB 0 > 1% 1 CC1 0 0 1 CC0 0 RLO 1 1 0 0 0 The numerical r e p r e s e n t a t i o n o f t h e operands i s taken i n t o account, i.e. t h e con t e n t s o f the accumulators a r e i n t e r p r e t e d as being f i x e d - p o i n t numbers. A f t e r comparing f o r l e s s than, a jump can be made t o a l a b e l ( 2 127 words) w i t h the jump o p e r a t i o n JM = ( i f RLO = 1). ... ~ Comparing for greater than or equal to STEP 5 representation Statement Ladder diagram list Original IB0 IB1 Control system flowchart L IB0 L IB1 >=F = Q13 I01 C2 Q 13 The operand f i r s t s p e c i f i e d i s compared w i t h the subsequent operand i n keeping w i t h the comparison function. The r e s u l t of the comparison i s flagged by condition codes CC0 and CC1. CC1 0 0 1 for IB 0 = IB 1 IB 0 < IB 1 IB 0 > IB 1 CC0 0 1 0 RLO 1 0 1 The numerical representation o f the operands i s taken i n t o account, i.e. the contents o f the accumulators are i n t e r p r e t e d as being fixed-pobnt numbers. A f t e r comparison f o r greater than o r equal to, a jump can be made t o a l a b e l (+ 127 words) w i t h the jump operation Jr ( i f RLO = 1 ). Comparing for less than or equal to STEP 5 representation Ladder Statement diagram list Or~ginal 0 IB0 IB1 Control system flowchart L IB0 L IB1 <=F = Q15 IB1 Q Cl1 5 01.5 The operand f i r s t s p e c i f i e d i s compared w i t h the subsequent operand i n keeping w i t h the comparison function. The r e s u l t o f the comparison i s flagged by c o n d i t i o n codes CC0 and CC1. for IB 0 = IB 1 IB 0 < IB 1 IB 0 > IB 1 CC1 0 0 1 CC0 0 1 0 RLO 1 1 0 The numerical representation of. the operands i s taken i n t o account, i.e. the contents o f the accumulators are i n t e r p r e t e d as being fixed-point numbers. After comparing f o r less than or equal to, a jump can be made t o a l a b e l (+ - 127 words) w i t h the jump operation JC = ( i f RLO = 1). ... 5.1.7 Arithmetic operations Arithmetic operations can only be represented in statement l i s t form. They add or s u b t r a c t the contents of accumulators 1 and 2, using the corresponding load operations. Operation Parameters Function + F Add (accu. 1 + accu.2) - F Subtract (accu. 2 - accu. 1) rzGq-=l Example: The two accumulators 1 and 2 can be loaded by two load operations in keeping w i t h the operands of these load operations. The contents of the two accumulators can then be added to each other or one subtracted from the other. Example STL The right-hand byte of d a t a word 85 i s to be subtracted from the number +l27 and the res u l t stored i n the l e f t hand byte of data word 85. L KF +l27 L DR 85 DL 85 127 74 L 1w2 -F +m m--= -(IW2 m IW 1 - IW 2 = Result Explanation -F DR 85 Result 1 L, IW1 T 53 The constant fixed-point number +l27 i s loaded into accumulator 1; a t the same time, the old cont e n t s of accumulator 1 are s h i f t e d into accumulator 2. The right-hand byte of data word 85 i s loaded into accumulator 1 and the f ixed-point number +l27 s h i f t e d into accumulator 2. The contents of accumulator 1 a r e subtracted from those of accumulator 2 and the r e s u l t stored in accumulator 1. The contents of accumulator 1 ( r e s u l t ) are transferred t o the left-hand byte of data ,dord 85. Note : If the number range (-32768 to + 32767) i s exceeded, the r e s u l t of the operation i s undefined ( O V = "1") Other functions 5.1.8 The following operations can only be represented in statement l i s t form. Operation Parameter Stop STP NOP No operation ( a l l bits reset) 0 No operation (all bits set) N O P l 3LD Function 0 to 255 Display construction statemen t The STOP operation i s used i f , f o r example, the programmable c o n t r o l l e r has to e n t e r the Stop s t a t u s in response t o c e r t a i n c r i t i c a l plant s t a t e s or on the occurrence of a hardware f a u l t . The NOPs are used, f o r instance, f o r keeping memory locations f r e e o r overwriting them. The display construction statement def i n e s the subdivision of program sections into segments within a block. 5.2 Supplementary operations Supplementary operations can only be programmed i n FB 1. 5.2.1 Logic operations Operation Description AW D i g i t a l ANDing o f accumula t o r s 1 and 2 OW D i g i t a l ORing o f accumula t o r s 1 and 2. XOW D i g i t a l EXORing o f accumulators 1 and 2. Example STL The hexadecimal number 3F84H i s t o be ANDed w i t h i n p u t word 1 o f inputs I W 1. The r e s u l t i s t o appear i n Output word zero of the outputs (QW 0). L 3F84H Result AW IW 3 L Explanation KH 3F84 ]IN1 AW T QW 0 H The two b i t p a t t e r n s 0101 1110 1000 1011 and 0111 0001 0111 1100 Accumulators 1 and 2 can be loaded by two load operations i n keeping w i t h the operands o f these load operations. The contents o f both accumulators can then be d i g i t a l l y gated. L KM 01...11 L KM 01 are t o be ORed w i t h each other. 0101 1110 1000 1011 T FW 13 0111 0001 0111 1100 Result ...00 The hexadecimal number 3F84 i s loaded i n t o accumulator l ; a t the same time, the o l d contents of accumulator 1 are s h i f t e d i n t o accumulator 2. I n p u t word 1 (IW 1) i s loaded i n t o accumulator 1 and the hexadecimal number s h i f t e d i n t o accumulator 2. The contents accumulator 1 are d i g i t a l l y ANDed w i t h those o f accumulator 2 and the r e s u l t s t o r e d i n accumulator 1. The contents o f accumulator 1 ( r e s u l t ) are t r a n s f e r r e d t o o u t ~ u tword. QW 0. The f i r s t b i t p a t t e r n i s loaded i n t o accumulator 1; a t the same time, the o l d contents o f accumulator 1 are s h i f t e d i n t o accumulator 2. The second b i t p a t t e r n i s loaded i n t o accumulator 1 and the f i r s t b i t p a t t e r n s h i f t e d i n t o accumulator 2. The contents o f accumulator 1 are ORed w i t h those o f accumulator 2 and the r e s u l t stored i n accumulator 1. The contents o f accumulator 1 ( r e s u l t ) are t r a n s f e r r e d t o flagword FW 13. OW I n p u t word I W 0 i s t o be compared w i t h dataword 12 f o r e q u a l i t y . The non-identical b i t s o f the word are t o appear i n o u t p u t word QW 0. L DW 12 DW 12 EA83H I W 0 68C5 Result X C K T Z R $ TQW 0 L IW 0 xcu l Data word DW 12 i s loaded i n t o accumulator 1; a t the same time, the o l d contents of accumulator 1 are s h i f t e d i n t o accumulator 2. I n p u t word I W 0 i s loaded i n t o accumula t o r 1 and data word L DW 12 s h i f t e d i n t o accumulator 2. The contents o f accumulator 1 are EXORed w i t h those o f accumulator 2 and the r e s u l t s t o r e d i n accumulator 1. The contents o f accumulator 1 ( r e s u l t ) are t r a n s f e r r e d t o output word QW 0. 5.2.2 Conversion functions One's complement The value i n accumulator 1 i s converted. The r e s u l t can be processed i n the accumulator. STL Example 5.2.3 Explanation Load data word D W 64 i n t o accumulator 1. The contents o f data word DW 64 are t o be i n v e r t e d b i t by b i t and stored i n data word DW 78. The contents o f data word DW 42 are t o be i n t e r p r e t e d as a f i x e d - p q i n t number and stored i n data word DW 35 w i t h i n v e r t e d sign. I Form the one's complement o f the contents o f accumulat o r 1. The r e s u l t i s i n accumulator 1. Transfer the contents o f accumulator 1 i n t o data word DW 78. L D W 42 Load data word D W 42 i n t o accumulator 1. Form the two's complement o f t h e contents o f accumulator 1. The r e s u l t i s i n accumulator 1. Transfer the contents o f accumulator 1 i n t o data word D W 35. Shift operations Cperation I Description SLW 0 t o 15 Shift left SRW 0 t o 15 Shift right Ij The parameter o f t h i s statement s p e c i f i e s the number o f b i t p o s i t i o n s by which the contents of accumulator 1 are s h i f t e d t o the l e f t (SLW) o r t o the r i g h t (SRW). Any b i t p o s i t i o n s t h a t become f r e e when s h i f t i n g are padded w i t h zeros. Example STL Explanation The l a s t f o u r b i t s o f the hexadecimal number 14AFH i n data word DW 1 are t o be truncated and the new hexadecimal number D14AH r e s u l t i n g stored i n .data word DW 3. L D W 1 Load data word 1 i n t o accumulator 1. SR W 4 S h i f t the contents o f accumulator 1 f o u r b i t posit i o n s t o the r i g h t . The b i t p o s i t i o n s t h a t become f r e e when s h i f t i n g are padded w i t h zeros. T r a n s f e r the contents o f accumulator 1 t o data word DW 3. T DW 3 Note : S h i f t operations are unconditional operations. The l a s t b i t s h i f t e d o u t can be examined by means o f a jump operation. A jump can be made w i t h JZ i f the b i t i s "0" and w i t h JN o r JP i f the b i t i s "1". 5.2.4 Jump operations The jump d e s t i n a t i o n f o r unconditional and c o n d i t i o n a l jumps i s s p e c i f i e d as a symbolic address (max. 4 characters). I n the case o f the P G 605U/ and PG 615U programmers, jump l a b e l s MO... M99 can be assigned. The symbolic parameter o f the jump statement i s i d e n t i c a l t o the symbolic address o f the statement t o which t h e jump i s made. When programming, make sure t h a t the absolute jump displacement does n o t exceed +l27 words and note t h a t a STEP 5 statement may c o n s i s t o f more than one word. Operatian JU = Description Unconditional jump I ] The uncondi t i o n a l jump iS executed independentl y o f any conditions. JC = 1-1 Conditional jump The condi t i o n a l jump i s executed i f the RLO i s "l". If the r e s u l t o f the l o g i c o p e r a t i o n i s "ON, the jump i s n o t executed and t h e RLO i s s e t t o "l" JZ = 0 Jumps over segment boundaries are n o t permissible. T h i s jump i s executed i f t h e contents o f t h e accumulator are zero. I f the contents are n o t zero, t h e jump i s n o t executed. The RLO i s n o t changed. Jump 'if contents o f accumulator n o t zero. A l l jump operations ( w i t h the exception o f JU) depend on t h e RLO and the cond i t i o n codes i n the processor o f the programmable c o n t r o l l e r . JN Jump i f contents o f accumulator zero. 1-1 T h i s jump i s executed i f the contents o f t h e accumulator are ' n o t zero. I f the contents a r e zero, t h e jump i s n o t executed. The RLO i s n o t changed. JP = 1- Jump i f contents o f accumulator p o s i t i v e . The jump i s executed i f t h e contents of the accumul a t o r are greater than zero. If the cont e n t s o f the accumulator are zero o r l e s s than zero, the jump i s n o t executed. The RLO i s n o t changed. JM = 1- Jump i f contents o f accumulator negative. T h i s jump i s executed i f the contents o f t h e accumulator are l e s s than zero. I f the contents are zero o r greater than zero, t h e jump i s n o t executed. The RLO i s n o t changed. JO = I Jump on o v e r f l o w T h i s jump i s executed when an overflow occurs. I f there i s no overflow, t h e jump i s n o t executed. The RLO i s n o t changed. Enter symbolic address (max. 4 characters) 5.20 Example STL Explanation I f none o f the i n p u t s o f i n p u t word I W 1 i s set, a jump i s made t o l a b e l "AN 1" AN0 : I W I n p u t word I W 1 i s loaded i n t o accumulator 1. Ifthe contents o f accumulator 1 a r e equal t o zero, a jump i s executed t o l a b e l "AN l", otherwise t h e n e x t s t a t e rnent ( A I 1.0) i s executed. I f the i n p u t word I W 1 and output word 'QW 0 are n o t i d e n t i c a l , a jump i s made back t o l a b e l "AN 0". IfI W 1 and QW 3 are ident i c a l , I W 1 i s compared w i t h data word DW 12. I f I W 1 i s greater o r smaller than DW 12, a jump i s made t o the "Destination" label. JZ.ANII :A IW AN]. :L IW1 :L QW :XW m :JP=ANO :L :L : IW1 DW12 F Comparison o f i n p u t word I W 1 and output word QW3. If the two words are n o t i d e n t i c a l , i n d i v i d u a l b i t s are s e t i n accumulator 1. I f the contents o f accumulator 1 are n o t zero, a jump i s made back t o the "AN 0" l a b e l , otherwise the next statements are executed. I n p u t word I data word W than. If I W than DW 12, W 1 i s compared w i t h 12 f o r g r e a t e r o r l e s s 1 i s greater o r less t h e RLO i s s e t t o "1". 0 :JB=Destination a jump i s made t o the If RLO = "l", "Destination" l a b e l . If RLO = "O", executed. Desti-:A nation 112.2 . t h e n e x t statement i s Condition codes 5.2.5 The processor o f the SIMATIC S5-101U programable c o n t r o l l e r has three cond i t i o n codes: o CC 1 Value p o s i t i v e o CC 0 Value negative &erflow o OVF The condition codes are affected- by comparison operations, a r i t h m e t i c operations, s h i f t operations and a number o f conversion operations. Generating condition codes i n connection w i t h comparison operations The execution o f comparison operations r e s u l t s i n the s e t t i n g o f c o n d i t i o n codes CC 0 and CC l.The overflow b i t i s not affected. The two operands p a r t i c i p a t i n g i n a comparison are defined as follows: Example :L DW20 ( 1 s t operand) :L DW21 (2nd operand) :!=F (comparison operation) I n t h i s example, data word D W 20 i s the 1 s t operand and data word DW 21 the 2nd operand. Condition codes the 1 s t operand, the 2nd operand i s : Jump operations The f o l l o w i n g jump operations are executed : I CC l CC 0 Equal - 10 I Less 0 0 1 Greater IJZ 1 JN, JM 0 JN, JP Note: Comparison operations a f f e c t the r e s u l t o f the l o g i c operation. If the c o n d i t i o n i s satisfied, the RLO i s "l". In this way, the conditional jump operation JB can be w r i t t e n a f t e r a comparison operation. Generating c o n d i t i o n codes i n connection w i t h d i g i t a l logic. D i g i t a l l o g i c operations r e s u l t i n the s e t t i n g o f c o n d i t i o n codes CC 0 and CC 1. The overflow b i t i s n o t affected. S e t t i n g o f the c o n d i t i o n codes depends on the contents o f the accumulator a f t e r the operation has been executed. Condition codes The contents o f the accumulator are: The f o l l o w i n g jump opera t i o n s are executed : CC1 Condition Icodes The r e s u l t o f the arithmetic operation i s : < -32768 -32768 t o 1 I0 - lI O ( 1 I Not zero JN, JP Generating c o n d i t i o n codes i n connection w i t h s h i f t operations. The execution o f s h i f t operations r e s u l t s i n the s e t t i n g o f CC 0 and CC 1. The overflow b i t i s n o t affected. S e t t i n g o f the c o n d i t i o n codes depends on the status o f the l a s t b i t pushed out. Jump operations codes The.value o f the last b i t shifted out i s : now ~101 The f o l l o w i n g jump operat i o n s are I 0 l l 0 0 JZ I JN, JP Generating c o n d i t i o n codes i n connection w i t h conversion functions. Formation o f the two's complement (CSW) a f f e c t s a l l c o n d i t i o n codes. This depends on the r e s u l t o f the conversion operation: I Condition I codes The r e s u l t a f t e r the conversion operation i s : 1Jumti lop&ations The f o l l o w i n g jump operat i o n s are executed : Jump operations JN, JP, JO The f o l l o w i n g jump operations are executed : JN, JP 1 JN, JP, JO I O 1 JN. JM *) Result o f the arithmetic operation: -32768 +32768 Cc0 Zero (0000) Generating c o n d i t i o n codes i n connection with arithmetic operations. Arithmetic operations r e s u l t i n the s e t t i n g o f a l l condition codes. This depends i n t u r n on the contents o f the accumulator ( t h e r e s u l t o f the a r i t h metic operation). Generating c o n d i t i o n codes i n connection w i t h f ixed-point arithmetic operation: Jump operations JN. JM JN. JM, JO *) Result o f conversion o f KH = 0000 Notei: The jump statement and jump d e s t i n a t i o n must be i n the same segment. Only one symbolic address i s permissible f o r branch destinations i n each segment. 6. Operation set Binary l o g i c o p e r a t i o n s Up t o 6 bracketing l e v e l s :an he progranmed. S e t t i n g h e s e t t i n g operations Opera- Parameter .E, Machine code Dep- Aff- Condition (hexadecimal) ends ects codes Word 0 on RLO affected C) CC1 :.E Function C ) . ti on B0 I B1 1 Word 1 1 B2 1 B3 X c rT( 0 E .P RLO = VI "1 I CC0 I OV S I 0.0 t o 2.3 3.0 t o 5.3 DO 00 - - Y Y - - 70 Setaninputto"ln ( i n the' ( P I I ) S Q 0.0 t o 1.3 3.0 t o 3.3 DO 80 - - Y Y - - 70 Setanoutputto"1" ( i n the PIO) S F 0.0t063.7 90 00 - - Y Y - - 74 Setaflag R I 0.0 t o 2.3 3.0 t o 5.3 F0 00 - - Y Y - - 70 Reset an i n p u t t o "0" ( i n the P I I ) R Q 0.0 t o 1.3 2.0 t o 3.3 F0 80 - - Y Y - - 70 Reset an o u t p u t t o "0" ( i n t h e PIO) Timer and counter f u n c t i o n s L I I I I I + R e l a t i v e address I I I I I I I Load and t r a n s f e r operations Opera- Parameter Maschine code Dep- Aff- Condition (hexadecimal ) ends ects codes Word 0 on RLO affected - .-I Sg Function & l . tion B0 I B1 I Word 1 ( B2 I B3 RLO -eel *03 1 .v VI IOV a., Load an.input b y t e ( f r o m the P I I ) Load an i n p u t word ( f r o m the PIO) Load an output b y t e ( f r o m the PIO) Load an o u t p u t word ( f r o m t h e PIO) Load a f l a q b y t e Load a f l a q word Load data ( l e f t - h a n d b y t e ) Load d a t a ( r i g h t - h a n d b y t e ) Load data (word) Load a time Load a count Load a p e r i p h e r a l b y t e o f the inputs I + + R e l a t i v e address Load a time (BCD) Load a count (BCD) Load and transfer operations (cont.) Operation T IB Parameter 0 to 5 +F -F Maschine code (hexadecimal) Word 1 Word 0 B0 B1 B2 B3 48 00 - - 79 00 00 - - - - 59 Depends on RLO Affects RL 0 N N N N N N Condition codes affected CC1 CC0 OV - - 55 Transfer to an input byte (in the PII) Y Y Y Y 58 54 Fixed-pointaddition Fixed-point subtraction Y Y .* . c E 0 m .- Function X W U 1- !.E Block calls Operation BE BEC BEU Parameter Maschine code (hexadecimal) Word 0 Word 1 B0 B1 B2 B3 65 05 65 00 00 01 Depends on RLO Affects RL 0 Condition codes affected C C ~ 'CCO ' O V N Y - - Y Y Y - - Y - - 'Z 7 Function X a 0 E -U *I 3 4' U :.E 42 46 42 Block end Block end conditional Block end unconditional Other o p e r a t i o n s + Opera- Parameter ti on Machine code Dep- Aff- Condition (hexadecimal ) ends ects codes Word 0 Word 1 on B0 B1 B2 RLO B3 ! +, . X c 0 m E .F affected RL 0 CC1 Function *1 3 "7 U I CC0 OV 2.5 NOP 0 00 00 N N - - 40 No o p e r a t i o n ( a l l b i t s reset) NOP 1 FF FF N N - - 40 No o p e r a t i o n ( a l l b i t s set) 70 03 N N - - 44 STOP STP Segment end f o r proqramminq i n statement l i s t I 00 10 BLD N - - - 40 Statement f o r c o n s t r u c t i n g d i s p l a y s i n LAD f o r m on the programmer I L o g i c o p e r a t i o n s (word mode) (supplementary o p e r a t i o n s ) AW 41 00 N N X X OW 49 00 N N X X XOW 51 00 X X I Conversion o p e r a t i o n s (supplementary o p e r a t i o n s ) 1 Opera- I Parameter ti on I N 1 Machine code I Dep- I Aff- (hexadecimal) ends ects codes on RL 0 affected Word 0 Word 1 B0 B1 B2 B3 RLO CFW 01 00 - - N N CSW 09 00 - - N N I I Condition CC1 ANDing o f accumulators 1 and 2 55 ORing o f accumulators 1 and 2 55 Exclusive-ORing o f accumulators 1 and 2 l Function 3, Y X . - OV :.z ~ - - 42 Formation o f o n e ' s complement (fixed point) Y Y 62 Formation o f t w o ' s complement (fixed point) I S h i f t o p e r a t i o n s (supplementary o p e r a t i o n s ) Opera- Parameter tion I .-S 2 + 3 1 U m CC0 Y 55 - Machine code Dep- Aff- Condition (hexadecimal ) ends ects codes on RL 0 affected .E+ . Function X c 0 m E .F SLW 0 t o 15 SIW 0 t o 15 Word 0 Word 1 B0 B2 B1 61 69 B3 RLO CC1 11 "7 U I OV CC0 ;.E 00 - - N N Y Y - 49 S h i f t l e f t (16 b i t s ) 00 - - N N Y Y - 47 S h i f t r i g h t (16 b i t s ) 1 + Nurnh~r o f s h i f t s 10 X Number n f s h i f t s Jump o p e r a t i o n s (supplementary o p e r a t i o n s ) I Operation l Parameter I Dep- 1 Aff- (hexadecimal) ends ects codes Word 0 Word 1 on RL 0 a f f ec t e d B1 B2 B3 RLO - N - Y I Machine code B0 I I Condition .g- I Function W X. SP + 3 1 U V1 .P CC0 OV N - 55 U n c o n d i t i o n a l jump Y - - 62 Conditionaljump (Jump c o n d i t i o n : RLO) CC1 ' z.5 JU = Symbolic address 2D 00 JC = Symbolic address FA 00 - JZ = Symbolic address 45 00 - - N N - - 62 C o n d i t i o n a l jump (Jump c o n d i t i o n : CC 1, CC 0 ) JN = Symbolic address 35 00 - - N N - - 62 C o n d i t i o n a l jump (Jump c o n d i t i o n : CC 1, CC 0 ) JP = Symbolic address 15 00 - - N N - - 62 C o n d i t i o n a l jump (Jump c o n d i t i o n : CC 1, CC 0 ) JM = Symbolic address 25 00 - - N N - - 62 C o n d i t i o n a l jump (Jump c o n d i t i o n : CC 1, CC 0 ) JO = SymbolicaddressOD 00 - - N N - - 57 C o n d i t i o n a l jump ( J u m p rendition: QV) I + Jump d i s p l a c e m e n t l 1 SIEMENS AKTIENGESELLSCHAFT Order No. EWA 4NEB 810 2119-02c Printed in the Federal Republic o f Germany