The leader in industrial automation and control solutions

Ladder Logic

MapleLogic offers ladder diagram language for making PLC projects. Ladder logic is entered in Scan programs.

Basic Ladder Diagram Composition

Ladder Diagram Composition within MapleLogic
  • Standard ladder diagram Scan programs will look like the diagram above
    • Step Amount:
      • Each contact, coil, instruction, etc., cost a certain amount of steps.
      • The step number for the rung is listed on the far left of the rung (highlighted in dark blue).
    • Invalid Rung:
      • Incomplete rungs or invalid rungs that are added to the program, but not saved, will show a red vertical line on the far left of the rung.
      • This rung is incomplete since there is no resulting condition attached to the normally open contact M0.1 (highlighted in red).
    • Rung Number:
      • Each new and separate rung will display the rung number with the notation R.# on the far left of the rung (highlighted in gray).
    • Valid Rung:
      • New and complete rungs will show a green vertical line on the far left of the rung (highlighted in green).
    • Unsaved Rungs:
      • Any rung that has been added to a Scan program, or any rung that has a change made to it and has not been saved, will appear highlighted.
        • In this example, the top 3 rungs are highlighted in light blue.
    • Instructions:
      • Instructions added to the Scan program will typically have a black box around them while listing the instruction name and operands, if any (highlighted in red).
    • Execution Condition (Input) → Result Instruction (Output):
      • Typically, in ladder logic, execution occurs from left to right.
      • An execution, input button for example, triggers, and the resulting output, light for example, energizes (light lights up).

Add Rungs

Step 1: add more rungs to the ladder diagram, left-click the rung where new rungs will be added. New rungs will be added above the selected rung.

New inserted rungs in MapleLogic

Step 2: Press CTRL + L to insert a new rung.

  • If changes have been made to the ladder diagram, the changed rung will appear as a different color.
  • Additionally the program title will have an asterisk, *, next to the name.
    • This means the program has NOT been saved since recent changes were made.
How to insert a new rung in ladder diagram in MapleLogic
  • Alternatively, to insert a new rung, left-click Edit and left-click Insert Row.
Left-click to insert new rung in MapleLogic

Step 3: To insert a rung below the currently selected rung, left-click the rung and press CTRL + Enter.

  • The new rung will be inserted below the selected rung.
How to insert a new rung in ladder diagram in MapleLogic
  • Alternatively, to insert a rung below the selected one, left-click Edit and left-click Insert Next Row.

Columns

Enable/Disable Columns

Select LD Grid button in MapleLogic

Step 1: Columns can be added to the ladder logic program. To enable or disable column view, left-click View and left-click LD Grid to toggle columns on or off.

Column grids in MapleLogic

Change Column Size

Change the column size in MapleLogic
  • The amount of columns per rung can be increased or decreased.
Change the column size with a button in MapleLogic

Step 1: To change the amount of columns, left-click View left-click Change LD Col.

Step 2: Specify the number of columns to display per rung.

  • Minimum: 9
  • Maximum: 80
  • Default: 11

Step 3: Left-click OK.

  • The number of columns will change.

Toolbar and Tools

Toolbar and Tools in MapleLogic

Step 1: To use the ladder logic toolbar, left-click View.

Ladder Logic Toolbar in MapleLogic
  • The ladder diagram toolbar has 14 different components:
    • Arrow
    • Erase Vertical Line
    • Delete Vertical Line
    • Horizontal Line
    • Invert
    • Normally Open Contact
    • Normally Closed Contact
    • Positive Transition-Sensing Contact
    • Negative Transition-Sensing Contact
    • Coil
    • Application Instruction
    • Comment
    • Function Block

Arrow

Arrow button in MapleLogic
  • The arrow tool will restore the mouse cursor if it is being occupied by another MapleLogic component

Erase

Erase tool in MapleLogic
  • The erase tool will delete the components of the ladder diagram.

Erase Tool

Before using the erase tool in MapleLogic

Step 1: Left-click on the component to delete

Step 2: On the tool bar, left-click Erase

  • Optionally, use the DELETE key on the keyboard
  • The erased component will be deleted

Vertical Line

Vertical Line button in MapleLogic
  • The vertical line tool will create a vertical line between rungs.

Vertical Line Tool

Using the delete vertical line tool in MapleLogic

