|
Here the function are listed by their mnemonics, and this is followed by the arguments for the functions. The second line does not have any input contacts, so the stack is loaded with a true
plc il -18.8
value.
I:001/0 TON Timer T4:0 Delay 5s
ADD SourceA 3 SourceB T4:0.ACC Dest N7:0
START:LD I:001/0 TON(T4:0,1.0,5,0) LD 1 ADD (3, T4:0.ACC, N7:0) END
Figure 18.6 A Complex Ladder Rung and Equivalent IL
An example of an instruction language subroutine is shown in Figure 18.7. This program will examine a BCD input on card I:000, and if it becomes higher than 100 then 2 seconds later output O:001/00 will turn on.
plc il -18.9
Program File 2:
Label
Opcode
Operand
Comment
START:
CAL
3
(* Jump to program file 3 *)
Program File 3:
Label
TEST:
ON: Opcode
LD BCD_TO_INT ST GT JMPC CAL LD ST CAL LD ST RET
Operand
%I:000
%N7:0 100 ON RES(C5:0) 2 %C5:0.PR TON(C5:0) %C5:0.DN %O:001/00
Comment
(* Load the word from input card 000 *) (* Convert the BCD value to an integer *) (* Store the value in N7:0 *) (* Check for the stored value (N7:0) > 100 *) (* If true jump to ON *) (* Reset the timer *) (* Load a value of 2 -for the preset *) (* Store 2 in the preset value *) (* Update the timer *) (* Get the timer done condition bit *) (* Set the output bit *) (* Return from the subroutine *)
Figure 18.7 An Example of an IL Program
18.4 SUMMARY
* Ladder logic can be converted to IL programs, but IL programs cannot always be converted to ladder logic.
* IL programs use a stack to delay operations indicated by parentheses.
plc il -18.10
• The Allen Bradley version is similar, but not identical to the IEC 61131 version of IL.
1. BACK | NEXT Easy Access To All Pages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|