====== MP STUDIO 2 Phase 3 · Ladder Editing ====== [[products:mp_studio:ladder_editing|한국어]] | **English** This page describes how to place contacts, coils and wires on the ladder canvas and enter their addresses, how to edit and move rungs, and how to use find and replace and the navigation features. ===== Ladder Symbols ===== Select a cell, then press a function key or a symbol rail button to place a symbol in that cell. {{ :en-us_products:mp_studio:ladder-symbols.png?1200 |Figure 1. Ladder symbols placed with the function keys }} In Figure 1, the first rung is ''P0'' (NO) → rising edge (P) → ''P1'' (NC) → NOT → ''P32'' coil, the second rung is ''P2'' → falling edge (N) → SET ''M0'', and the third rung is ''P3'' → RESET ''M0''. ^ Shortcut ^ Symbol ^ Action ^ Cursor after placing ^ | ''F2'' | NO contact | Passes power when the address is ON. | Stays | | ''F3'' | NC contact | Passes power when the address is OFF. | Stays | | ''F5'' | Horizontal line | Carries power from the left to the cell on the right. | 1 cell right | | ''F6'' | Vertical line | Turns on or off a vertical line from the right edge of the cell to the row below. | 1 cell down | | ''F7'' | SET coil | Turns the address ON and keeps it ON when the condition turns ON. | Right end of the row | | ''F8'' | RESET coil | Turns the address back OFF when the condition turns ON. | Right end of the row | | ''F9'' | Output coil | Writes the ON/OFF state of the condition to the address on every scan. | Right end of the row | | ''F10'' | NOT | Inverts the power state before it. | 1 cell right | | ''F11'' | Rising edge | Passes power for only the one scan in which the preceding condition goes from OFF to ON. | Stays | | ''F12'' | Falling edge | Passes power for only the one scan in which the preceding condition goes from ON to OFF. | Stays | Coils (''F7'', ''F8'' and ''F9'') are always placed at the right end of the row, and the empty cells between the preceding symbol and the coil are filled with horizontal lines automatically. You cannot place a symbol on top of a function block. ===== Entering Addresses ===== - Select a contact or coil cell and press ''Enter'' or double-click it. - In **① Address** of the **Edit Contact** (or **Edit Coil**) window, enter an address such as ''P0'', ''M10'' or ''T0''. - If needed, also enter **② Symbol** and **③ Comment**, then click **OK**. The symbol and comment you enter are registered as the symbol of that address and are also shown on other cells that use the same address. {{ :en-us_products:mp_studio:cell-edit-contact-marked.svg?540 |Figure 2. Entering the address, symbol and comment in the Edit Contact window }} * If you start typing on a cell, the input window opens with what you typed already filled in. * If you type an address on an empty cell, the **Insert Contact (NO)** window opens, and clicking OK places an NO contact with that address. * Press ''Shift+Enter'' to edit the address of the selected cell directly in the symbol table. The address system is described in [[:en-us_products:mp_studio:memory_symbols|Phase 5 · Memory and Symbols]]. ===== Series and Parallel Connections ===== Contacts placed one after another in the same row form a series (AND) condition. Joining a contact in the row below to the row above with a vertical line forms a parallel (OR) condition. - In row 1, place a ''P0'' NO contact and a ''P32'' output coil. - In the first cell of row 2, place a ''P1'' NO contact. - Select the first cell of row 1 (''P0'') and press ''F6'' to draw a vertical line down to the row below. {{ :en-us_products:mp_studio:ladder-parallel-marked.svg?1100 |Figure 3. A rung with P0 and P1 connected in parallel }} The vertical line is drawn at the right edge of the cell. You cannot draw a vertical line in the last column of a row or after a coil. ===== Self-Holding Circuit ===== To keep the output ON even after the start input was ON only briefly, put a contact of the output itself in parallel. {{ :en-us_products:mp_studio:ladder-self-hold-marked.svg?1100 |Figure 4. A self-holding circuit with start P0, stop P1 and output P32 }} * **① ''P0'' (NO):** start input * **② ''P32'' (NO):** the self-holding contact of the output (in parallel with ''P0'' through the vertical line) * **③ ''P1'' (NC):** stop input. When it turns ON, power is cut. * **④ ''P32'' (output coil):** output ===== SET and RESET ===== A SET coil turns its address ON and keeps it ON once the condition has been ON, and a RESET coil turns that address back OFF. Use SET and RESET for the same address as a pair. {{ :en-us_products:mp_studio:ladder-set-reset.png?1100 |Figure 5. M0 set by P0 and reset by P1 }} ===== Edge Contacts ===== A rising edge (''F11'') passes power for one scan at the moment the preceding condition goes from OFF to ON, and a falling edge (''F12'') at the moment it goes from ON to OFF. Use them for actions that must run only once, such as a circuit that increases a value by one each time a button is pressed. Put the edge directly after the contact whose change you want to catch (for example ''P2''). The name of an edge cell is the bit that remembers the previous state. If you leave the name empty, an automatic name (''#Edge…'') is used. If you use an address that the device overwrites on every scan, such as an input (''P'') address, as the name, the cell turns red, so unless you have a specific reason, leave the name empty. {{ :en-us_products:mp_studio:ladder-edge-timing.svg?1000 |Figure 6. When rising and falling edges pass power }} ===== Notes and Bookmarks ===== Select a horizontal line cell and press ''Enter'' to open the **Write Text in Wire Cell** window. Text starting with ''//'' becomes a note, and text in the form ''[name]'' becomes a bookmark. Press ''Ctrl+B'' to open the **Insert Bookmark** window, where you can insert a bookmark by entering just its name (leave the name empty to delete it). {{ :en-us_products:mp_studio:wire-memo-bookmark.png?1100 |Figure 7. The bookmark [Motor run] on row 0 and a note on row 2 }} Bookmarks are listed in the **Mark** list at the bottom of the Functions panel; click a line in the list to go to that row. You can show or hide the list with **View → Bookmark List**. ===== Editing Cells and Lines ===== ^ Shortcut ^ Menu ^ Action ^ | ''Ctrl+L'' | Edit → Insert Line | Inserts an empty row at the cursor row and pushes the rows below down. If several rows are selected, inserts that many rows. | | ''Ctrl+D'' | Edit → Delete Line | Deletes the cursor row. If several rows are selected, deletes those rows. | | ''Ctrl+Insert'' | Edit → Insert Cell | Inserts an empty cell at the cursor and pushes the cells to the right. | | ''Ctrl+Delete'' | Edit → Delete Cell | Deletes the cursor cell and pulls the cells on the right to the left. | | ''Delete'' | Edit → Delete | Clears the contents of the selected cells. | {{ :en-us_products:mp_studio:line-insert-before.png?1100 |Figure 8. Before inserting a line (cursor on row 1) }} {{ :en-us_products:mp_studio:line-insert-after.png?1100 |Figure 9. After inserting an empty row at row 1 with Ctrl+L }} If you insert an empty row in the middle of a rung (between parallel branches), the rung is broken and cells may turn red. In that case, undo with ''Ctrl+Z''. ===== Selecting ===== * **Drag with the mouse** or ''Shift+arrow keys'': select a rectangular area * ''Shift''+click: select the rectangle from the cursor to the clicked cell * ''Ctrl''+click: add or remove individual cells * **Click or drag the row numbers**: select whole rows * ''Ctrl+A'' (**Edit → Select All**): select the whole program * ''Ctrl+arrow keys'': move the selected cells in that direction {{ :en-us_products:mp_studio:selection-rect.png?1100 |Figure 10. Cells selected as a rectangular area }} ===== Copy, Paste and Undo ===== ^ Shortcut ^ Menu ^ Action ^ | ''Ctrl+C'' / ''Ctrl+X'' | Edit → Copy / Cut | Copies or cuts the selected cells. | | ''Ctrl+V'' | Edit → Paste | Pastes starting at the cursor, overwriting the cells there. | | ''Ctrl+Shift+V'' | Edit → Paste as New Rows | Inserts the copied rows at the cursor row. The rows below move down. | | ''Ctrl+Z'' / ''Ctrl+Y'' | Edit → Undo / Redo | Undoes or redoes an edit. | When a paste overwrites existing cells, a notice shows how many cells were overwritten. If that was not intended, undo with ''Ctrl+Z''. ===== Moving Rungs ===== Press ''Alt+↑'' or ''Alt+↓'' (**Edit → Move Rung Up / Move Rung Down**) to swap the rung under the cursor with the rung above or below it. Empty rows between rungs stay where they are, and one ''Ctrl+Z'' undoes the move. {{ :en-us_products:mp_studio:rung-swap-before.png?1100 |Figure 11. Before moving a rung (cursor on the P1 rung) }} {{ :en-us_products:mp_studio:rung-swap-after.png?1100 |Figure 12. After moving the P1 rung up with Alt+↑ }} A bookmark row is swapped like a rung. ===== Right-Click Menu ===== Right-click a cell or press ''Shift+F10'' to open the cell menu. {{ :en-us_products:mp_studio:cell-context-menu.png?290 |Figure 13. The right-click menu of a cell }} The menu contains Download and Monitoring, Insert Function and Insert Bookmark, Undo and Redo, Cut, Copy, Paste and Delete, inserting and deleting lines and cells, and Text Search. On a cell with an address, **Add to Watch (address)** is shown at the bottom. ===== Find and Replace ===== Press ''Ctrl+F'' or click the find box in the command bar to open the **Text Search** window. {{ :en-us_products:mp_studio:find-panel-marked.svg?1200 |Figure 14. The Text Search window with all matching cells highlighted }} - In **① Address to find**, enter the text to look for, such as ''P0'' or ''M10''. - Use **③ ↓ Next** and **↑ Previous** to move between matches. The position and number of matches (for example **1 / 3 matches**) are shown, and **④ the matching cells** are all highlighted on the canvas. - To replace, enter **② Replace with** and click **Replace** or **Replace All**. If you leave Replace with empty, the matched text is deleted. ^ Option ^ Action ^ | Match case | Distinguishes uppercase and lowercase letters. | | Also search symbols & comments | Searches symbol names and comments as well as addresses. | | Match whole word | Finds only cells whose whole address matches what you typed. | | Function block name | Searches by function block name (for example ''TON''). | | In selection only | When two or more cells are selected in the ladder, finds and replaces only within those rows. | If **Replace All** for ''M1'' would also change other addresses that only partly match, such as ''M10'', a confirmation is shown. **Replace Whole Addresses Only** replaces only cells whose whole address matches, and **Replace All Anyway** also replaces the partly matching addresses. **Cancel** replaces nothing. Function blocks can be found by the beginning of their name, but cannot be replaced. {{ :en-us_products:mp_studio:replace-confirm.png?390 |Figure 15. The Replace All confirmation when other addresses would also change }} ===== Navigation ===== ^ Shortcut ^ Menu ^ Action ^ | ''Ctrl+G'' | Search → Go to Row | Goes to a row number. You can also enter a bookmark name, symbol name or address to go there. | | ''F4'' / ''Shift+F4'' | Search → Next Use of Address / Previous Use of Address | Goes to the next or previous cell that uses the same address as the cursor cell. | | ''Alt+←'' / ''Alt+→'' | Search → Back / Forward | Returns to where you were before a long jump (find, go to row, bookmark and so on), or goes forward again. | | ''Home'' / ''End'' | — | Goes to the first or last rung of the program. | | ''PageUp'' / ''PageDown'' | — | Moves one screen at a time. | {{ :en-us_products:mp_studio:goto-line.png?480 |Figure 16. The Go to Row window }} Moves made with the arrow keys or by clicking are not recorded in the Back and Forward history. Opening another project clears the history. ===== Related Pages ===== * [[:en-us_products:mp_studio:functions|Phase 4 · Functions]] * [[:en-us_products:mp_studio:quick_reference|Quick Reference · Shortcuts]] [[:en-us_products:mp_studio|← Back to the MP STUDIO 2 User Manual]]