PLC Ladder Logic Programming, Tag Configuration, and Verification

Ladder Logic Instruction Placement

  • Instruction Positioning:
    • Instructions added to a ladder logic routine can be positioned directly to the right of existing instructions.
    • Double-clicking an instruction automatically places it to the right of the last selected instruction on the rung.
  • Normally Open Contacts:
    • Normally open contact instructions are brought down onto the rung.
    • Instructions must subsequently be assigned and added to tags within the instruction ladder.

Creating and Configuring New Tags

  • Tag Creation Workflow:
    • Click on the instruction drop-down menu, which displays a question mark (?).
    • Right-click directly on the question mark (?) symbol to bring up the context menu.
    • Select New Tag from the menu options.
    • Type the desired tag name into the name field (e.g., push button one).
  • Tag Usage Settings:
    • Configure the Usage parameter to establish scope and visibility:
    • Local Usage: Restricts access to the tag, keeping it local to the specific routine or program.
    • Shared Usage: Allows the tag to be shared across broader program scopes.
  • Data Type Selection:
    • Select the appropriate data type based on the underlying element:
    • Boolean: Selected when the tag represents a single bit (bit).
    • Timer: Selected for timing structures.
    • Numeric: Selected for numerical parameters or mathematical functions.

Tag Scopes and Address Aliasing

  • Address Aliasing:
    • Tags such as push button one can be mapped directly to a physical address using an alias.
    • To map an alias:
    1. Select the Alias field for the tag.
    2. Double-click the address selection menu.
    3. Navigate down through the list to select the specific routine name, tag, and bit number.
    4. Press the Enter key to complete the address binding.
  • Controller Tags vs. Local Tags:
    • Controller Tags: Located and managed within the parameters section, accessible across the controller.
    • Local Tags: Located in individual routine windows to keep access localized.

Data Entry Types: Immediate vs. Tag Values

  • Methods for Entering Numerical Data:
    • Numerical inputs used for timers, counters, or mathematical functions can be entered using two distinct methods:
    1. Immediate Value: Directly entering a fixed numerical literal into the field (e.g., typing an immediate value of 500500).
    2. Tag Value: Referencing a dynamic tag parameter (e.g., referencing a tag named parts made tied to a counter, which dynamically reads and retrieves the live count from that counter).

Program Documentation and Rung Comments

  • Importance of Documentation:
    • Thorough documentation is vital so external technicians or future programmers can interpret program operations.
    • Lack of comments leads to severe operational difficulties during off-shift troubleshooting when the original programmer is absent.
    • Former students have reported having to log into programs authored by Terry at 03:00 AM03:00\text{ AM} over a weekend to diagnose operational issues, underscoring the real-world value of comprehensive rung comments.
  • Editing Rung Comments:
    • Right-click on the rung handle in the editor.
    • Select Edit Rung Comment.
    • Type a clear, concise sentence explaining the exact control function occurring on that rung.
    • While the editor accepts extensive text entries, comments should remain clean, organized, short, and structured.

Program Verification and Error Checking

  • Verification Routine:
    • Code must be checked for structural and logical errors before downloading to a Programmable Logic Controller (PLC).
    • Click the Check Page tool on the top toolbar to initiate full program verification.
  • Errors Identified by Verification:
    • Empty Instructions: Instructions left unassigned or incomplete on a rung.
    • Bad Instruction Calls: Invalid or mismatched instruction logic.
    • Bad Tag Names: Unassigned, missing, or improperly referenced tags.
  • Error Resolution:
    • The verification tool highlights exact error locations, allowing all issues to be reviewed and corrected prior to performing a controller download.