PLC Programming

Control your simulation with visual diagrams or code

PLC Programming

A PLC (Programmable Logic Controller) program is what makes your simulation come alive. It reads sensor inputs, runs your control logic, and drives outputs like conveyor speeds and actuator positions.

Two Ways to Program

Sim Assist gives you two programming languages — pick the one that fits your style:

Function Block Diagrams (FBD)

Visual programming with drag-and-drop blocks. Connect inputs to outputs by drawing wires. Great for beginners and quick prototyping.

[IMAGE: FBD editor showing a simple conveyor control program with timer and sensor blocks connected]

Best for: Learning PLC programming, simple logic, visual thinkers

Structured Text (ST)

Text-based programming similar to Pascal. Write code directly. More powerful for complex logic and math.

[IMAGE: ST editor showing equivalent conveyor control code with syntax highlighting]

Best for: Experienced programmers, complex calculations, reusable logic

You can use both in the same project — each PLC in your project can use either language.

How It All Connects

Your PLC program talks to the 3D scene through Input Nodes and Output Nodes:

Sensors (Input Nodes)  →  Your PLC Program  →  Actuators (Output Nodes)
     ↑                                              ↓
     └──────────── 3D Scene (Physics) ──────────────┘
  1. Input Nodes feed sensor data into your program (e.g., "Is the photoelectric sensor detecting a box?")
  2. Your program processes the logic (e.g., "If sensor is active, stop the conveyor")
  3. Output Nodes drive the scene (e.g., set conveyor speed to 0)

[IMAGE: Diagram showing the data flow between scene, input nodes, PLC program, and output nodes]

The Scan Cycle

Your PLC program runs in a continuous loop, just like a real PLC:

  1. Read inputs — Sensor values are captured from the scene
  2. Execute program — Your logic runs once (one "scan")
  3. Write outputs — Results are sent back to the scene
  4. Update physics — Objects move, collide, and interact
  5. Render — The 3D view updates

This cycle repeats every frame (60 times per second by default).

[IMAGE: Circular diagram showing the 5 scan cycle steps]

Getting Started

  1. Open your project and click on a PLC in the sidebar
  2. Choose your language: FBD (visual) or ST (code)
  3. Write your control logic
  4. Open a Scene and click Run to test

Next steps:

On this page