Step 1: Left-click the rung to add the top of the vertical line.

  • This will connect the currently selected rung with the below rung.

Step 2: On the toolbar, left-click the Vertical Line icon.

  • Optionally, type SHIFT + F2 or CTRL + DOWN ARROW.
Using the vertical line tool in MapleLogic
  • A vertical line will be placed in front of the open contacts.
    • The lower of the rungs is no longer invalid.
  • This creates a basic OR gate connection.

Delete Vertical Line

Delete Vertical Line tool in MapleLogic
  • The delete vertical line tool will remove a vertical line connecting two rungs.

Delete Vertical Line Tool

Step 1: Left-click the space next to the component to delete the connecting vertical line.

Step 2: On the toolbar, type CTRL + F2 or left-click below rung and type CTRL + UP ARROW.

Using the delete vertical line tool in MapleLogic
  • The two rungs will no longer be connected.

Horizontal Line

Horizontal Line tool button in MapleLogic
  • The horizontal line tool will create a horizontal line in the same rung.

Horizontal Line Tool

Step 1: Left-click a space in the ladder diagram.

Step 2: On the toolbar, left-click the Horizontal Line icon.

  • Optionally, type F2CTRL + LEFT ARROW or CTRL + RIGHT ARROW.
Using the horizontal line tool in MapleLogic
  • Individual horizontal lines will be added into the ladder diagram.

Invert

Invert tool button in MapleLogic
  • The inversion tool will insert an inversion component to invert the signal from an execution condition.
    • If the signal from the execution condition is OFF (0), the resulting output will energize/be ON (1).
    • If the signal from the execution condition is ON (1), the resulting output will deenergize/be OFF (0).

Invert Tool

Step 1: Left-click the space to place the inversion.

Step 2: On the toolbar, left-click Invert.

  • Optionally, type F4.
Using the invert tool in MapleLogic
  • The inversion signal will show a red slash through the middle of a horizontal line.

Normally Open Contact

Normally open contact tool button in MapleLogic
  • The normally open contact tool will place a normally open contact in the ladder diagram.
    • While ON (1), normally open contacts receive a continuous source of power and execute the resulting operation until powered OFF (0).
      • The resulting operation will be executed many times per scan.

Normally Open Contact Tool

Step 1: Left-click the rung to insert a new normally open contact.

Step 2: On the toolbar, left-click Contact A.

  • Optionally, type F5.
Normally open contact tool window in MapleLogic

Step 3: Enter the data register and left-click OK.

Using the normally open contact tool in MapleLogic
  • The open contact will be added to the rung.
  • Multiple normally open contacts can be added to a rung.
    • The creates a basic AND Gate connection.

Normally Closed Contact

Normally Closed Contact button in MapleLogic
  • The normally closed contact tool will place a normally closed contact in the ladder diagram.
    • While OFF (0), normally closed contacts output a continuous source of power and execute the resulting operation until powered ON (1).
      • The resulting operation will be executed many times per scan.
    • For more information, refer to closed contacts.

Normally Closed Contact Tool

Step 1: Left-click the rung to insert a new normally closed contact.

Step 2: On the toolbar, left-click Contact B.

  • Optionally, type F6.
Select Register for the Normally Closed Contact in MapleLogic

Step 3: Enter the data register and left-click OK.

Using the normally closed contact in MapleLogic
  • The closed contact will be added to the rung.
  • Multiple normally closed contacts can be added to a rung.
    • Thos creates a basic AND Gate connection.

Positive Transition-Sensing Contact

Positive Transition-Sensing contact button in MapleLogic
  • The positive transition-sensing contact tool will place a positive transition-sensing contact in the ladder diagram.
    • The resulting operation will be executed once each time the contact receives power.
    • The execution condition is executed on the rising edge of a pulse
    • For more information, refer to rising edge contacts.

Positive Transition-Sensing Contact Tool

Step 1: Left-click the rung to insert a new positive transition-sensing contact.

Step 2: On the toolbar, left-click Pulse Up.

  • Optionally, type F7.
Select register for positive transition-sensing contact in MapleLogic

Step 3: Enter the data register and left-click OK.

Using positive transition-sensing contact in MapleLogic
  • The positive transition-sensing contact will be added to the rung.
  • Multiple positive transition-sensing contacts can be added to a rung.
    • This creates a basic AND Gate connection.

