Topic: DMD0220 The Ladder Editor |
|
Edit Mode vs. Display ModeLadder Views have two viewing modes; the Display Mode and the Edit Mode. When a project is first opened, the Ladder View will be in the Display Mode, which is only a viewing mode. A code-block cannot be edited in this mode. In order to edit the contents of a code-block, the Ladder View must be in the Edit Mode. To enable the Edit Mode, either click on the Edit Mode button on the Offline toolbar, or select the Edit-> Edit Mode menu option, or use the keyboard shortcut Ctrl+E.
Note: there is visible confirmation that the Edit Mode is enabled: the edit cursor changes from a hollow box to a solid box, the background changes for the Edit Mode button on the Offline toolbar, and the elements in the Ladder Palette are enabled.
Note: Edit Mode and Display Mode are not selected for individual code-blocks, meaning that if there are multiple code-blocks open at the same time, enabling Edit Mode enables Edit Mode for all of the currently open code blocks, and any code blocks that are opened while Edit Mode is enabled.
Edit Mode only applies to Ladder views; the System Configuration and Element Documentation can be changed without Edit Mode being enabled. The Project Browser DOES require that a code-block be in edit mode before the configuration of that code-block can be changed.
|
Project Changed Bars
A
A
Note: at the same time the Write PLC button was enabled, the Read PLC button was also enabled. This allows the programmer the option to restore the program to the state that it was before the changes were made. The Read PLC operation will refresh the screen with the previously saved version of your program.
Note: the Project Differences indicators on the Status Bar will also indicate any differences between the Disk and controller versions of the project.
|
Creating Nicknames for Program ElementsNicknames are user-assigned alternate names for programming elements. Once a Nickname has been assigned to an element the Nickname and the Element ID can be used interchangeably within the project. Any time an instruction editor is closed with an unknown Element reference, the programmer will be presented with the Create Nickname dialog.
Associated Element - displays
the memory element that will be associated with the Nickname Create nickname and ... - selects
what action to perform with the nickname
|
|
Accept ChangesAny changes that are made to the contents of a code-block must be accepted before they can be downloaded to the controller. The Accept operation will optimize the way that rungs are drawn - only valid rungs will be optimized, invalid rungs will not be changed. As noted above, any rungs that have been changed will be flagged with a Yellow change bar. Once the rungs are accepted with no errors, the yellow bar will go away and a green bar will appear. If the programming session is online, a cyan bar will also appear.
Note: Accepting Changes is not selected for individual code-blocks, meaning that if there are multiple code-blocks that have been changed an Accept operation will be applied to all of the currently open code blocks.
A part of optimizing a rung is checking the rung for incorrectly drawn or unconnected programming elements: what follows is a list of the common drawing errors and how to resolve them.
ORing two complex output elements which aren't AND's or JOIN's
Problem: This message may be displayed for a rung that contains additional input logic on a leg of a midline output that is illegal. After the vertical wire has been dropped to AND a sub-rung with a midline output, no additional input logic may appear on each leg of the midline output.
Solution: Edit the rung and re-enter all of the common logic in each leg that had additional input logic. This will create additional rungs, but they will be logically equivalent to the original rung.
Trying to AND above a JOIN
Problem: This message may be displayed for a rung that contains additional input logic on the leg of a mid-line output that is illegal. After the vertical wire has been dropped to AND a sub-rung with a mid-line output, no additional input logic may appear on the leg of the mid-line output.
Solution: Edit the rung and delete all contacts that appear after the vertical wire on the leg of the mid-line output.
Shorted Input Legs
Problem: This message may be displayed for a rung that contains a box instruction that has multiple inputs legs that have been shorted together. Each input leg of a box must be independently connected to the power rail.
Solution: connect each input leg independently to the left power rail.
Conditional Outputs Require Input logic
Problem: This message will be displayed for a rung that contains a box instruction that has one of it's inputs directly connected to the power rail.
Solution: connect each input leg to the left power rail with a ladder logic contact instruction.
|
|
How to Enter Contacts on a RungAfter enabling Edit Mode, entering new contacts on a rung can be done
using any of the following methods:
After selecting the type of contact to enter, the Contact Instruction Editor will be displayed with either the parameter that was selected, or with the default parameter for the type of Contact selected.
While the parameter field is being edited, the instruction will display an "auto-complete" drop-down below the parameter field. This drop-down will display any valid range of memory locations that match the characters entered in the field. As more characters are entered the ranges displayed will change to continue displaying matches.
As the cursor moves through the list the Item or Range under the cursor is entered in the parameter field. If the value is one of the Ranges of Memory Elements, the parameter will need to be edited further so that just the one parameter from that range remains in the field. |
|
After supplying the required parameters, pressing the Enter key or clicking on the button with the check mark in upper left corner of the Contact Instruction editor will enter the contact on the rung and the edit cursor will move to the next entry position. A vertical yellow change bar will appear to the left of the left of the rung. As noted earlier, the yellow bar indicates that some type change has been made to the rung but the change has not been Accepted.
|
|
How To Enter Output Coils on a RungEntering output coils on a rung is a very similar process to entering contacts, the main difference is that all of the output coils are placed in a single column at the far right edge of the Ladder View, this is called the output column.
After enabling Edit Mode, entering new coils on a rung can be done using
any of the following methods:
After selecting the type of coil to enter, the Coil Instruction editor will be displayed with either the parameter that was entered, or with the next unused default parameter for the type of Coil selected.
After supplying the required parameters, pressing the Enter key or clicking on the button with the check mark in upper left corner of the Coil Instruction editor will enter the coil on the rung. A vertical yellow change bar will appear to the left of the rung. As noted earlier, the yellow bar indicates that a change has been made to the rung but the change has not been Accepted.
|
|
How to Enter Box Instructions on a RungLike output Coils, all Box instructions are placed in a single column at the far right edge of the Ladder View, this is called the output column.
After enabling Edit Mode, entering new boxes on a rung can be done using
any of the following methods:
After supplying the required parameters, pressing the Enter key or clicking on the button with the check mark in upper left corner of the Box Instruction editor will enter the box on the rung. A vertical yellow change bar will appear to the left of the rung. As noted earlier, the yellow bar indicates that a change has been made to the rung but the change has not been Accepted. |
Entering power rail instructions needs special consideration. Power rail instructions are box instructions that are displayed in the power rail of the Ladder View, not in the output column like the other box instructions. Even though these instructions are displayed in the left-most column of the ladder diagram (the power rail), they are still created in the right-most column of the ladder logic diagram (the output column).
This makes creating the instructions in Do-more Designer a bit counter-intuitive in that the first step is to position the edit cursor in the output column of the ladder logic diagram (the far right) instead of positioning it against the power rail (the far left).
After selecting the type of power rail instruction the Box Instruction editor will then be displayed in the far left column (the power rail).
After entering the required parameters for the power rail instruction the box will be drawn as follows:
The following is a list of the power rail instructions: SG - Stage, SGCONVRG - Converge Multiple Stages to SG
FOR - Index Loop
/ NEXT - Index By
Step REPEAT
- Loop Until Condition is Non-Zero / UNTIL
- Repeat Until Condition is Non-Zero WHILE - Loop While Powerflow is True / WEND - While End
|
|
The Ladder Instruction PaletteThe Ladder Instruction Palette is a modeless dialog that provides a graphical list of all the instructions available for use in the current Do-more Designer project. Hovering the cursor over any of the instruction mnemonics will display a tooltip with a short version of the instruction help, clicking on the Tooltip will display the full version of that instruction's Help documentation.
Show this palette automatically when in 'Edit Mode' - the default selection will cause the instruction palette to be displayed any time a Ladder View has Edit Mode enabled and a Ladder View has focus. Uncheck this feature to prevent the Ladder Palette from being displayed.
Click the Options button to invoke the Options dialog where changes can be made to the Instruction Palette display. The available options are discussed below.
Click the Close button to close the Instruction Palette dialog. The ladder palette will be displayed again the next time Edit Mode is enabled. |
The Options dialog of the Ladder Instruction Palette provides control over the following:
|
|
How To Delete Contacts, Coils, or Box InstructionsDeleting contacts, coils or box instructions from a rung of ladder logic is accomplished by enabling Edit Mode, then placing the Edit cursor over the contact, coil or box instruction to be deleted and pressing the Delete key, or the Edit-> Delete menu selection.
The Backspace key can also be
used to delete the contact to the immediate left of the edit cursor. Unlike
the Delete operation which will leave a gap in the connecting wire, this
operation will redraw the connecting wire in place of
Depending on what element was deleted, and where it was located on the ladder logic rung, the delete process may leave a gap in the connecting wire. A gap in the connecting wires can be corrected by drawing new connecting wire (as described below), or possibly just Accepting the changes (which will optimize the rung and redraw it if needed).
|
|
How To Draw Wires Between Contacts and CoilsCreating complex ladder logic requires the ability to "draw" networks of input contacts and the ability to connect multiple output coils or box instructions in parallel. Do-more Designer uses the Ctrl key with the arrow keys to draw connecting wires in the direction of the arrow.
Wire Right (Ctrl + Right Arrow) - draws a horizontal wire in the current cursor location and moves the cursor to the right. Note: drawing a connecting wire over the top of a contact will not delete that contact; it will simply connect it if needed.
Wire Left (Ctrl + Left Arrow) - draws a horizontal wire in the current cursor location and moves the cursor to the left. Note: drawing a connecting wire over the top of a contact will not delete that contact; it will simply connect it if needed. Wire Down (Ctrl + Down Arrow) - draws a vertical wire along the left edge of the edit cursor down from the current cursor location and moves the cursor down to the next row.
Wire Up (Ctrl + Up Arrow) - draws a vertical wire along the left edge of the edit cursor up from the current cursor location and moves the cursor up to the previous row.
Wire to Output Column (Ctrl +W) - draws a connecting wire from the current cursor location all the way to the output column. Pressing it again will remove the connecting wire that was just drawn.
During the process of editing ladder logic rungs, there will be times when a connecting wire needs to be deleted. Do-more Designer uses the Ctrl key and the Shift key with the arrow keys to delete connecting wires in the direction of the arrow.
Wire Delete Right (Ctrl + Shift + Right Arrow) - deletes the horizontal wire or programming element in the current cursor location and moves the cursor to the right.
Wire Delete Left (Ctrl + Shift + Left Arrow) - deletes the horizontal wire or programming element in the current cursor location and moves the cursor to the left.
Wire Delete Down (Ctrl + Shift + Down Arrow) - deletes the vertical wire along the lower left edge of the edit cursor and moves the cursor down to the next row.
Wire Delete UP (Ctrl + Shift + Up Arrow) - deletes the vertical wire along the upper left edge of the edit cursor and moves the cursor up to the previous row.
|
|
How To Insert Rungs, Rows, or Columns
What? - designates whether Rungs,
Rows or Columns are to be inserted
Note: to quickly insert one new row before the current row, place the edit cursor at the far left edge beginning of the current row (next to the power rail), and press the Enter key. To quickly add one new row after the current row, place the edit cursor anywhere on the current row except at the far left edge, and press the Enter key, or press Ctrl+ Enter.
Where? - specifies where to
insert the new rungs, rows, or columns relative to the edit cursor position
How Many? - designates how many rungs, rows or columns to insert. The default value is one. Enter the desired number in the space provided.
Click the OK button to perform the Insert operation.
Click the Cancel button to close the Insert dialog without performing the insert operation.
|
|
How To Merge Multiple Rungs into a Single RungThere may be times during editing sessions when the ladder logic on two adjacent rungs need to be combined into a single rung. One way to accomplish this is to edit one rung and manually add all of the needed ladder logic from the adjacent rung, manually copy / paste the rung comment text from the adjacent rung, and then delete the adjacent rung. A better way is to use the Merge feature to combine the ladder logic and the Rung Comments on two adjacent rungs into a single rung.
Position the Edit cursor on one of the rungs to merge, then select the appropriate Merge selection from the Edit menu:
This example shows two simple rungs before being merged:
This is the same two rungs after being merged:
Notice that both rungs of ladder logic are now at rung #1, and that a yellow Changed Bar is displayed at the left edge, and that Rung #2 is now empty. At this point the programming elements on this new rung need to be manually rearranged and the Rung Comment text needs to be manually edited.
|
|
How To Delete Entire Rungs
Deleting multiple rungs is done through the Select for Delete operation as described in the next section. |
|
Click the OK button to delete the rung.
Click the Cancel button to close the dialog without deleting the rung.
Note: after a rung delete operation has been executed, the Save to Disk, Read PLC, and Write PLC buttons will be enabled which signifies that the on-screen copy of the project does not match the copy stored on Disk and the copy stored in the controller. |
|
How To Select Rungs for Cut, Copy, Paste and DeleteThere will be times when building ladder logic programs that complete rungs of ladder logic need to be moved or duplicated within the same code-block, or a different code-block, or even a different project. Do-more Designer provides this functionality by allowing the programmer to select the rungs and use either a Cut or Copy function within the source code-block, then paste the selected rungs in the destination code-block.
Selecting a rung of ladder logic also selects the Rung Comment if it exists, so any Cut, Copy, Paste or Delete operation that is performed on a rung will also affect the Rung Comment.
The first step is to select the rungs in the source code-block. This is done by positioning the cursor on the first rung of the selection then use the appropriate keystroke sequence as described below. Each rung that is selected is highlighted with a different background color.
Note: only entire rungs of ladder logic can be selected, not individual programming elements on a rung.
Note: before a rung can be selected for a Cut or Copy operation, any changes to the rung must be Accepted.
Select Up ( Shft + Up Arrow
Select Down ( Shft + Down Arrow or
Select Home ( Ctrl + Shft + Home ) - selects all of the rungs from the current rung to the beginning of the code-block.
Select End ( Ctrl + Shft + End ) - selects all of the rungs from the current rung to the end of the code-block.
The following example shows rungs numbers 2 and 3 have been selected:
After selecting the rungs, choose one of the following operations to perform on the selection:.
When pasting the Clipboard contents into a different Do-more Designer project, the Paste Options dialog box will be displayed where the programmer can specify how to handle Element Documentation. Don't paste
documentation - pastes only rungs and rung comments. It does NOT
paste documentation for the elements in the rungs. See notes below on
nicknames. Note: Nicknames must be unique
within a project, so, if the Clipboard contains a programming element
with a Nickname that already exists in the target project, AND the two
Nicknames are tied to two different programming elements, the pasted Nickname
will be 'mangled' to create a unique nickname. Any Nickname that must
be mangled will be listed in the Output Window. Click
the Paste It! button to perform
the Paste operation.
|
|
See Also:
|
|