Rungs.dev Documentation

website·Indexed 31 days ago

https://rungs.dev

A guide to building, simulating, testing, and sharing PLC programs in Ladder Logic. Modeled on Studio 5000 Logix Designer, Rungs.dev includes a full reference for instructions (XIC, XIO, OTE, TON, CTU, etc.), data types, tag usage, and YAML-based AOI unit tests. Features the Relay AI Assistant for debugging and explaining PLC code, and supports exporting to .L5X files.

Tokens
46K
Snippets
174
Records
368
Agent score
53%

What's inside Rungs.dev

  1. Overview of rungs.dev data types

    Every tag in rungs.dev must have a data type, which determines its value range, memory usage, and compatible instructions.

    TypePrimary Use Case
    BOOLDigital inputs/outputs, contacts, coils, and status bits
    SINT8-bit bytes, packed status, serial data (-128 to 127)
    INT16-bit device registers, drive words, Modbus registers (-32,768 to 32,767)
    DINT32-bit counts, presets, and general numeric values
    REAL32-bit floating-point analog values and calculations
    TIMERLadder timer tags (used by TON, TOF, RTO)
    COUNTERLadder counter tags (used by CTU, CTD)
    CONTROLLadder array tags (used by BSL, FFL, FAL)
    FBD_TIMERStructured Text timer function blocks (TONR, TOFR, RTOR)
    FBD_COUNTERStructured Text counter function blocks (CTUD)
    FBD_ONESHOTStructured Text one-shot function blocks (OSRI, OSFI)
  2. Overview of Bit Instructions in rungs.dev

    Bit instructions are the fundamental building blocks of Ladder Logic in rungs.dev. They are used to examine or control a single BOOL value. These instructions are categorized into Contacts (which examine bits on the input side) and Coils (which act on bits on the output side). A standard rung flow is: contacts → (optional more contacts) → coil.
  3. Overview of Rungs.dev PLC Simulator

    Rungs.dev is a browser-based PLC simulator designed for learning, building, and testing PLC programs. It supports both Ladder Logic (LD) and Structured Text (ST) and requires no software installation. Key capabilities include:

    • Designing ladder diagrams and writing Structured Text code.
    • Real-time simulation of program execution.
    • Writing unit tests to validate program behavior.
    • Plotting live values using trend charts.
    • Accessing Relay, a built-in AI assistant for help.
    • Sharing projects with other users.
  4. Overview of Ladder Logic Array Instructions

    Array instructions in rungs.dev operate on a run of elements (e.g., a stretch of a DINT array or a buffer window) rather than single values. Most of these instructions require a CONTROL tag to maintain state (tracking the number of elements and the current position) between scans.
  5. Overview of Rungs Studio Ladder Logic Editor features

    Rungs Studio is integrating a visual, rung-based Ladder Logic editor to work alongside Structured Text within its browser-based PLC simulator. The editor is designed for AOI-style development, including tags, tests, simulation, trends, and versioned .rungs files.
  6. Overview of rungs.dev PLC playground

    rungs.dev is a browser-based PLC (Programmable Logic Controller) playground designed for isolating, simulating, and documenting Add-On Instructions (AOIs). It allows developers to write, test, and share logic without requiring physical hardware, Windows-specific installations, or expensive Studio 5000 licenses.
  7. Overview of Relay AI Assistant in Rungs Studio

    Relay is an integrated AI assistant within Rungs Studio that helps developers explain PLC code, debug Ladder Logic, and resolve compiler errors. Unlike general chatbots, Relay has direct access to the active project context, including:

    • Ladder Logic rungs or Structured Text in the active editor
    • Tag names, data types, usage, default values, and descriptions
    • Compiler errors and warnings
    • Test files and the latest test results
    • The currently open editor tab

    Relay is designed as a learning tool that suggests incremental changes rather than providing full code rewrites or complete solutions to exercises.

  8. Overview of Structured Text (ST) for PLCs

    Structured Text (ST) is a high-level, text-based programming language used for Programmable Logic Controllers (PLCs). Unlike graphical languages like Ladder Logic, ST resembles traditional programming languages such as Pascal, C, or Python. It is designed for engineers and developers who need to implement complex control logic, mathematical calculations, or data handling.
  9. Understand rungs.dev service limitations and safety warnings

    rungs.dev is an educational and development tool for PLC programming (Structured Text and Ladder Logic). It is NOT certified for use in industrial control systems, safety-critical applications, or production PLC environments. Users must independently verify logic using certified tools before deploying to physical hardware; simulation results may not match specific PLC platform behaviors.
  10. Calculate average and standard deviation of array elements

    The AVE and STD instructions process a run of array elements to provide signal smoothing (moving average) or stability analysis.

    • AVE: Sums a run of array elements and stores the average in a destination tag. Useful for smoothing noisy sensor readings.
    • STD: Calculates the sample standard deviation (dividing by N-1) to determine how much a signal is jumping around. A high value indicates instability.

    Both instructions are one-shots: they execute only on the transition of the rung from false to true. To recompute with new data, the rung must be toggled false and then true again.

  11. Understand Ladder Logic (LD) fundamentals

    Ladder Logic (LD) is a visual, rung-based programming language used for Programmable Logic Controllers (PLCs). It mirrors physical relay wiring diagrams, consisting of horizontal 'rungs' between two vertical power rails. Logic is evaluated from left-to-right; if the conditions on the left are true, the output on the right is energized. The execution is predictable, scanning every rung from top-to-bottom on every cycle.