You are on page 1of 14

Ladder Logic

“Ladder” diagrams
Ladder diagram adalah kumpulan simbol-simbol skematik yang khusus digunakan dalam dokumentasi industri. Disebut “ladder” diagram dikarenakan simbol-simbolnya tersusun seperti tangga dengan dua garis vertikal (menyimbolkan power supply) dan memiliki banyak “rungs” (garis horizontal) yang merepresentasikan rangkaian pengontrol. Jika kita ingin membuat suatu ladder diagram yang sederhana untuk mengontrol sebuah lampu oleh sebuah saklar, maka bentuknya akan menjadi seperti berikut :

“L1” dan “L2” menunjukkan pada dua poles dari sumber tegangan 120 VAC. Biasanya L1 adalah + 120 V dan L2 adalah ground. Terkadang pada PLC digunakan juga sumber tegangan selain 120 VAC, tetapi hal ini tidak akan mempengaruhi operasi dari ladder diagram ini.

Fungsi Digital Logic
Kita dapat membuat suatu fungsi logika yang sederhana untuk mengendalikan suatu lampu menggunakan beberapa saklar. Jika digunakan notasi standar biner untuk lampu dan saklar (0 untuk OFF dan 1 untuk ON), maka ladder diagram berikut merepresentasikan suatu rangkaian OR.

.Lampu akan menyala jika saklar A atau saklar B dikontakkan. Kita juga dapat membuat ladder diagram untuk merepresentasikan suatu rangkaian AND sebagai berikut.

Logika untuk invers atau NOT direpresentasikan menggunakan normally-closed contact sebagai berikut. Jika salah satu saklar saja ditekan. lampu menyala saat saklar A tidak ditekan. Sebagai berikut : Lampu hanya akan menyala jika saklar A dan saklar B tidak ditekan. maka lampu akan padam. Pada rangkaian diatas. Jika kita menggabungkan rangkaian OR dan invert maka akan diperoleh suatu rangkaian NAND. .

Dengan prinsip yang sama. Pada rangkaian berikut kita membuat rangkaian Exclusive-OR dengan mengkombinasikan rangkaian AND. kita dapat membuat rangkaian NOR sebagai berikut. OR dan NOT. Beberapa kesimpulan yang perlu diperhatikan : • Saklar yang disusun paralel ekivalen dengan rangkaian OR • Saklar yang disusun seri ekivalen dengan rangkaian AND • Saklar Normally-closed ekivalen dengan rangkaian NOT (inverter) Kita dapat mengkombinasikan berbagai fungsi logika untuk menyusun rangkaian yang kita inginkan. .

ini terhubung pada fisik mekanik yang sama. Jadi jika Anda melihat label yang sama untuk beberapa saklar pada ladder diagram. Jika kita ingin meng-invert-kan output dari suatu saklar. Pada ladder diagram. tidak ada batasan sebuah saklar dapat digunakan berulang kali dalam rungs. kita membuat dua contact per input. kita dapat juga menggunakan relay. Rangkaian berikut memberikan contoh pemakaian relay dalam pembuatan ladder diagram yang berfungsi sebagai AND .Untuk membuat rangkaian Exclusive-OR ini. Dua saklar A pada ladder diagram secara fisik menunjukkan pada saklar yang sama. demikian juga saklar B. Hal ini dibenarkan dalam ladder diagram.

PSIM Operations Manual Operation Psim has been designed to minimize the amount of typing required on the part of the student. most instructions are accessed by way of the IBM function keys . Semua saklar harus bekerja horizontal Jumlah saklar pada setiap rung terbatas Hanya satu output terkoneksi ke suatu grup saklar Hanya ada satu cabang untuk setiap rung Aliran dari kiri ke kanan Tiap output hanya digunakan satu kali dalam suatu program Tidak ada saklar yang ditempatkan di kanan dari suatu output Catatan : keluar dari program ke layar Main Menu dan kembali ke sub-program akan membersihkan data simulasi dan Anda dapat memulai kembali program Anda. 4. 6. atau CR1. 7. 2. To this end. 3. Konstruksi Ladder Diagram [PSIM] 1.Kita menyebut relay sebagai ”Control Relay 1”. 5.

