SIEMENS Programmable Controller Order No. GWA 4NEB 810 0221 -02 Proaramina Instructions Fig. 1 S5-105R-A/B with 605R programmer Contents : Page Programming Formal rules for structuring a program Binary program elements NB and NC contacts Outputs (coils) and flags ( internal relay equivalents) Latching and unlatching The complex program elements TimerS Counters Impulse relay (transitionsensitive pulse) ~uips Sequence control systems/ sequence cascades (drum sequencers) 2. 2.1 2.2 Program generation with the 105R PC 2.1 Program input and correction 2.1 Example of program generation 2.2 Contents : Program test Search function Signal status display Forcing Permanent forc?ng Single scan in HOLD mode Storing the program Storfng the program on an EEPROgvt submodule Storing the program on an EPROM submodule Duplication o f programs Operation set Binary operations Complex operations Page Programming 1. The 105R programmable controller uses ladder diagrams (LAD) for programming. The LAD is a graphic method of representing the automation problem using circuit di agrarn symbols (American standard). Circuit diagram Ladder diagram The ladder diagram is a symbolic representation of a circuit diagram. Points with the same potential are described by means of nodes. The ladder diagram is entered directly into the programmer. . I. .l. I. I . .60--5 0 I .I. . . Q0.5 . -Room for :Program description . . .I_ .I. .I. _I. .I. .I_ .I. .I. .I. I . .I. .I. .I. .l. I . .I. .I. .I. .I. * -I . -. I - - l . I . ---- - - :l+$--- I . . I .I. - L I (I ) (-+h - - - - - -- .I. - - I .I. .I. p - I - - . + _ --- I Fig. 2 Representation of the LAD on a programming form for keying directly into the programmer -- 1.1 Formal rules for structuring a program The program of the 105R PC may consist of a maximum of 64 program blocks (PBs). These are assigned numbers from 0 to 63 and can be entered in any order. They are processed in the 105R PC in the order in which they are stored in the memory. Fig. 3 Processing of the PBs A program block may consist of up to 16 rungs. Each PB can be assigned 15 different nodes. A rung may contain 7 contact elements (scans) 8 nodes * (vertical interconnections) 1 output element (assignment, always in column 8) Fig. 4 Structural framework of a program block * Input on programmer: Node 0 .. . ( hexadecimal representation) 14, display on programmer: fl ... E When two rungs are linked by means of nodes, it must be remembered that S i g n a 1 f l o w is o n l y p o s s i b l e f r o m l e f t t o r i g h t (diode effect of the contact elements). This must be taken particularly into account when adding rungs to PBs. Example: Rung 14 can be added to the given program section, rungs 5 and 6. By rearranging the rungs, the correct signal flow from left to right becomes visible. The apparently illegal insertion of rung 14 is also possible, as the following rearrangement is possible by shifting rung 5 from node 1: I t i s n o t possible, however, t o add t h e f o l l o w i n g node 14: m A f t e r pressing the key on t h e programmer, t h e program e n t e r e d i s checked. E r r o r message E l appears, i n d i c a t i n g t h a t t h e r e are more than 8 program elements i n one rung. When t h e block i s checked i n t e r n a l l y , t h e programmer attempts t o m a i n t a i n t h e p r e s c r i b e d s i g n a l f l o w from l e f t t o r i g h t . Rung 6 i s t h e r e f o r e s h i f t e d t o t h e r i g h t from node 3, as i n t h e p r e v i o u s example, t o make p o s s i b l e t h e i n s e r t i o n o f r u n g 14: T h i s r e s u l t s i n a rung o v e r f l o w as can be seen f r o m t h e programming form. T h i s e r r o r i s recognised by t h e programmer and an e r r o r message appears. The rungs are o n l y rearranged i n t e r n a l l y i n t h e programmer. T h i s rearrangement i s n o t displayed on t h e programmer! 1.2 Binary program elements 1.2.1 NO and NC contacts In contrast to real NO and NC contactors in hard-wired circuits through which a control current generally flows, the sensor signals are scanned in programmable controller systems for their signal state 0 or 1. The switching state of the program element is obtained by scanning the signal state. This makes it possible for the opening or closing function to be simulated by the program. Example Input LED bright, Signal state of input is '1' i.e. I@.@= ' l ' Sensor signal from an energized NO contact or from a non-energized NC contact Input/output module at location 0 State of the program element if - scanned for ' 1 ' signal: Energized: signal flow is possible - scanned for ' 0 ' signal: Not energized: no signal flow possible 1.2.2 Outputs (coils) and flags (internal relay equivalents) Signal s t a t e s can be assigned t o o u t p u t s and f l a g s b y t h e program. They can be scanned l i k e c o n t a c t s , e.g. E Q(b.6, 31E F3.5. The s i g n a l s t a t e s o f t h e o u t p u t s a r e t r a n s f e r r e d t o t h e o u t p u t modules Example Output LED b r i g h t Signal s t a t e o f o u t p u t i s '1' i.e. Q@.@ = '1' Relay i s energized I n p u t / o u t p u t module a t location 0 I f there i s signal flow v i a o u t p u t Qfl.7 i s '1' Ig.0, Ift h e r e i s s i g n a l f l o w v i a 10.0, t h e negated o u t p u t Qfl.7 i s ' 0 ' I f t h e r e i s no s i g n a l f l o w v i a t h e negated o u t p u t Q0.7 i s '1' Ig.0, 1.2.3 Latching and unlatching Outputs and flags can be 'latched' and 'unlatched', i.e. the signal state assigned to them is latched until an inverse state is assigned. Example Contactor with latching circuit When sensor 16.g is actuated, 40.7 is set to '1' and latched. It can be unlatched by actuating sensor 10.1. Contact K1 is not required due to the latching feature. Scanning non-existent Non-existent * inputs always results in '0' signal. * outputs can be used in the program as (non-retentive) flags. *Non-existent means - either the relevant 1/0 module locations are not occupied - or the configuration with 5 input/3 output modules does not make use of the full address complement of 64 outputs (see also section 5.1). 1.3 The complex program elements The operations o f a l l program elements are l i s t e d i n Section 5. Timers, counters, impulse r e 1ays, jump f u n c t i o n s and sequence cascades (drum sequencers) are termed 'complex f u n c t i o n s ' as f u r t h e r data are assigned t o them i n a d d i t i o n t o t h e s i g n a l s t a t e s ' 0 ' and '1'. S e l e c t i n g one o f the above f u n c t i o n s on the programmer generates a ' b o x ' i n t o which t h e s p e c i f i c data f o r t h e r e l e v a n t f u n c t i o n are ' e n t e r e d ' i n t h e n e x t programming steps. 1.3.1 Timers The operations o f a l l program elements are l i s t e d i n Section 5. A timer i s c o n t r o l l e d v i a t h e START and HOLD i n p u t s . A f t e r t h e s e t time has elapsed, output Q o f t h e t i m e r changes f r o m ' 0 ' t o 'l', and output f r o m '1' t o ' 0 ' . 0 Starting the timer: The t i m e r s t a r t s when t h e r e i s a s i g n a l change from ' 0 ' t o '1' a t t h e START i n p u t . Holding t h e t i m e r : When t h e s i g n a l changes from ' 0 ' t o '1' a t t h e HOLD input, t h e t i m e r i s stopped u n t i l a zero s i g n a l appears a t t h e HOLD i n p u t . Resetting t h e t i m e r : I f t h e r e i s a ' 0 ' s i g n a l a t t h e START i n p u t , t h e t i m e r i s r e s e t t o t h e i n i t i a l value. Scanning t h e t i m e r : The a c t u a l s t a t e o f t h e t i m e r can be seen v i a o u t p u t s Q o r q o r scanned v i a a TX contact element. Entering t h e time: The d e s i r e d time can be entered as - a constant (CON) - a r e g i s t e r time (RT) The constant i s entered when programming. The r e g i s t e r time can be entered a f t e r program generat i o n o r i t can also be m o d i f i e d i n RUN mode. I f no value i s entered, t h e maximum time, i.e. 999 minutes, i s s t o r e d i n t h e r e g i s t e r a f t e r a general r e s e t o f t h e 105R PC. Entering the time code: The desired time is entered in the form A.B. The letter B stands for time base and the A for a constant multiplier. B Example = 0 for time base 10 ms 1 for time base 100 ms 2 for time base 1 ms 3 for time base 1 min If 10.2 is entered, the time set is 10 seconds. X 1S = 10 Timer tolerances: Each timer has a maximum inaccuracy of the order of the time base selected. It is therefore advisable to use the smallest time base possible. Example: Run time 8 seconds Representation 8.2 80.1 800.0 seconds max. error 1 max. error 0.1 seconds max. error 0.01 seconds Formal rules for using timers in the program rimers can be i n c o r p o r a t e d i n t o a rung l i k e c o n t a c t s . Scanning o r c o n t i n u a t i o n o f t h e o u t p u t i n t h e same rung i s n o t mandatory; i t i s t h e r e f o r e p e r m i s s i b l e t o scan a t i m e r as a c o n t a c t : A t i m e r can be addressed v i a t h e START (S) and HOLD ( H ) i n p u t s : The t i m e r i s entered i n t h e "START TIMER l" f u n c t i o n box. o f t h e t i m e r are a v a i l a b l e f o r b o t h t h e START TIMER and HOLD Output Q o r TIMER f u n c t i o n boxes. - The o u t p u t o f a t i m e r must n o t be brought back t o t h e START i n p u t . - When t h e r e i s a change from RUN t o STOP and HOLD, t h e times are stopped. - When changing over from STOP t o HOLD o r RUN t h e stopped t i m e r i s r e s e t . - When changing from HOLD t o RUN ( o n l y p o s s i b l e w i t h programmer), t h e t i m e r continues t o r u n from t h e p o i n t a t which i t was stopped. Typical examples 1. "ON" delay, not latched: Lamp a.6 only lights up when contact 10.1 has been closed for longer than 1 second. If there i s a ' 1 ' a t input 10.1, timer T1 i s started. After 1 second, T 1 has elapsed and output Q becomes ' 1 ' . A '0' signal a t 1g.1 resets the timer . If input I@.l'changes from ' 1 ' t o ' 0 ' while the timer i s running, output Q stays unchanged a t '0' and the timer i s reset once more. 2. 'OFF' d e l a y : Lamp Qg.6 i s b r i g h t f o r 10 minutes a f t e r c o n t a c t Ia.1 has opened. I f t h e r e i s a =signal a t i n p u t 1d.1, negated i n p u t Ig.1 i s ' 0 ' . A '1' s i g n a l a t i n p u t Ig.1 l a t c h e s o u t p u t Qg.6 t o '1'. I f t h e s i g n a l s t a t e o f i n p u t changes o u t p u t Qg.6 i s l a t c h e d t o '1'. Ift h e s i g n a l s t a t e o f i n p u t Ifl.1 now changes f r o m ' 0 ' t o ' l ' , t i m e r T4 i s s t a r t e d w i t h a t i m e o f 10 minutes. When t h e t i m e has e l a sed and i f t h e r e i s a '1' s i g n a l a t I .l, o u t p u t Qfl.6 i s set t o '0'. I f t h e s i g n a l s t a t e of i n p u t changes f r o m '1' t o ' 0 ' w h i l e t h e t i m e r i s s t i l l running, o u t p u t Qg.6 does n o t change i t s s i g n a l s t a t u s and remains m 9- m '1 ' 3. Clock p u l s e generator A f t e r c o n t a c t 1d.3 i s energized, o u t p u t s ~ g . 6 and ~ g . 7 a r e s e t a l t e r n a t e l y w i t h s e l e c t a b l e t i m e constants. When c o n t a c t Ig.3 has a '1' s i g n a l , To i s s t a r t e d . A f t e r two seconds, Tfl s e t s o u t p u t Q8.6 and s i m u l t a n e o u s l y s t a r t s T1. A f t e r one second, T$ i s r e s e t by T1. T h i s r e s e t s Q0.6 and then To can s t a r t again. 1.3.2 Counters The operations o f a l l program elements are l i s t e d i n Section 5. A counter i s d r i v e n v i a t h e SET, COUNT UP and COUNT DOWN inputs. Output Q o f b o t h elements changes from ' 0 ' t o '1' when t h e r e l e v a n t f i n a l count has been reached. S e t t i n g t h e counter: The counter i s enabled and i s s e t t o t h e i n i t i a l count when t h e s i g n a l changes from ' 0 ' t o '1' a t t h e s e t i n p u t . Counting up: Each time t h e s i g n a l changes from ' 0 ' t o '1' a t t h e COUNT UP i n p u t , t h e count i s incremented by 1. Counting down: Each t i m e t h e s i g n a l changes from ' 0 ' t o '1' a t t h e COUNT DOWN input, t h e count i s decremented by 1. Scanning t h e counter: The c u r r e n t counter s t a t e can be ascertained v i a t h e o u t a t t h e COUNT UP and COUNT DOWN counter elements. puts Q o r E n t e r i n g counts: The i n i t i a l and f i n a l counts o f t h e counter can be entered as - a constant (CON) - a r e g i s t e r value f o r data (DR) The constants are entered when generating t h e program. The r e g i s t e r values can be entered a f t e r program generation o r can a l s o be m o d i f i e d i n t h e RUN mode. I f no value has been entered, t h e h i g h e s t d a t a value, i.e. 32767, i s s t o r e d i n t h e r e g i s t e r a f t e r a general r e s e t o f t h e 105R PC. Counting range: 0 t o 32767 Formal rules for using counters in the program Counters can be i n c o r p o r a t e d i n t o a r u n g l i k e c o n t a c t s . Scanning Q r c o n t i n u a t i o n o f t h e o u t p u t i n t h e same r u n i s n o t mandatory; t h e r e f o r e a l s o p o s s i b l e t o scan t h e c o u n t e r as a c o n t a c t : it i s Q0.6 becomes ' l ' , i f counter C0 has reached t h e lower l i m i t . A c o u n t e r can be addressed v i a t h e SET (S), COUNT UP (CU) and COUNT DOWN (CD) inputs: The count values are entered i n f u n c t i o n boxes: I n i t i a l count (here: 99) SET (S) Upper l i m i t (here: 199) COUNT UP (CU) COUNT DOWN (CD) Lower l i m i t (here: 0) Outputs Q and Q o f t h e counter are a v a i l a b l e on t h e COUNT UP and COUNT DOWN f u n c t i o n boxes. - The c u r r e n t count i s r e t a i n e d when changing over from RUN t o STOP o r HOLD. When changing from STOP t o HOLD o r RUN, t h e c u r r e n t count and o u t p u t Q of t h e counter are set t o 0. - Only when a rung w i t h START COUNTER i s reached i s t h e i n i t i a l count o f t h e counter entered. - When s w i t c h i n g from HOLD t o RUN ( o n l y p o s s i b l e w i t h programmer), t h e c u r r e n t count i s r e t a i n e d Example: Three-to-one frequency s c a l e r A f t e r enabling v i a 10.2, t h e lamp 40.6 l i g h t s up a t every t h i r d p u l s e a t 10.1. The s c a l i n g r a t i o i s s p e c i f i e d by t h e i n i t i a l value i n t h e START counti n g element: Binary scaler: CON = 2 10:l scaler: CON = 10 1.3.3 Impulse relay (transition-sensitive pulse) The operations of all program elements are listed in Section 5. An impulse relay reacts to a change of signal from ' 0 ' to '1' at the START input by producing a pulse at the output. Starting an impulse relay: When the signal changes from ' 0 ' to '1' at the START input, output 0 is set to 'l'. Pulse duration: If during cyclic program processing a rung is reached which contains the complex impulse relay function, output Q is set from '1' to ' 0 ' . The signal state at the START input is of no consequence. Scanning the impulse relay: The current state of the impulse relay can be ascertained via outputs Q or Q or scanned via a contact element. Resetting the impulse relay: When the signal changes from '1' to ' 0 ' at the START input, the impulse relay is prepared for a new pulse. Formal rules for using impulse relays in the program Impulse r e l a y s can be incorporated i n a rung i n t h e same way as c o n t a c t s . Scanning o r c o n t i n u a t i o n of t h e o u t p u t i n t h e same rung i s n o t mandatory; i t i s t h e r e f o r e a l s o p o s s i b l e t o scan t h e impulse r e l a y as a c o n t a c t . An impulse r e l a y i s o n l y c o n t r o l l e d v i a t h e START i n p u t . Pulse d u r a t i o n L ~ r o ~ r a m t' sa r t I START P fl -- Q, U X U + I f t h e impulse r e l a y i s scanned once o n l y i n t h e program, t h e o u t p u t p u l s e l a s t s f o r t h e l e n g t h o f one c y c l e . I End o f program I iI START input I Beginning of program START P0 I The n e x t t i m e a P0 i s scanned, Q becomes ' 0 ' again. S i g n a l s t a t e '1' a p p l i e s o n l y f o r t h e t i m e between t h e two P @ operations. Program end T y p i c a l examples: 1. P o s i t i v e edge e v a l u a t i o n . I f t h e s i g n a l changes f r o m ' 0 ' t o '1' a t t h e START i n p u t o f P I , Q1.6 i s s e t t o 'l'. I f 11.0 changes t o ' 0 ' , Q1.6 i s r e s e t . G! output IofPI 2. N e g a t i v e edge e v a l u a t i o n When t h e s i g n a l a t t h e START i n p u t changes f r o m '1' t o ' 0 ' , f l a g F1.7 i s s e t . 1 1 tcycle=cycle time +~:j I; Scanning for 0 signal I tcyc~e=cycletime / - tcyclej - l 1.3.4 Jumps The o p e r a t i o n s o f a l l program elements are l i s t e d i n Section 5. The jump f u n c t i o n makes it p o s s i b l e t o s k i p one or more program blocks. A jump can be made from anywhere w i t h i n a program block; t h e jump d e s t i n a t i o n i s always t h e s t a r t o f a program block.* Jump c o n d i t i o n : I f t h e i n p u t o f t h e jump f u n c t i o n has a '1' s i g n a l , a jump i s executed. I f t h e i n p u t has a ' 0 ' s i g n a l , t h e f o l l o w i n g program i s processed. Jump d e s t i n a t i o n : T h e d e s t i n a t i o n can be s p e c i f i e d as - a constant - a r e g i s t e r s t o r e d value f o r data (DR) The constants are entered when generating t h e program. The stored values can be entered a f t e r program g e n e r a t i o n o r can a l s o be m o d i f i e d i n RUN mode. I f no value i s entered, t h e h i g h e s t data value, i.e. 32767, i s s t o r e d i n t h e r e g i s t e r a f t e r a general r e s e t o f t h e 105R PC. The 105R PC does n o t s t a r t because o f t h e e r r o r DR X TOO LARGE. Jump range: 0 t o 63 The t a r g e t program b l o c k s must be a v a i l a b l e i n t h e program. Jump d i r e c t i o n : Jumps are p e r m i s s i b l e b o t h forwards and backwards. 1 wards as t h e 105R PC otherwise e n t e r s t h e STOP s t a t e owi n g t o t h e scan t i m e beinq exceeded. Formal rules for using jump functions in the program Jump f u n c t i o n s complete a rung. They have no output. U n c o n d i t i o n a l jump Whenever t h e program reaches t h e rung, a jump takes place t o program b l o c k 13. C o n d i t i o n a l jump The jump i s o n l y executed i f 1g.O and 10.1 have a '1' s i g n a l . Ifone o f t h e two i n p u t s has a ' 0 ' s i g n a l , t h e f o l l o w i n g program i s processed ( i n t h e example: l a t c h i n g t h e o u t put) * see a l s o page 1.23 1.19 1.3.5 Sequence control systemslsequence cascades (drum sequencers) SZalLt The o p e r a t i o n s o f a l l program elements are l i s t e d i n Section 5. 4 S t e p enabling condi.tion 1 Step U A sequence cascade o r drum sequencer has a maximum o f e i g h t steps. Dependi n g on t h e s t e p e n a b l i n g c o n d i t i o n s , these a r e r u n through one a f t e r t h e o t h e r . A s t e p f l a g i s assigned t o each step. Only one s t e p i s a c t i v a t e d a t a time. l1 # 7SZep 1 Step 2 l1 End S t a r t i n g a sequence cascade: When t h e s i g n a l changes f r o m ' 0 ' t o '1' a t a START i n p u t , t h e sequence cascade i s enabled. Stopping a sequence cascade: When t h e s i g n a l a t t h e HOLD i n p u t changes f r o m ' 0 ' t o 'l', t h e sequence cascade i s stopped. Scanning t h e sequence cascade: When t h e l a s t s t o p has been reached, t h e sequence cascade o u t p u t assumes t h e '1' s t a t e . Resetting: When t h e s i g n a l s t a t e a t t h e START i n p u t changes f r o m '1' t o ' O n , t h e sequence cascade i s r e s e t . E n t e r i n g t h e number o f steps: The number o f steps can be e n t e r e d as - a c o n s t a n t (CON) - a r e g i s t e r v a l u e f o r d a t a (DR) The c o n s t a n t s are e n t e r e d when g e n e r a t i n g t h e program. The r e g i s t e r values can be e n t e r e d a f t e r gen e r a t i n g t h e program o r can be m o d i f i e d i n RUN mode. I f no v a l u e i s entered, t h e h i g h e s t data value, i.e. 32767, i s s t o r e d i n t h e r e g i s t e r a f t e r a general r e s e t o f t h e 105R PC. The 105R PC does n o t s t a r t because o f t h e error DR X TOO LARGE. < > Step numbers: (The maximum number o f s t e p s can be i n c r e a s e d by c o n n e c t i n g sequence cascades i n s e r i e s ) . Formal rules for using sequence cascades in the program Sequence cascades can be i n c o r p o r a t e d i n t o a rung l i k e c o n t a c t s Scanning o r c o n t i n u a t i o n o f t h e o u t p u t i n t h e same rung i s n o t mandatory; i t i s t h e r e f o r e p o s s i b l e t o scan t h e sequence cascade as a c o n t a c t . A sequence cascade can be addressed v i a t h e START and HOLD i n p u t s . The h i g h e s t s t e p number-is entered i n t h e 'START' f u n c t i o n box o f t h e sequence cascade. Outputs Q and Q are a v a i l a b l e on b o t h f u n c t i o n boxes. Programming a sequence cascade The programming diagram ( r i g h t ) i s advisable t o s e v e r a l program sequence shown i n t h e must be adhered t o . I t d i v i d e t h e program i n t o blocks f o r c l a r i t y . ConX4ai? hec.tian: STARTIHOLD A quence cah cade 6 Command oLl/tp& sedan Step enabling conditions I n t h e f i r s t p a r t o f t h e program t h e e n a b l i n g c o n d i t i o n s f o r t h e step f l a g s a r e evaluated. Step f l a g Sequence cascade D@ Step f l a g f o r step O Fig. 5 Enabling c o n d i t i o n s f o r 7 step f l a g s o f sequence cascade DQ Fig. 6 C a l l i n g up a sequence cascade i n t h e program Control section I n t h e c o n t r o l s e c t i o n t h e sequence cascade i s l i n k e d i n t o t h e general program. The sequence cascade i s s t a r t e d when c o n t a c t 1g.g = ' l ' and c o n d i t i o n Fm.5 = '1' i s f u l f i l l e d ; i t can be stopped when 10.1 = ' 1' When t h e sequence cascade reaches s t e p 6, o u t p u t Qg.6 i s s e t t o '1'. . Command output section I n t h e command o u t p u t s e c t i o n t h e o u t p u t commands are assigned t o t h e i n d i v i d u a l steps. Only one step f l a g has a 'l', output 41.8 has been l a t c h e d i n s t e p 0. I t t h e r e f o r e remains s e t d u r i n g s t e p 1 and i s n o t r e s e t u n t i l step 2 i s reached. Fig. 7 - - - Command o u t p u t s e c t i o n o f a sequence cascade A jump must n o t be made i n t o o r o u t o f a sequence cascade. If, f o r example, a c e r t a i n w a i t i n g p e r i o d must be observed between s t e p s 5 and 6, a t i m e r must be s t a r t e d w i t h t h e command o u t p u t o f t h e 5 t h step. I n t h e step enabling c o n d i t i o n f o r t h e 6 t h step, t h e t i m e r must be scanned f o r i t s signal status. Each w a i t i n g p e r i o d r e q u i r e s i t s own t i m e r . I f more than e i g h t sequence steps are r e q u i r e d i n a sequence cascade, sequence cascades can be connected i n s e r i e s . T h i s means, f o r example, t h a t sequence cascade D 1 i s s t a r t e d when t h e o u t p u t Q o f D0 i s scanned: Step f l a g s i n sequence cascades n o t used may be used i n t h e program as (nonr e t e n t i v e ) f l a g s . However, t h e y cannot be permanently f o r c e d (see S e c t i o n 3.4, Forcing). When changing over from R U N t o STOP o r HOLD, t h e c u r r e n t s t e p f l a g remains set. When changing over from STOP t o HOLD o r R U N t h e sequence cascade i s r e s e t . When changing over from HOLD t o R U N ( o n l y p o s s i b l e w i t h programmer), t h e sequence cascade i s processed f r o m t h e c u r r e n t ' step f l a g on. The design o f a sequence c o n t r o l system based on t h e example o f a c o n t r o l system f o r a stamping machine i s desc r i b e d below. The f o l l o w i n g steps are t o be executed c o n s e c u t i v e l y : 1. When a stamping p i e c e i s located i n f r o n t o f t h e s l i d e arm (S5 = I@.@), t h e s l i d e arm (Y1 = ~ 6 . 5 ) pushes t h e stamping p i e c e i n t o t h e die. 2. When t h e d i e i s loaded (S6 = 16.1) and t h e s l i d e arm i s i n t h e i d l e p o s i t i o n (S7 = I@.2), t h e stamping t o o l (Y2 = ~ 6 . 6 ) presses downwards. A f t e r t h e stamping t o o l (S8 = 1fl.3) has been i n c o n t a c t w i t h t h e stampi n g p i e c e f o r two seconds, t h e stamping t o o l r e t u r n s t o i t s i d l e p o s i t i o n (S9 = 10.4). 3. A f t e r t h e stamping o p e r a t i o n (S9 = I0.4), t h e e j e c t o r (Y3 = 46.7) e j e c t s t h e f i n i s h e d p a r t from t h e d i e . 4. A stream o f a i r (Y4 = Q1.5) from t h e a i r nozzle then blows t h e stamping p i e c e i n t o t h e c o n t a i n e r . A photoe l e c t r i c c e l l responds (B1 = 11.3) when t h e stamping p i e c e drops i n t o the container. 5. The next stamping o p e r a t i o n can then begin. Process schematic A u t o m a t i c mode '-$ ;;-l ::hy:ing Fig. 8 process Example o f a sequence cont r o l system f o r a stamping machine A l l t h r e e c y l i n d e r s are equipped w i t h r e t u r n s p r i n g s so t h a t t h e s l i d e arm, stamping t o o l and e j e c t o r r e t u r n t o t h e i r i d l e p o s i t i o n s when t h e corresponding valves Y1, Y2 and Y3 are switched o f f . The i n i t i a l c o n d i t i o n i s : A l l valves Y 1 t o Y4 closed and stamping d i e empty. Program s t r u c t u r e S t r u c t u r e o f a sequence c o n t r o l system S e l e c t mode S1 S4 Mode s e c t i o n I n i t i a l condition Start pulse ... l Enabling operations Set sequence cascade t o i n i t i a l condition Mode s e c t i o n Set sequence cascade t o i n i t i a l state S5 I I Enable sequence cascade L z U Step enabling c o n d i t i o n s Stepenabling ...57.81 Step d i s p l a y H2-H4 Commands f r o m sequence cascade E n a b l i n g of Command o u t p u t I Fig. 9 l Command o u t p u t b.$ ... Yl Y'i Basic s t r u c t u r e o f t h e c o n t r o l system f o r t h e stamping machine The p r i n c i p l e o f a sequence c o n t r o l system i s t o break t h e process down as f a r as p o s s i b l e i n t o d i s c r e t e steps. Accordingly, t h e program i t s e l f l a r g e l y c o n s i s t s o f consecutive steps. These are combined t o f o r m a sequence cascade. Each step o f t h i s cascade i s processed i n d i v i d u a l l y . The n e x t step i s n o t p r o cessed u n t i l processing o f t h e previous step has been completed. This g r e a t l y s i m p l i f i e s t h e program, s i n c e t h e i n t e r l o c k c o n d i t i o n s can be omitted. To process a s t e p o n l y t h e s i g n a l s p e r t a i n i n g t o t h e s t e p concerned need be used; t h e o t h e r s are disregarded. A sequence c o n t r o l system c o n s i s t s o f three parts. 1. The c o n d i t i o n s f o r i n d i v i d u a l modes such as s t a r t , stop, automatic and s i n g l e step are p r o cessed i n t h e mode s e c t i o n . 2. The actual program o f t h e c o n t r o l system i s processed i n t h e step enabling c o n d i t i o n s . The i n d i v i dual steps are executed i n dependence on t h e step enabling conditions. 3. The step commands are gated i n t h e command o u t p u t sect i o n w i t h the enabling signal from t h e mode s e c t i o n and, where applicable, w i t h i n t e r l o c k s i g n a l from t h e machine. As a r e s u l t , t h e a c t u a t o r s are switched on and o f f v i a t h e outputs o f t h e programrnabl e c o n t r o l ler. I n t h e case o f t h e stamping machine, t h e f l o w c h a r t f o r t h e sequence cascade would be as i n Fig. 10. The stamping machine must assume i t s i n i t i a l c o n d i t i o n t o p e r m i t t h e sequence cascade t o be s t a r t e d . This means t h a t valves Y 1 t o Y4 are c l o s e d (Q0.5, QB.6, 40.7, Q1.5 are ' 0 ' ) and sensors S5, S7, S9 (Ifl.0, 10.2 , 10.4) are '1' w h i l e sensors S6, S8 (Ifl.1, Ig.3) are ' 0 ' . Only when these c o n d i t i o n s are f u l f i l l e d can t h e sequence cascade be s t a r t e d w i t h pushbutton I1.D. Pushb u t t o n 11.2 serves t o s t o p t h e sequence cascade w i t h o u t s w i t c h i n g t h e p r o grammable c o n t r o l l e r t o t h e stop state. A l l these s i g n a l statuses are scanned i n t h e mode s e c t i o n (see Fig. 12). Measures t o implement t h e i n i t i a l c o n d i t i o n can a l s o be p r o grammed i n t h i s section. The step enabling c o n d i t i o n s (see Fig. 11) can e a s i l y be read from t h e arrows e n t e r i n g Fig. 10 from t h e r i g h t . r----HOLD t--f-=-=- START I Infifiat condition H S t e p SO. 0 Open v a l v e Y l Stamping p i e c e i n die S t e p SO. l Close vaeve Y l S t e p SO. 2 Open v a k v e Y 2 S t e p SO. 4 Close valve Y2 S t e p SO. 5 Open v a l v a Y 3 and Y 4 H H S t e p S0.6 C l o s e v a l v a Y 3 and Y 4 Fig. 10 Flowchart of t h e sequence cascade f o r t h e stamping machine The command o u t p u t (see Fig. 13) shows t h e o u t p u t s as a f u n c t i o n o f t h e step f l a g s which can a l s o be found e a s i l y i n Fig. 10. Stamping machine program S 0.0 M e a w l u ;to implement ;the ini,tiaf ~ ~ n d i . t i604 ~n t h e 4 tamping machine F i g . 11 PB1 Step e n a b l i n g conditions f o r t h e stamping machine F i g . 1 2 PB 2 Control section f o r start, hold F01 U Scan 06 ini.tial condi,tion Q CON6 I U Contaol bybtem ~ t a 4 - t6 equence cab cad e with cont4ol b y b t m on Hold 4 equence cab cad e F i g . 1 3 PB 3 Command o u t p u t f o r t h e stamping machine Q0.7 (t Q15 cut 2. Program generation with the 105R PC 2.1 Program input and correction Preparation A program can only be entered in the 105R PC if there is no memory submodule plugged in. When generating a new program, select the programmer function ERASE PROGRAM (general reset). This causes - the internal program memory of the 105R PC to be deleted - the process image of the inputs and outputs to be deleted - flags to be set to "0" - current values of the timers to be deleted and the run time set to 999.3 - current values of the counters to be deleted and the count limits set to 32767. Remove rnernotcy 4 ubmodute ( w i t h powm M n e d odd) E n t m nurnbm 06 ptcogtcarn block (PB) I - Select the INPUT/DISPLAY programmer function - Enter program block number Otcganine and check BP w i t h ISORT] key on ptrogtcarnmm - Enter program Correct ion The following can be deleted: The entire program Single PBs Single rungs Single program elements The f~llowingcan be inserted: Program elements Rungs I The following can be overwritten: Program elements Rungs PBs k The following can be assigned new numbers: Program blocks The entire program For further details, see the User Instructions of the 605R and 655R programmers. E n t m n e x t PB numbeh T a t and c o m e c t ptcogtcarn I 2.2 Example of program generation The t a s k d e f i n i t i o n o f t h e system i s t h e f i r s t i t e m r e q u i r e d when w r i t i n g t h e program. This task d e f i n i t i o n i n c l u d e s a process schematic showing t h e o b j e c t t o be c o n t r o l l e d w i t h r e f e r e n c e t o the technological r e l a t i o n s h i p s i n t h e process ( p o i n t s o f i n s t a l l a t i o n o f sensors and actuators, m a t e r i a l and m a t e r i a l flows, d i r e c t i o n s o f motion, etc.). Taking i n t h e example i n F i g . 14 as a basis, t h e task d e f i n i t i o n i s as follows: The b u l k m a t e r i a l i s t o be t r a n s f e r r e d f r o m a c o n t a i n e r v i a a conveyor b e l t and loaded i n t o a waggon. The c o n t r o l sequence i s enabled w i t h pushbutton S1 ( i n d i c a t o r lamp H 1 l i g h t s up) and d i s abled w i t h pushbutton S2. When t h e c o n t r o l system i s enabled, motor c o n t a c t o r K 1 switches on t h e conveyor b e l t i f a waggon i s s i t u a t e d i n t h e f i l l i n g p o s i t i o n ( l i m i t s w i t c h S3). The conveyor i s switched o f f again i f a waggon has l e f t t h e f i l l i n g p o s i t i o n and t h e n e x t waggon t o be f i l l e d has n o t reached t h e f i l l i n g p o s i t i o n w i t h i n 20 seconds. S l i d e v a l v e Y 1 i s opened i f t h e conveyor motor i s switched on and an empty waggon i s ready f o r f illi n g The s l i d e v a l v e i s closed again when t h e weight s e t on s c a l e B1 i s reached. The commands f o r opening and c l o s i n g may o n l y be a c t i v e u n t i l t h e s l i d e v a l v e has reached t h e new p o s i t i o n . I n order f o r t h e b u l k m a t e r i a l s s t i l l on t h e conveyor t o be t r a n s p o r t e d t o t h e waggon, l a t c h i n g pawl Y2 i s o n l y opened 10 seconnds a f t e r t h e " F u l l " message. The l a t c h i n g pawl i s immed i a t e l y closed again when t h e f i l l e d waggon has l e f t t h e f i l l i n g p o s i t i o n , i.e. a c o n t a c t o f l i m i t s s w i t c h S3 has opened again. When t h e n e x t waggon reaches t h e f i l l i n g p o s i t i o n , t h e described o p e r a t i o n i s repeated u n t i l t h e c o n t r o l sequence i s d i s a b l e d w i t h pushbutton S2. The n e x t step i s t o d r a f t t h e general s t r u c t u r e of t h e t a s k d e f i n i t i o n f o r t h e programmable c o n t r o l l e r , i.e. Arrangement according t o a m o n i t o r i n g scheme ( s i g n a l statuses o f sensors) Modes ( i d l e c o n d i t i o n , e t c . ) Machine f u n c t i o n s ( s t o p motor, e t c . ) . . . Process s c h e m a t i c Container Open a1.s 10.9 enabled V .16.1 Is ne qh ui be ni dc e c o n t r o l V ; i d ; - v a l v e 0 S1 Sequence i s enabled C o n t r o l sequence 'l1 Motor contactor F i g . 14 --V F i l l i n g waggons f r o m a conveyor be lt OFF S 2 r ON Enable c o n t r o l sequence 1 Enable Filling Switch conveyor b e l t m o t o r on and Conveyorl K 4 b L l f beltmotor K1' Conveyor o f f ; d e l a y time b e l t motor F l Open and c l o s e s l i d e valve - 1% S l i d e -' . Open V1 valve Close Release l a t c h i n g pawl; d e l a y t i m e Latching pawl Fig. 15 S t r u c t u r a l diagram f o r waggon f i l l i n g system Based on t h e s t r u c t u r a l diagram and t h e process schematic, t h e assignment l i s t can now be compiled; s e n s o r s and a c t u a t o r s a r e assigned t o t h e t e r m i n a l s o f t h e PC, as i s a l r e a d y p a r t l y t h e case i n F i g . 14. 'Operandp-. Device identifier Inputs: S 1 1 0.0 I 0.1 S 2 I p1.2 K 1 I 0.3 S3 I 0.4 B 1 I 1.g Y 1 I 1.1 Y 1 l"Q utputs: 0.5 imers : Functional description ON pushbutton, enable control sequence, idle condition is '0' OFF pushbutton, disable control sequence, idle condition is '1' Motor contactor, acknowledgement, conveyor motor is ON, idle condition is '0' Limit switch, waggon in filling position, idle condition is '0' Scales, waggon is full, idle condition is 'l' Slide valve, acknowledgement, valve is open, idle condition is '0' Slide valve, acknowledgemen,t,valve is closed, idle condition is '1' Indicator lamp, control system is enabled, idle condition is '0' Motor contactor, switch conveyor 1, idle condition is '0' 'Open' slide valve, idle condition is '0' 'Close' slide valve, idle condition is '0' Release latching pawl, idle condition is '0' - 20 sec. delay for conveyor motor 10 sec. delay for latching pawl Fig. 16 Assignment list for waggon filling system The number of inputs/outputs can be read off the assignment list. The PC can now be installed and the inputs and outputs can be wired. The program can now be written while the mechanical and electrical part is being installed. The program for the example for the "Waggon filling system" is shown in Fig. 17. When the program has been written, it is loaded ito the PC and tested. Fig. 17 Program for the waggon fill ing system 3. Program test 3.1 Search function W i t h i n a program t h i s f u n c t i o n searches f o r t h e f o l l o w i n g : - Operands e.g. 11.3, F3.!8, T1 - Program elements, e.g. +F- 11.3, 4 L t F3.0, fs7T1 It can be executed i n t h e programmer f u n c t i o n s - INPUT/DISPLAY PROG. TEST Search function within a program block (PB) The rungs c o n t a i n i n g t h e element searched f o r a r e d i s p l a y e d on t h e programmer. Search function in the entire program There i s o n l y one program b l o c k i n t h e programmer a t one time. When t h i s has been checked, t h e search continues i n t h e memory o f t h e 105R PC. The PB numbers c o n t a i n i n g t h e term sought a r e d i s p l a y e d on t h e programmer. For p r e c i s e l o c a t i o n , t h e r e s p e c t i v e PB can be brought i n t o t h e programmer. 3.2 Signal status display A t t h e end o f each processing c y c l e t h e f o l l o w i n g can be observed on t h e programmer: - Signal s t a t e s o f operands e.g. 10.3, F3.7, Q1.6 - Current values and s i g n a l s t a t e s o f timers, counters, impulse r e l a y s and sequence cascades. Read i n paocas image 06 inputs PB 0 Block checkpoint Two checkpoints can be selected: - A t the end o f a PB*, w i t h t h e PWRFLOW/FORCE programmer f u n c t i o n - A t t h e end o f t h e program (program checkpoint) b y means o f t h e STATUS/ SET programmer f u n c t i o n * b Block checkpoint Tham dm p4oCUcl ouApu/t image It i s always t h e checkpoint of t h e program block c u r r e n t l y i n t h e programmer which i s processed. P4og4am checkpoint 3.3 Forcing Forcing i s t h e once-only assignment o f a s i g n a l s t a t e t o an operand (e.g. 10.3, F3.5, T1) .----\ I I I I Read i n ptrocucza image 06 inp&cza This d e f a u l t i s o n l y v a l i d u n t i l t h e operand i s assigned t h e c u r r e n t s i g n a l s t a t e by program processing. \ I I I I II I II I I I I PG I I I Prrog'rarn 1 fI I P40cQ.44 I I 0lLipu.t I II I \ I '---/l Fig. 18. Once-only assignment o f s i g n a l s t a t e when f o r c i n g 3.4 Permanent forcing Permanent f o r c i n g i s an unmodifiable assignment o f a s i g n a l s t a t e t o an operand (e.g. 18.3, F3.5, T1) A permanently f o r c e d operand cannot be changed by assignments r e s u l t i n g from t h e program processinng. A l l permanently f o r c e d e l ements are enabled by - DISABLE FORCE ( t e r m i n a t e permanent f o r c i n g ) programmer f u n c t i o n - Operation o f t h e mode s e l e c t o r - Unplugging t h e programmer connecti n g cable The f o l l o w i n g cannot be forced: - Step f l a g 2 i n sequence cascades - Output Q/Q o f sequence cascades - Output Q/Q o f impulse r e l a y Single scan in HOLD mode This involves a single, complete scan o f t h e program. The s t a r t i n g and end p o i n t i s the program checkpoint a t which t h e 105R i s w a i t i n g i n HOLD mode. A single scan can be triggered pressing the key in the - by Read i n p t r o c ~ h inp& image JI sTATuS/SET and PWR FLOW/FORCE programmer f u n c t i o n s I n conjunction w i t h t h e f o r c i n g and p e r manent f o r c i n g o f operands, t h e s i n g l e scan i s a convenient a i d f o r program testing. Pmgtram i Ptrocah oURp& image c1 Pnagtram checkpoint Storing the program A v a l i d program can be t r a n s f e r r e d from t h e i n t e r n a l memory o f t h e 105R PC t o a p l u g - i n memory submodule. 4.1 Storing the program on an EEPROM submodule An EEPROM submodule i s plugged i n t o t h e CPU f o r s t o r i n g t h e program. The contents o f t h e 105R PC program memo r y a r e copied o n t o t h e submodule by means o f t h e STORE PROGRAM programmer function. 7 n 5 u i t EEPROM submodulewith powm odd i N.B. - The memory submodule may o n l y be i n s e r t e d and removed w i t h t h e power o f f ! - Programs a l r e a d y on t h e EEPROM submodule are o v e r w r i t t e n . ExecLLte STORE PROGRAM ptcog'rammm dunc.tion J C o n t e n b ad PC memoay copied onSo aubmudute 4.2 Storing the program on an EPROM submodule To s t o r e a program, an empty ERPOM submodule i s i n s e r t e d i n t o t h e CPU w i t h a programming adapter. The contents o f t h e 105R PC program memo r y are copied onto t h e submodule by means o f t h e STORE PROGRAM programmer function. N.B. - The memory submodule and program adapter may o n l y be i n s e r t e d and removed w i t h t h e PC switched o f f ! - Programs i n which t h e FLAGS RETENTIVE b i t i s s e t t o "1" cannot be t r a n s f e r r e d t o EPROM submodules. FLAGS RETENTlVE b i t = 0 Vatidpt~ogtrami n PC memoay I SmmX empty EPROM submodule w i t h paog'ramming a d a p t m w i t h powm odd I C a t l STORE PROGRAM ptrogaarnm~&~nc.tion \ Contenth 06 PC memoay copied onto dubmodule 4.3 Duplication of programs A f t e r a general r e s e t o f t h e 105R PC, a memory submodule w i t h a v a l i d program i s inserted. When t h e power i s switched on, t h e cont e n t s o f t h e submodule are copied i n t o t h e i n t e r n a l program memory o f t h e 105R PC. To prepare t h e STORE PROGRAM f u n c t i o n , an e n t r y must be made i n t h e program i n t h e i n t e r n a l memory (see Operating I n s t r u c t i o n s , Section 3.4 "Using t h e memory submodule, Note") e.g. read o u t and r e - e n t e r AUTO RESTART = X. See 4.1 o r 4.2 f o r f u r t h e r action. Catt ERASE PROGRAM ptog4ammm aunckion 4 In4 mernorry dubmodLLee w i t h uafid pkogrram w i t h t h e powm odd C On poww-up ;the ptrog4arn A copied i n t o t h e PC h Remove mmoty hubrnadute w i t h PCWER OFF Adtm powm-up, e.g. c a t t AUTO RESTART and te-en;tw i X =X See 4.1 04 4.2 5. Operation set 5.1 Binary operations I Symbol Operand Description X=I0.@ t o Id.7 =I1.0 t o 11.7 Scanning an i n p u t f o r "1" -jX F =17.d t o 17.7 X=Q0.5 t o Qg.7 =Ql.@ t o Q1.7 Scanning an o u t p u t f o r "1" =Q7 .g t o Q7.7 x=F@.B to ~5.7~) x=S@.@ t o ~ 3 . 7 ~ ) 1) Flags B.@. ..1.7 X=T@ t o T31 X=C@ t o C15 X=D@ toD3 X=PB t o P15 can be s e t as r e t e n t i v e i n t h e case o f an EEPROM submodule 2) Used w i t h sequence cascades. Scanning a f l a g o r i n t e r n a l r e l a y f o r "1". Scanning a s t e p f l a g f o r "1". Scanning a t i m e r f o r "1". (The t i m e r has a "1" a t t h e Q o u t p u t i f t h e r e i s a "1" a t t h e s t a r t i n p u t o f t h e t i m e r and t h e t i m e has elapsed) Scanning a counter f o r "1". (The up-counter has a "1" a t t h e Q output i f the s p e c i f i e d l i m i t i s reached o r exceeded, w h i l s t t h e downcounter has a "1" a t t h e Q output i f the specified l i m i t i s reached o r i f t h e count drops below it. Scanning a sequence cascase o r drum sequencer f o r "1". (The sequence cascade has a "1" a t t h e Q o u t p u t i f t h e r e i s a "1" a t t h e s e t i n p u t o f t h e sequence cascade and t h e l a s t step o f t h e sequence cascade has been reached). Scanning an impulse r e l a y ( t r a n s i t i o n - s e n s i t i v e p u l s e ) f o r "1". (The impulse r e l a y has a "1" a t t h e Q o u t p u t f o r t h e d u r a t i o n o f one c y c l e i f t h e s i g n a l changes from "0" t o "1" a t i t s s e t i n p u t ) . . S.yrnbo l Operand Description X=I0.0 t o IQ.7 =I1.@ t o 11.7 Scanning an i n p u t f o r "0". X d/E =Ii.fl t o Ii.7 Scanning an output f o r "0". x = Q @ .t~o ~ 0 . 7 = ~ 1 . 8 t o Q1.7 =Q7.b t o Q7.7 x=FO.O t o ~ 5 . 7 1 ) Scanning a f l a g f o r "0". X=Sb.b t o ~ 3 . 7 ~ ) Scanning a step f l a g f o r "0" X = T ~ t o T31 Scanning a t i m e r f o r "0". (The t i m e r has a l o g i c "0" a t o u t p u t Q, i f t h e r e i s a "0" a t t h e s t a r t i n p u t o f t h e t i m e r o r a "1" a t t h e s t a r t i n p u t o f t h e t i m e r and t h e time has not y e t elapsed). Scanning a counter f o r "0". (The up-counter has a "0" a t t h e Q o u t p u t i f t h e s p e c i f i e d l i m i t has been reached o r t h e count has dropped below it, w h i l s t t h e downcounter has a "0" a t t h e Q output i f t h e s p e c i f i e d l i m i t has been reached o r exceeded). Scanning a sequence cascade f o r "0" (The sequence cascade has a "0" a t t h e Q output, i f t h e r e i s a "0" a t t h e s e t i n p u t o f t h e sequence cascade o r a "1" a t t h e s e t i n p u t o f t h e sequence cascade and t h e l a s t s t e p o f t h e sequence cascade has n o t y e t been reached). Scanning an impulse r e l a y f o r "0". (The impulse r e l a y has a "0" a t t h e Q o u t p u t i f t h e r e i s a "0" a t t h e s e t i n p u t o f t h e impulse r e l a y o r a "1" f o r longer than once c y c l e . X=C@ t o C15 X=K!d t o K3 X=P0 t o P15 L 1) Flags 6.6 2) ... 1.7 can be s e t as r e t e n t i v e i n t h e case o f an EEPROM submodule Used w i t h sequence cascades. , Symbol Operand Description - 1 iXk X=@ t o 143) X=Q0.0 t o Q0.7 =~1.@t o Q1.7 The nodes are used f o r combining rungs. Each rung begins w i t h a node. The connection t o t h e l e f t - h a n d power r a i l i s always made w i t h node 0. Set output t o "1" =Q7.0 t o Q7.7 ' X=Fb.@ to ~5.7~) Set f l a g t o "1" x=S8.0 t o ~ 3 . 7 ~ ) Set step f l a g t o "1" x=Id.fl Set i n p u t t o "0"" (The "0" i s o n l y entered i n t h e process image). t o 10.7 =I1.0 t o 11.7 4% =I7.0 t o 17.7 t o Q0.7 =Q1.@ t o Q1.7 X=Q0.O Set o u t p u t t o "0" =Q7.B t o Q7.7 x=F~.@ to ~5.7~) X=Q~.@ t o ~g.7 =Q1.0 t o Q1.7 -$E Set f l a g t o "0" Latch output t o "1" =~j.@t o ~j.7 x=F@.@ to ~5.7~) X=I$.O t o Ig.7 =I1.@ t o 11.7 =1j.!8t o 1j.7 X=Q@.g t o Qg.7 =Q1.@ t o Q1.7 Latch f l a g t o "1" Set i n p u t t o "0" (The s i g n a l s t a t u s i s o n l y entered i n t h e process image). Unlatch output = ~.fli t o 67.7 X=F@.@ 1) Flags @.@ t o 1.7 t o F1) Unlatch f l a g f can be s e t as r e t e n t i v e i n t h e case o f an EEPROM submodule. 2 ) Used w i t h sequence cascades. 3 ) Display on 605R programmer i n hexadecimal, 0 t o E 5.3 Complex operations 5.2 Symbo l Operand Description S t a r t timer X=TB t o T23 M 1 " signal a t the S input s t a r t s t h e t i m e r . Output Q i s "1" i f t h e r e i s a "1" a t t h e S i n p u t and t h e s p e c i f i e d t i m e has elapsed. Q can a l s o be used as output, w i t h t h e i n v e r t e d s i g n a l o f Q. The c o n s t a n t Y, obtained by m u l t i p l y i n g a t i m e value w i t h a t i m e base, g i v e s t h e time (e.g. 8.1 = 800 ms). The c o n s t a n t Y can a l s o be r e p l a c e d by a t i m e r e g i s t e r TR, i n which case i t i s independent o f program i n p u t . 4?t Y = Time = Time v a l u e t i m e base Time value: 1 t o 999 Time base: 0 2 10 ms l f 100 S 2 : 1ms 3 = 1 min Hold t i m e r Impulse r e l a y ( t r a n s i t i o n sensitive pulse) Y=CON l.@ to CON 999.3 or Y=TRO t o TR23 X=Tp t o 3 1 X=Pg t o P15 {FX+ A A "1" a t t h e H and S i n p u t s o f t h e same t i m e r stops t h i s t i m e r . Output Q i s "1" i f t h e r e i s a "1" a t t h e S i n p u t o f t h e same t i m e r and t h e spec i f i e d t i m e has elapsed. Q can a l s o be used as o u t put, w i t h t h e i n v e r t e d s i g n a l o f Q. With e v e r y change f r o m "0" t o a "1" a t t h e S i n p u t , t h e Q i n p u t changes t o "1" f o r t h e d u r a t i o n o f one scan. Q can a l s o be used as output, w i t h t h e i n v e r t e d s i g n a l of Q. A "1" a t t h e J i n p u t has t h e e f f e c t o f implementing a jump ( t o a program b l o c k whose nurnb e r i s s p e c i f i e d b y constant Y. Constant Y can a l s o be r e p l a c e d by a d a t a r e g i s t e r DR, i n which case i t i s independent o f program i n p u t Depending on t h e programming, u n c o n d i t i o n a l jumps can be executed w i t h t h i s operation. , Jump S Y=CON t o CON 63 or Y=DR0 t o OR23 Syrnbo l Operand Description Set counter 4-1 Y=CON O t o CON 32767 or Y=DR@t o ~ ~ Count up Y=CON to CON 32767 or Y=DRg t o DR23 Count down X Y=CON 0 t o CON 32767 or Y=DR@ t o DR23 2 3 I A "1" a t t h e S i n p u t causes c o n s t a n t Y t o be loaded and enabled. Y can have any v a l u e between 0 and 32767. The c o n s t a n t Y can a l s o be replaced b y a data r e g i s t e r DR, i n which case i t i s independent o f program i n p u t With e v e r y change f r o m "0" t o "1" a t t h e CU i n p u t , t h e p r e v i o u s c o u n t i s incremented by l . Constant Y s p e c i f i e s t h e upper l i m i t o f the counter. I f t h i s l i m i t i s reached o r exceeded, t h e Q o u t p u t changes t o "1". Q can a l s o be used as output, w i t h t h e i n v e r t e d s i g n a l o f Q. Constant Y can a l s o be r e placed b y a d a t a r e g i s t e r DR, i n which case i t i s independent o f program i n p u t . With e v e r y change f r o m "0" t o "1" a t t h e CD i n p u t , t h e p r e v i o u s c o u n t i s decremented b y 1. Constant Y s p e c i f i e s t h e lower l i m i t o f t h e counter. I f t h i s l i m i t i s reached o r i f t h e count drops below it, t h e Q o u t p u t changes t o "1". Q can a l s o be used as output, w i t h t h e i n v e r t e d s i g n a l o f Q. Constant Y can a l s o be r e placed b y a d a t a r e g i s t e r DR, i n which case i t i s independent o f program i n p u t . Operand j t a r t sequence cascade X Y=CON 0 t o CON 7 or Y=DRO t o DR23 Hold sequence cascade X Description A "1" a t t h e S i n p u t s t a r t s and enables t h e sequence cascade. Constant Y s p e c i f i e s t h e number o f t h e l a s t sequence step. Constant Y can a l s o be replaced b y a d a t a r e g i s t e r DR, i n which case t h e constant i s independ e n t o f program i n p u t . The Q o u t p u t i s "1" i f t h e r e i s a "1" a t t h e S i n p u t and t h e l a s t sequence step has been reached. Q can a l s o be used as output, w i t h t h e i n v e r t e d s i g n a l o f Q. A "1" a t t h e H i n p u t h o l d s t h e sequence cascade a t a p a r t i c u l a r sequence step. The Q o u t p u t i s "1" i f t h e r e i s a "1" a t t h e S i n p u t and t h e l a s t sequence s t e p has been reached. can a l s o be used as output, w i t h t h e i n v e r t e d s i g n a l o f Q. 0 Subject t o change w i t h o u t p r i o r n o t i c e . SIEMENS AKTIENGESELLSCHAFT 5.6 Order No.: GWA 4NEB 810 0221-02 P r i n t e d i n t h e Federal Republic o f Germany