Negative Transition-Sensing Contact

Pulse Down button in MapleLogic
  • The negative transition-sensing contact tool will place a negative transition-sensing contact in the ladder diagram.
    • The resulting operation will be executed once each time the contact receives power.
    • The execution condition is executed on the falling edge of a pulse.
    • For more information, refer to falling edge contacts.

Negative Transition-Sensing Contact Tool

Step 1: Left-click the rung to insert a new negative transition-sensing contact.

Step 2: On the toolbar, left-click Pulse Down.

  • Optionally, type F8.
Select register for pulse down contact in MapleLogic

Step 3: Enter the data register and left-click OK.

Use pulse down contact in MapleLogic
  • The negative transition-sensing contact will be added to the rung.
  • Multiple negative transition-sensing contacts can be added to a rung.
    • This creates a basic AND Gate connection.

Coil

Toolbar Coil button in MapleLogic
  • The coil tool will create a coil at the end of a rung.

Coil Tool

Before using coil tool in MapleLogic

Step 1: Left-click on any space in the rung.

Step 2: On the toolbar, left-click Coil.

  • Optionally, type F9.
Select register for a coil in MapleLogic

Step 3: Enter the data register and left-click OK.

Using coil tool in MapleLogic
  • The coil will be placed at the end of the rung.
    • Only one coil can be placed per rung.
    • It is advised to have one occurrence of each coil per scan program.

Application Instruction

The application instruction button in MapleLogic toolbar
  • The application instruction tool will insert an application instruction into the ladder diagram.
  • Most application instructions will execute a command/instruction when the execution condition is true.
    • Refer to the Application Instruction section for more information.

Application Instruction Tool

Before using coil tool in MapleLogic

Step 1: Left-click on any space in the rung.

Step 2: On the toolbar, left-click Application Instruction.

Instruction tool window in MapleLogic
  • Optionally, type F10, or type any character on the keyboard
  • The application instruction window will appear.

Step 3: Type the name of the instruction in the Instruction tab, or select the instruction category on the left and instruction on the right.

Selecting Add instruction in the application instruction window in MapleLogic
  • The isntruction format will appear in the Instruction tab.

Step 4: Select the data registers required for the instruction.

Step 5: Left-click OK.

  • Optionally, left-click Basic for a basic view of the instruction list.
Basic selected in the application instruction window in MapleLogic
  • Left-click Details to return to the previous view.
Using the application instruction in MapleLogic
  • The instruction will appear after the execution condition.

Comment

Comment button in MapleLogic
  • The comment tool will insert a comment into the ladder diagram for organizational use.

Comment Tool

Comment tool button in MapleLogic

Step 1: Left-click on any space in the rung.

  • The comment will be placed above the currently selected rung.

Step 2: On the toolbar, left-click the Comment icon.

  • Optionally, type F12.
Before using the Comment tool in MapleLogic

Step 3: Enter the comment into the Input Comments window.

  • To enter a new line, type CTRL + ENTER.
  • To add a date to the comment, left-click Add Date.
  • To add a row of asterisks (*), left-click *******.
  • To add a row of dashes (-), left-click ——–.
  • To change the color of the comment, left-click Color.
  • To add the comment as a historical comment to use elsewhere, left-click Add Cmt.

Step 4: Left-click OK.

Using the Comment Tool in MapleLogic
  • The comment will appear above the rung.

Add Function Block

Add Function Block button in MapleLogic
  • The add function block tool will insert a function block into the ladder diagram.

Add Function Block Tool

Before using coil tool in MapleLogic

Step 1: Left-click on any space on the rung.

Step 2: On the toolbar, left-click Add FB.

  • Optionally, type SHIFT + F9.
Add Function Block button in MapleLogic

Step 3: Left-click a function block group.

Step 4: Left-click a function block.

  • The function block requirements will appear in the FB Preview window.

Step 5: Left-click OK.

  • The function block will appear in the ladder diagram.

Step 6: Double left-click on the function block to edit the data registers.

Step 7: Enter the data registers under the Device tab.

Step 8: Left-click OK.

  • The function block will now display the data registers.

Save Program

Save All button in MapleLogic

Step 1: To save the program, left-click Home and left-click Save All.

Save Program button in MapleLogic
  • Optionally, left-click Project and left-click Save Program.