The animation will continue.g. next is a ":" followed by a single digit. a "/" and finally two digits. When writing a program to control pieces of hardware always ensure that the correct I/O address is used. but the menu which lists the available choice of process simulations will remain displayed. Throughout this documentation.e.[F3] These [Fn] keys represent normally open(NO) or normally closed(NC) momentary switches which may be used at the programmers discretion for such function as START and STOP buttons to control the operation of the process. Students are encouraged to maintain a watchful eye on the status lines to see how the [Fn] definitions change thus minimizing the frustration due to miss-hit keys. "Motor" and a PLC I/O address associated with that device i. In some processes there are two such . After a period of initialization the main PSIM introductory screen will appear which contains the copyright notice for the PSIM program and an animation of the PSIM logo.. The various functions are grouped together in logical order ensuring a minimum number of key strokes. Fig. Please note that all addresses used in this simulation software use the following convention. Fig. a momentary prompt will appear stating: 'Press Any Key To Continue'. Working Through The Menus First level [Fn] key definitions Once any of the processes have been selected a new animated process will be displayed.e. Function keys may take on different definitions depending upon what operation is currently being executed. "O:1/00".. The electric motor in the silo simulation is a label describing the device i. Process Simulation Screens On each of the process screens the student will notice that beside each piece of equipment e. Typing <PSIM> at the DOS prompt will result in the start-up of the PSIM simulation program. [F8] etc.[F2]. With only minor exceptions all these definitions are the same regardless of which process is being used. To select one of the process simulations. 2 Process Simulation Menu [F1]. 2 is a representative sample. simply press the number key on your keyboard that corresponds to the menu entry you desire. After the animation has completed one cycle. the first character is either an "I" (input) or an "O" (output). On the status lines of any of these processes will appear the first of a series of layers of [Fn] key definitions. The student should note the definition of each function key is displayed on the bottom 2 lines of the colour display..F1 through F10. a specific function key will be referred to as [F1]. Pressing a key at any time while the introductory screen is showing will cause the main PSIM menu to be displayed. This naming convention must be adhered to if the devices are to be controlled properly.

Exit back to the main menu Successive taps on this function key will display different areas of the PLC data table on the screen beside the process. Fig. Used to completely erase program memory so that a new program may be written. Figs 3 through Fig. Do not forget to "SAVE" the program whenever any changes are made to the logic. Used to modify an existing rung. 8) Used to delete a complete rung from a program. Used to switch from the process display mode to the program writing mode. Used to paste back into the program a rung that had previously been deleted. from one area of a program to an other. [F1]. Sub-Menu used to save or to retrieve user programs. back to process mode. This function is useful as a program debugging tool [F6] [F7] Rung Editor This function is invoked whenever program creation or modification is required. 3 Main Editor Menu Append. Programs are written in the program creation mode and the tested out in the process display mode. (Fig. in total. Exit this menu. Insert Rung Modify Rung Delete Rung Used to Append a new rung after the current cursor position or to Insert a new rung ahead of the current cursor position. Used in combination with [F5] rungs may be moved a rung. [F2] [F3] [F5] [F6] Un-Del Rung [F7] Program Utility Clear Memory Exit Editor [F8] [F10] .[F5] Rung editor: Exit (Esc) Toggle Table switches and in others there are three. 8 depict the [Fn] key definitions used in the Rung Editor mode.

5 is activated whenever an output instruction is requested. The [Fn] definitions for this menu are: [F1]. 4 Input Instruction Menu The menu in Fig 4 is activated whenever Append rung or Insert Rung is requested. back to the main edit menu. close Output Instructions Exit [F8] [F10] Fig.Fig. . Branch Start. [F4] XIC. Output latch Output unlatch. The [Fn] definitions for this menu are as follows (these instructions are more fully described in "Relay Logic Instructions and Timers and Counters"): [F1] [F2] [F3] [F4] [F5] [F6] [F7] [F8] [F10] OTE OTL OTU TON RTO CTU CTD Res PrevMenu Output energize. XIO Basic input instructions( see Relay Logic Instructions). 5 Output Instruction Menu The menu in Fig. Used together to form a series of parallel instructions. Timer on delay Retentive timer Count up counter Count down counter Reinitialize counters and retentive timers Return to main edit menu. Parallel instructions form a logical OR operation. Sub-menu containing all output instructions. [F2] [F3].

[F1] Save Program [F2] Load Program . Used to select the output instruction menu Menu Used to return to the main Edit menu [F5] GEQ [F6] LEQ Output Instructions Prev. 7 is activated whenever the unity request is made (Fig. File names are assigned for each process. 4. Program names are not required for these files. This menu provides basic functionality for program storage and retrieval. Files are saved in the default directory. Word value is greater than or equal to a specified immediate value. File names are assigned at storage time and these same names are used upon retrieval. The [Fn] definitions for this menu are as follows (these instructions are more fully described in "Word Compare Instructions"): [F1] [F2] [F3] [F4] EQU NEQ GRT LES Word value is equal in value to a specified immediate value Word value is not equal to a specified immediate value.Fig. Word value is greater than a specified immediate value Word value is less than a specified immediate value. Word value is less than or equal to a specified immediate value. Menu [F8] [F10] Fig. Used to re-load a program that has already been saved ([F1]). 6 Word Compare Menu The menu in Fig. 7 Utility Menu The utility menu in Fig. 6 is activated whenever a Compare Instruction is requested in the main edit menu Fig. Used to save a program so that it may be retrieved at a later date. 3).

In the following discussion. The [Fn] key definitions for this menu are as follows: Append. Modifications include changing the address of the instruction or changing the instruction itself. 8 Rung Modification Menu The menu in Fig. 8 is activated whenever a modify rung request is made from (Fig. we use an input device in our examples. Insert Instruction Delete Instruction Used to Append (Insert) a new instruction to the right (Left) of the instruction under the cursor. . Fig. 3). and that some minor changes are required. Used to Delete the instruction under the cursor. Used to accept the rung once all of the modifications have been completed [F1].[F3] [F4] [F10] Print Program Program Directory Exit Utility Used to print a program to the DOS Device PRN: Used to display a directory of ladder programs saved to date. Exit back to main edit menu. Used to Change the instruction under the cursor.[F2] [F3] [F4] Change Instruction [F10] Accept Instruction Relay Logic Instructions and their Mnemonics Examine If Closed (XIC) Examine If Open (XIO) Output Energize (OTE) Output Latch (OTL) Output Unlatch (OUT) Branching Use these instructions to monitor the status of bits in the data table. and to control the state of bits in the data table. Modification implies that the rung already exists. such as output bits. such as input bits and timer control word bits.

When the input device completes its circuit. This off state is reflected in memory for the corresponding bit. Out Energize (OTE) Use OTE instructions to set a particular bit in memory. When the input device no longer completes its circuit. the processor sets the logic for this instruction to false. the non retentive output instruction is disabled when the instruction is false (input closed). saklar adalah open When an input device completes its circuit the input terminal wired to the device indicates an on state. If a true logic path cannot be established or rung conditions go .Examine if Closed (XIC) Ketika divais pengontrol on. saklar adalah closed Ketika divais pengontrol off. Examine if Open (XIO) Ketika divais pengontrol on. saklar adalah open Ketika divais pengontrol off. If a true logic path is established with the input instructions in the rung. The enabled status of this bit is determined by rung logic in your application program. the output device wired to this terminal is energized. This on state is reflected in memory for the corresponding bit. the processor determines that the input is off (input open) and sets the instruction logic to true. When the processor finds an XIO instruction having the same address. a non-retentive output instruction is disabled when the XIC instruction is false (input open). When the processor finds an XIC instruction having the same address. the output instruction Is enabled when the XIO instruction is true (input open). If the rung containing this instruction also contains an output instruction. If the address of the bit corresponds to the address of an output module terminal. the processor sets the logic for this instruction to false. it determines that the input device is on or closed and sets the instruction logic to true. the output instruction is enabled when the XIC instruction is true (input closed). the OTE instruction is enabled. If the rung containing this instruction also contains an output instruction. saklar adalah closed When an input device no longer completes its circuit. the input terminal wired to the device indicates an off state.

Output Latch and Output Unlatch (OTL). the OTU instruction resets its corresponding bit in memory. Example of nested Branching . An OTU instruction with the same address as the OTL instruction resets (disables or turns off) the bit in memory. even after the rung conditions go false. The enabled status of this bit is determined by the rung logic preceding the OTL and OTU instructions. the output device wired to this terminal is energized when the bit in memory is set (turned on or enabled). Your program can examine a bit controlled by these instructions as often as necessary. only a single level of output branching is permitted. However. Your program may have two levels of parallel branches for input instructions. Branching Use branching to form parallel logic in your application program. or enabled. If a true logic path is not established and the corresponding bit in memory was not previously set. the OTL instruction is enabled. An OTE instruction is similar to a relay coil. the associated output device de-energizes. The instruction is controlled by the preceding instructions in its programmed rung. When a true logic path is established. A relay coil is controlled by contacts in its hard-wired rung. (OTU) Output latch and output unlatch instructions are retentive output instructions. A complete logic path of true preconditions is similar to a complete electrical circuit of closed contacts. They are usually used in a pair for any data table bit they control. the bit in memory is latched on and remains on. the OTL instruction is not enabled. the OTE instruction is disabled. When rung conditions become false. Your program can examine an output controlled by OTL and OTU instructions as often as necessary. If a true logic path is established with the input instructions in the rung.false. When you assign an address to the OTL instruction that corresponds to the address of an output module terminal. if a true logic path was previously established.

3. it scans the remainder of the rung as if it were false. we recommend that you place series input instructions ahead of branching instructions to reduce program scan time. Input Branching Use an input branch in your application program to permit more than one combination of input conditions to form parallel branches (OR-logic conditions). If at least one of these parallel branches forms a true logic path. scan continues to I:302 I:302 is true. If none of the parallel branches forms a true logic path. 4. and the output instruction logic will not be true (output is not energized). I:300 is true.When: 1. Where possible. scan continues to I:303 I:300 is false . scan continues to I:304 The processor scans rungs from left to right and from top to bottom. rung logic is not enabled. scan continues to I:303 I:303 is true. 5. 2. scan continues to I:301 I:301 is true. . When the processor finds an input instruction whose logic is false. the rung logic is enabled.