v1.100 ← Back to Simulator

What is a 3D Scene?

Interactive machine visualisations that respond to your PLC program

A 3D Scene is a browser-based, real-time simulation of an industrial machine or process. Each scene renders a realistic three-dimensional environment using WebGL and responds directly to the outputs of your ladder logic program running in the ACC PLC Simulator.

Scenes bridge the gap between writing ladder logic on a screen and seeing it control something physical. When your program turns an output ON, the machine in the scene moves, lights up, or changes state — exactly as it would on the real shop floor.

Why Use Scenes?

Traditional PLC learning involves either expensive hardware, simulator software that only shows abstract I/O states, or waiting until a real machine is available. Scenes solve all three problems:

  • No hardware required — everything runs in your browser, no downloads or licences
  • Visual feedback — you see the machine respond, not just LED indicators change colour
  • Safe to experiment — wrong logic doesn't damage anything; just fix it and try again
  • Real-world context — each scene explains why the machine works the way it does

What Makes a Scene Realistic?

Each scene is built with physically accurate proportions and industrial details — control panels with real pushbutton geometry, conveyors with belt texture and rollers, tanks with semi-transparent walls showing fluid level, traffic signals casting coloured light onto the road surface. The goal is to make the virtual machine feel like the real thing so that the skills you develop transfer directly to the floor.

Tip: Open a scene in a separate browser window alongside the simulator for the best experience. Use two monitors if available — simulator on one, scene on the other.

How It Works

The communication link between simulator and scene

The ACC PLC Simulator and a 3D Scene communicate through the browser's BroadcastChannel API — a built-in messaging system that lets two pages in the same browser exchange data without a server.

The Communication Loop

  1. Your ladder program runs in the simulator — every scan, it evaluates contacts and updates outputs (Y addresses).
  2. At the end of each scan, the simulator broadcasts a plc-state message containing all Y output values and the current run state.
  3. The scene receives this message and immediately updates its 3D objects — motors spin, cylinders extend, lights change colour.
  4. When sensors in the scene change state (a box arrives at a sensor, a limit switch trips), the scene sends a scene-inputs message back with all X input values.
  5. On the next scan, the simulator reads those updated X values and your ladder logic responds accordingly.

This loop runs at the simulator's scan rate — typically 50–200ms — fast enough to feel real-time on screen.

Channel Name

All scenes use the channel name acc-plc-link. The simulator broadcasts on this channel and all open scenes listen on it. Only one scene should be open and connected at a time.

Heartbeat

The simulator sends a ping message every 500ms. If the scene misses several pings (e.g. the simulator was closed), it automatically disconnects and reverts to standalone mode.

Want to connect a real PLC? The ACC Modbus Bridge is a second communication path that links the scene to an external Modbus TCP or RTU master — a real hardware PLC, SCADA package, or Modbus Poll. See the Modbus Bridge section in the left navigation for the full guide.

I/O Mapping

How PLC addresses correspond to scene devices

Every scene publishes a fixed I/O map — a list of which PLC addresses correspond to which physical device in the scene. This map is shown on the scene's connection card in the simulator's Connect modal, and in the scene's own About dialog.

Inputs (X) — Scene → Simulator

Inputs are set automatically by the scene. You cannot directly force them from the simulator while a scene is connected — the scene is the authoritative source. Examples:

  • A proximity sensor turns X3 ON when a box arrives at its position
  • A limit switch turns X2 ON when an arm reaches its home position
  • A float switch turns X1 ON when a tank fills to the low level

Outputs (Y) — Simulator → Scene

Outputs are set by your ladder program. When your program energises Y1, the corresponding device in the scene activates. Examples:

  • Y1 ON → conveyor belt starts moving
  • Y2 ON → arm extends toward pick position
  • Y4 ON → inlet valve opens, fluid enters tank
Note: The I/O map for each scene is defined in acc-scenes.js. This file also registers scenes in the Connect modal. To add your own custom scene, follow the same format.

Physical vs. Internal I/O

Only physical I/O (X and Y addresses) is transmitted between the simulator and scene. Internal coils (C), timers (T), and counters (CT) exist only inside the simulator and are never broadcast — they are purely part of your program logic.

Connecting to the Simulator

Step-by-step: linking a scene to your running program

  1. Open the ACC PLC Simulator (acc-plc-simulator.html) in your browser.
  2. Click the ⬡ CONNECT button in the simulator toolbar. The Connect modal opens showing all available scenes.
  3. Click the scene card you want to open. The scene opens in a new browser window.
  4. Within a few seconds the scene's link badge turns blue and shows SIM LINKED. The simulator toolbar also shows the connected scene name.
  5. Press F5 or click RUN in the simulator. Your program starts scanning and the scene responds.
Important: Open the scene as a separate window, not a tab. Browsers throttle timers and BroadcastChannel messages in background tabs, which causes sluggish response. Use your browser's "Open in new window" option or the Connect modal handles this automatically.

Disconnecting

Close the scene window, or click STOP in the simulator. The scene reverts to standalone mode after a 2-second timeout if it stops receiving heartbeats.

Standalone Mode

Running a scene without the simulator

Every scene can run its own built-in demonstration sequence when no simulator is connected. This lets you explore the machine visually before writing any code.

Starting Standalone

Open any scene HTML file directly in a browser. If no simulator connects within a few seconds, the scene enters standalone mode. Press the ▶ RUN button in the scene's toolbar to start the built-in sequence.

What Standalone Shows

The standalone sequence demonstrates the machine's full cycle of operation — exactly the behaviour your ladder program should eventually produce. Watch it carefully as part of Step 3 (Sequence of Operation) in your program development process.

Tip: The event log at the bottom of the input panel shows each step as it happens in standalone mode. This is a useful reference when writing your own ladder program.

Standalone vs. Simulator

In standalone mode, the scene drives its own outputs internally — your ladder has no involvement. When the simulator is connected, the scene becomes purely reactive — it only moves when your program commands it to. This is the real test of your program.

Manual Output Testing

Exploring machine behaviour by toggling outputs directly

Every scene supports a manual test mode when it is stopped and not connected to the simulator. In this mode you can click any output row in the left panel to toggle that output ON or OFF — the 3D machine responds immediately.

How to Use

  1. Open a scene directly in your browser (no simulator needed).
  2. Ensure the scene is in STOP mode — do not press RUN.
  3. The OUTPUTS panel header shows Y — TEST MODE to indicate outputs are clickable.
  4. Click any output row. The LED lights and the machine responds in the 3D view.
  5. Click the row again to turn it off.
  6. Pressing RUN immediately disables manual toggling — the automatic sequence takes over.
Tip: Hover over any output row to see a subtle CLICK hint on the right side, confirming it is in a toggleable state.

What This Teaches

Manual testing is the best way to understand what each output actually does before writing any ladder logic. Work through each output in order:

  • Turn Y1 ON — what moves? What sensor inputs change as a result?
  • What combinations of outputs produce useful machine states?
  • What happens if you energise an output that requires another to be active first?

This directly supports Step 1 (Define the Task) and Step 2 (Define the Inputs and Outputs) of the five-step PLC program development process — you are building a mental model of the machine before writing a single rung.

Limitations

Manual mode does not run the PLC scan engine — internal coils, timers, and counters are not active. Outputs you toggle stay ON until you click them again or press RUN. Some scene behaviours (like automatic sensor responses) still operate normally because the 3D physics continues to run in the background.

Note: Manual toggling is disabled when the simulator is connected. In that case, outputs are controlled exclusively by your ladder program.

Camera Controls

Navigating the 3D view

ActionMouse / TouchKeyboard
Orbit (rotate)Click + dragArrow keys
Zoom inScroll wheel up+ or =
Zoom outScroll wheel down-
Touch orbitOne-finger drag
Run (standalone)▶ RUN buttonF5
Stop (standalone)■ STOP buttonF4

The camera orbits around a fixed target point near the centre of the machine. Zoom controls the distance from that point.

I/O Panels

Reading the inputs and outputs displayed on each side

Each scene has two side panels flanking the 3D view:

Left Panel — Outputs (Y)

Shows all Y output addresses for this scene. A yellow LED indicates the output is currently ON (energised by your program). The description tells you which physical device that output controls.

Right Panel — Inputs (X)

Shows all X input addresses. A green LED indicates the input is currently ON. Inputs marked AUTO are set automatically by the scene's physics — you cannot manually toggle them while the simulator is connected.

Some scenes have manually operable inputs (pushbuttons, selector switches). These are displayed with a clickable button in the input panel.

Resize Handle

Drag the gold bar between the I/O list and the information area at the bottom of each panel to resize — drag up to show more status information, drag down to show more I/O rows. The size is remembered between sessions.

Event Log

The lower portion of the right panel shows a timestamped event log of sensor state changes. This is useful for verifying that your program is responding to the correct inputs at the right time.

Five Steps to PLC Program Development

The systematic approach used by every professional PLC programmer

Every PLC program — from a simple Start/Stop circuit to a complex palletizer sequence — is developed using the same five-step process. These steps ensure your program is well-understood, correctly specified, and fully tested before it goes live.

Each ACC 3D Scene is designed to take you through all five steps. The scene's About dialog (Help → About in the scene toolbar) walks you through what each step means for that specific machine.

STEP 1

Define the Task

Before writing a single rung, understand completely what the machine must do. Talk to operators, maintenance, and engineers. Ask open-ended questions: How do you picture this operating? What happens when…? What are the safety requirements? Write everything down. Good notes at this stage prevent expensive mistakes later.

STEP 2

Define the Inputs and Outputs

Review your Step 1 notes and build a complete I/O list. For each physical device, decide whether it is an input (something the PLC reads) or an output (something the PLC controls), and assign it a PLC address. Include pushbuttons, sensors, solenoids, motors, lights, and alarms. For a 3D scene, this list is already provided — it is the I/O map shown in the scene's About dialog.

STEP 3

Develop the Sequence of Operation

This is where the majority of development time is spent. Using your task definition and I/O list, describe exactly what must happen in what order — what condition causes each output to turn on or off, in plain language. A flow chart or sequence table is helpful. Fully understanding the logic before opening the simulator will save significant debugging time. The standalone scene demonstration is your reference for what correct behaviour looks like.

STEP 4

Develop the PLC Program

Translate your sequence of operation into ladder logic rungs in the ACC PLC Simulator. Work through each condition systematically. Use internal coils (C) to latch state between conditions, timers (T) for timed delays, and counters (CT) to track quantities. Keep each rung focused on one function and add rung comments so future readers understand your intent.

STEP 5

Test the Program

Connect the simulator to the 3D scene and press RUN. Step through each part of the sequence, verifying the machine responds correctly to every condition. Use the simulator's STEP mode to advance one scan at a time through complex logic. Watch the event log in the scene for sensor confirmations. If the machine does not behave as expected, return to Step 3 and re-examine your sequence — the logic, not the code, is usually where the error lives.

Note: These five steps are not strictly linear. It is normal to discover during Step 3 that you need additional inputs or outputs (go back to Step 2), or during Step 5 that your sequence needs revision (go back to Step 3). The process is iterative.

Scene + Simulator Workflow

Putting it all together in practice

Recommended Setup

  1. Open acc-plc-simulator.html — your ladder logic workspace.
  2. Read the scene's About dialog (Help → About) to understand the machine, I/O map, and sequence requirements.
  3. Run the scene in standalone mode to watch the correct behaviour before writing any code.
  4. Build your ladder program in the simulator using the five-step process.
  5. Connect the scene via the ⬡ CONNECT button and press RUN to test your program.
  6. Use STEP mode (F6) to trace through individual scans when debugging.
  7. Save your program (💾 SAVE) and export as JSON for backup.

Alternative: Real PLC Workflow

If you have a hardware PLC or SCADA system that speaks Modbus TCP or RTU, you can drive any scene directly — no browser simulator involved:

  1. Run acc-modbus-bridge.js on your PC (see the Modbus Bridge section in the left nav).
  2. Open a scene HTML file in a browser and click ⬡ MODBUS → CONNECT.
  3. Point your PLC program at the bridge IP on port 502 (TCP) or your COM port (RTU).
  4. Your PLC writes Coils to drive outputs; reads Discrete Inputs for sensor states.
The address map varies by scene — click the icon in the MODBUS config strip for the exact table for that machine.

Debugging Tips

  • If the machine doesn't move, check that the simulator is in RUN mode and the scene shows SIM LINKED
  • Use the I/O tab in the simulator to see which addresses are currently active
  • Watch the scene's event log to see when sensors fire — if a sensor fires but your program doesn't respond, the problem is in your rung conditions
  • Use C bits as intermediate latches rather than driving outputs directly from complex conditions — it makes debugging much easier
  • Check scan order: in ladder logic, rungs execute top to bottom every scan — a rung that sets a bit and a rung that reads it both execute in the same scan

⬡ ACC Modbus Bridge

Connect any scene to a real PLC, SCADA system, or Modbus tool

The ACC Modbus Bridge (acc-modbus-bridge.js) is a small Node.js server that runs on your Windows or macOS PC alongside the browser. It acts as a relay between the browser-based 3D scene and any external program that speaks the Modbus TCP or Modbus RTU protocol — a hardware PLC, a SCADA package, Modbus Poll, or any custom application.

Why Does It Exist?

Browsers cannot open raw TCP sockets or serial ports, so a scene cannot talk directly to industrial devices. The bridge solves this with a simple two-sided architecture:

  • Browser side — The scene connects to the bridge over WebSocket (a browser-safe protocol). Every I/O change is sent in a small JSON message.
  • PLC side — The bridge opens a standard Modbus TCP server on port 502 (and optionally a Modbus RTU serial port). Any Modbus master — hardware or software — can connect and read/write the data image.

The bridge keeps both sides synchronised: when the PLC writes a coil, the scene output changes within one WebSocket round-trip. When a scene sensor changes state, the bridge updates its discrete-input table so the PLC reads the new value on its next poll.

The Data Image

The bridge maintains a shared data image — a block of registers that both the scene and the Modbus master share. Four tables are supported:

Modbus TableAddressesAccessDirection
Coils00001 – 00016Master R/WPLC → Scene (outputs Y1–Y16)
Discrete Inputs10001 – 10016Master Read OnlyScene → PLC (inputs X1–X16)
Input Registers30001 – 30016Master Read OnlyScene → PLC (analog inputs AX1–AX16)
Holding Registers40001 – 40016Master R/WPLC → Scene (analog outputs AY1–AY16)
Note: Not all scenes use all four tables. Most discrete scenes only use Coils and Discrete Inputs. Check the address map in the scene's MODBUS → ⓘ About dialog for the exact assignments.

Use Cases

  • Test real PLC logic — Write a program on a Click, BRX, or Productivity PLC and watch the 3D scene respond as if it were the real machine.
  • Modbus Poll / SCADA commissioning — Verify your Modbus address map before the real panel is built.
  • Classroom demonstrations — Show students exactly how a SCADA system reads sensor data and commands actuators.
  • Protocol training — Learn how Modbus coils and registers map to physical I/O without needing real field devices.

Communication Flow

SCENE (browser)

WebSocket ↔ acc-modbus-bridge.js ↔ Modbus TCP/RTU

Scene sends a scene-update JSON message every time any input or output changes. Bridge translates to Modbus register table. PLC polls or receives; PLC writes coils; bridge sends bridge-update JSON back to scene. Scene updates 3D objects.

Latency note: The round-trip for a coil write to a scene output change is typically 5–20 ms on a local network — fast enough to feel instantaneous in the 3D view and well within any PLC scan rate you are likely to use for training purposes.

Installation & Setup

Get the bridge running in five minutes on Windows or macOS

What You Need

  • A PC or Mac running Windows 10+ or macOS 11+
  • Node.js LTS — free download from nodejs.org (one-time install)
  • The acc-modbus-bridge.zip archive — download from the ⬡ MODBUS strip inside any scene (click the download icon )
STEP 1

Install Node.js

Go to nodejs.org and download the current LTS installer for your operating system. Run the installer and accept all defaults. When it finishes, you will have the node and npm commands available. You only need to do this once — Node.js works for all future bridge installs.

STEP 2

Download & Extract the Bridge

Click the ⬡ MODBUS button in any scene toolbar to open the config strip, then click the ↓ download icon on the right side to save acc-modbus-bridge.zip. Extract the zip to a permanent folder on your PC — for example C:\ACC\modbus-bridge\ or ~/acc/modbus-bridge/. Do not run it from inside the zip file.

STEP 3

Run the Installer

Windows: Double-click install.bat inside the extracted folder.
macOS: Double-click install.command (you may need to right-click → Open the first time to bypass Gatekeeper).

The installer downloads the required npm packages and walks you through a short setup wizard. You will be asked to choose:

  • Modbus TCP only — recommended for most users (PLC connects over Ethernet)
  • Modbus RTU only — for serial RS-485 connections
  • Both TCP and RTU — bridge listens on both simultaneously

At the end the installer creates a start-modbus-bridge.bat (Windows) or start-modbus-bridge.command (macOS) shortcut in the same folder.

STEP 4

Start the Bridge

Double-click the shortcut created in Step 3. A terminal window opens showing:

  • ACC Modbus Bridge v3.0 starting…
  • Modbus TCP server listening on port 502 (if TCP was chosen)
  • WebSocket server listening on ws://127.0.0.1:8502

Keep this terminal window open while you use the bridge. Closing it stops the bridge immediately.

Windows Firewall: The first time you start the bridge, Windows Firewall may ask to allow node.exe network access. Click Allow access for both Private and Public networks. Without this, your PLC cannot connect on port 502.
Port 502 on Windows: Modbus TCP uses port 502, which is a well-known port (below 1024). On some Windows configurations you may need to run the terminal as Administrator the first time. Right-click the shortcut → Run as administrator.

Firewall & Network Notes

  • The WebSocket server (ws://127.0.0.1:8502) is loopback only — only the browser on the same PC can connect to it. This is intentional and safe.
  • The Modbus TCP server (0.0.0.0:502) listens on all network interfaces. Your PLC or SCADA can connect from any IP on the same LAN.
  • If port 502 is blocked by a corporate firewall, ask your IT team to open it, or configure the bridge to use an alternate port (edit config.json in the bridge folder).

Verifying the Install

With the bridge running, open Modbus Poll (or any Modbus master tool) and connect to 127.0.0.1 port 502. Read Coils 00001–00016. You should see all zeros (FALSE). Open a scene, connect via ⬡ MODBUS, and run it in standalone mode — the discrete input values in your Modbus master should update as sensors change state. That confirms the full path is working.

Connecting & Address Map

Linking the scene to the bridge, and reading/writing the right registers

Connecting the Scene

  1. Start acc-modbus-bridge.js (see Installation). Confirm the terminal shows WebSocket server listening on ws://127.0.0.1:8502.
  2. Open a scene HTML file in your browser.
  3. Click ⬡ MODBUS in the scene toolbar. The amber config strip drops down.
  4. Confirm the URL field shows ws://127.0.0.1:8502 (change it if your bridge runs on a different port).
  5. Click CONNECT. Within one second the badge changes from CONNECTING… to MB LINKED (amber).
  6. The toolbar ⬡ MODBUS button also glows amber to confirm the link.
Auto-reconnect: If the bridge restarts or the connection drops, the scene automatically retries every 5 seconds. You do not need to click CONNECT again.

How Addresses Are Assigned

The mapping rule is consistent across all scenes. Read this once and you will know the address for any I/O point in any scene without looking it up:

PLC AddressDirectionModbus TableModbus Address
X1INDiscrete Input10001
X2INDiscrete Input10002
X3INDiscrete Input10003
X4INDiscrete Input10004
XnINDiscrete Input1000n
Y1OUTCoil00001
Y2OUTCoil00002
YnOUTCoil0000n
AX1INInput Register30001
AY1OUTHolding Register40001

The rule: X inputs are Discrete Inputs starting at 10001; Y outputs are Coils starting at 00001; analog inputs are Input Registers from 30001; analog outputs are Holding Registers from 40001. The offset within each table is simply the address number — X5 is always DI 10005, Y3 is always Coil 00003.

Scene-Specific Maps

Each scene exposes its own address map inside the ⬡ MODBUS → ⓘ About dialog. Open it to see exactly which coil and discrete input number corresponds to which physical device for that scene. The five current scenes break down as:

SceneCoils (PLC writes)Discrete Inputs (PLC reads)
Control Panel00001 = Y1 Motor Run10001–10003 = X1–X3
Conveyor System00001–00002 = Y1–Y210001–10004 = X1–X4
Tank Fill Station00001–00004 = Y1–Y410001–10010 = X1–X10
Traffic Intersection00001–00006 = Y1–Y610001–10002 = X1–X2
Pick & Place Palletizer00001–00005 = Y1–Y510001–10010 = X1–X10

Using with Modbus Poll

Modbus Poll is a free Windows utility for reading and writing Modbus registers — ideal for testing the bridge before connecting a real PLC. The scene toolbar includes a grid icon (next to the download button in the config strip) that opens acc-modbus-poll.html — the ACC browser-based poll tool — in a new tab. It shows a live read of all 16 coils and 16 discrete inputs with colour-coded state indicators.

  1. Start the bridge and connect the scene as described above.
  2. Click the grid icon in the MODBUS config strip to open acc-modbus-poll.html.
  3. Run the scene in standalone mode — watch discrete inputs 10001–10010 change as sensors trip.
  4. Use the poll tool to force coils 00001–00005 ON — watch the scene respond immediately.
Function codes: The bridge supports FC01 (Read Coils), FC02 (Read Discrete Inputs), FC03 (Read Holding Registers), FC04 (Read Input Registers), FC05 (Write Single Coil), FC06 (Write Single Register), and FC15/FC16 (Write Multiple). Standard AutomationDirect PLCs support all of these.

Connecting a Hardware PLC

Any PLC with a Modbus TCP client (master) can connect. For AutomationDirect controllers:

  • Click PLC — Use the built-in Modbus TCP client in the Click Programming Software. Set the Server IP to your PC's IP address, port 502, and map the desired coils and discrete inputs.
  • BRX / Productivity Series — Use a Modbus TCP Client instruction block. Point at the PC IP on port 502.
  • Any SCADA (Ignition, FactoryTalk, WinCC) — Add a Modbus TCP device driver, IP = PC address, port 502, and create tags mapped to the coil and DI addresses above.
PC IP address: The bridge listens on all interfaces (0.0.0.0:502). Your PLC must connect to your PC's LAN IP address (e.g. 192.168.1.50), not 127.0.0.1 — loopback only works from the same machine. Find your PC IP with ipconfig (Windows) or ifconfig (macOS).

Modes & Mutual Exclusion

Understanding how the three control modes interact

Each scene can be driven by one of three sources at a time. These modes are mutually exclusive — connecting one automatically drops the others. This prevents conflicting commands from reaching the 3D machine.

The Three Modes

ModeWho controls outputs?Badge shown
Standalone / RUNScene's own built-in sequenceGreen RUNNING
Simulator LinkedACC PLC Simulator (ladder logic)Blue SIM LINKED
Modbus LinkedExternal PLC / SCADA via bridgeAmber MB LINKED

What Happens When Modes Conflict

  • Press RUN while Modbus is linked — The RUN button is blocked. A status message reads "Modbus master linked — disconnect bridge to use RUN button." Disconnect the bridge first, then RUN.
  • Simulator connects while Modbus is linked — The Modbus connection is silently dropped. The simulator takes over immediately. This allows seamless switching from a hardware PLC session back to the ACC PLC Simulator without manually disconnecting.
  • Modbus connects while simulator is linked — The simulator link badge is cleared. The Modbus master takes over. The browser simulator is no longer sending output commands to the scene.
  • Click output in Manual Test mode while Modbus is linked — Manual toggles are blocked. Outputs are owned exclusively by the Modbus master while MB LINKED is shown.

Coil Feedback Loop Prevention

When the scene is in Modbus-linked mode, the scene-update message sent to the bridge contains all-false coils — the scene does not echo back the coil states it received from the master. This is intentional and prevents a feedback loop where the bridge would overwrite the master's coil data with stale scene values.

In standalone or RUN mode, the scene does populate the coil array in its scene-update messages, allowing the bridge to report current output state to any Modbus master that is only reading (not writing) — for example a monitoring dashboard.

Change-Only Transmission

The scene tracks a snapshot of all 15 I/O bits (10 inputs + 5 outputs). It only sends a scene-update WebSocket message when at least one bit has changed since the last transmission. This keeps WebSocket traffic minimal — a scene at rest sends nothing, and a scene mid-cycle sends one message per state change rather than flooding at the animation frame rate.

Recommended Workflow — Hardware PLC Testing

PHASE 1

Develop & Verify in Software

Write your ladder program in the ACC PLC Simulator and connect via BroadcastChannel (SIM LINKED). Verify correct sequence behaviour using STEP mode. Debug all logic before touching the real PLC.

PHASE 2

Transfer to Hardware PLC

Upload your verified ladder program to your hardware PLC. Close the simulator (or just leave it — the scene will drop the sim link when the Modbus master connects). Start the bridge, connect the scene via MODBUS, and run your PLC program. The scene should behave identically to the software test.

PHASE 3

Connect to Real Equipment

Once the program is verified against the 3D scene, wire up the real sensors and actuators. Your Modbus address map gives you a clear I/O reference for the field wiring — X1 in the scene is the same address your PLC was already using in the verified program.

Troubleshooting

Diagnosing and fixing common Modbus Bridge issues

Scene Badge Shows CONNECTING… and Never Links

The scene cannot reach the bridge WebSocket. Work through these checks in order:

  1. Is the bridge actually running? — Look for the terminal window showing WebSocket server listening on ws://127.0.0.1:8502. If the window closed or was never opened, start it again via the shortcut.
  2. Is the URL correct? — The default is ws://127.0.0.1:8502. If you changed the port in config.json, update the URL field in the MODBUS config strip to match.
  3. Is another process using port 8502? — On Windows, run netstat -ano | findstr 8502 in a command prompt. If a different process is listed, change the bridge port in config.json and restart.
  4. Browser security policy — Some corporate browsers block WebSocket to 127.0.0.1. Try a different browser (Chrome or Edge recommended). Incognito mode sometimes helps too.

PLC Cannot Connect to Bridge on Port 502

  1. Windows Firewall — Open Windows Defender Firewall → Advanced Settings → Inbound Rules. Check whether node.exe has an Allow rule for TCP port 502. If not, add one, or re-run the bridge as Administrator to trigger the firewall prompt again.
  2. Wrong IP address — Your PLC must target your PC's LAN IP, not 127.0.0.1. Open a command prompt and run ipconfig. Use the IPv4 address shown for your Ethernet or Wi-Fi adapter.
  3. PLC on a different subnet — If your PC is on 192.168.1.x and your PLC is on 192.168.0.x, they cannot route to each other without a gateway. Put both on the same subnet or add a static route.
  4. Port 502 already in use — Another Modbus server (e.g. from a SCADA install) may already be bound to port 502. Stop that service or change the bridge port in config.json and update your PLC's server port accordingly.

Bridge Connects but Outputs Do Not Change in the Scene

  1. Scene is not in Modbus mode — Check the badge. If it shows SIM LINKED instead of MB LINKED, the simulator has taken priority. Close the simulator browser tab, then reconnect via MODBUS.
  2. Wrong coil addresses — Verify your PLC is writing to Coil 00001 for Y1, Coil 00002 for Y2, etc. Some Modbus tools use 0-based addressing (0=first coil) — check your tool's documentation. The bridge uses 1-based Modbus addresses.
  3. Function code mismatch — Only FC05 (Write Single Coil) and FC15 (Write Multiple Coils) update the scene outputs. FC16 (Write Holding Registers) updates analog outputs — it does not affect coils. Confirm your PLC is using the right FC for the right table.

Sensor Inputs (Discrete Inputs) Not Updating in PLC

  1. Scene not connected — The bridge only populates discrete inputs when the scene is connected (MB LINKED badge). Without the scene, all discrete inputs read FALSE.
  2. Scene is stopped (not running) — Most sensor inputs only change state when the scene animation is running. Start standalone mode (▶ RUN) or have your PLC drive the outputs to animate the scene.
  3. Wrong DI address — Confirm your PLC is reading DI 10001 for X1, DI 10002 for X2, etc. Some tools display these as DI 1, DI 2 (stripping the 1xxxx prefix) — that is the same register.
  4. Poll rate too slow — If your PLC only polls every 500ms and the sensor changes state for 200ms, it may miss the transition. The bridge holds the last known state — it does not clear inputs automatically — so transient inputs may need to be latched in your PLC program.

Bridge Crashes or Terminal Closes Immediately

  1. Node.js not installed — Open a command prompt and run node --version. If the command is not found, install Node.js from nodejs.org and retry.
  2. Missing npm packages — Run install.bat (or install.command) again. If it reports errors, check your internet connection — the installer downloads packages from npmjs.com.
  3. Port 502 access denied — On Windows, run the bridge shortcut via Run as administrator. Port 502 requires elevated privileges on Windows until a firewall rule is in place.
  4. Config file corrupted — Delete config.json in the bridge folder and re-run the installer. It will recreate a clean config.

Modbus RTU Serial Not Working

  1. Wrong COM port — Check Device Manager (Windows) or ls /dev/tty* (macOS) to confirm the port name. Update config.json with the correct port (e.g. COM4 or /dev/tty.usbserial-1410).
  2. Baud rate / framing mismatch — The bridge default is 19200 baud, 8N1. Match this exactly in your PLC's Modbus RTU master settings, or change both sides to the same rate in the respective configuration.
  3. RS-232 vs RS-485 — Modbus RTU typically uses RS-485 (multi-drop). If your PC only has RS-232, you need a USB-to-RS-485 converter. RS-232 will not directly drive an RS-485 bus.
Still stuck? The bridge terminal window shows detailed diagnostic messages including every Modbus function code received and every WebSocket message sent. Copy that output when asking for help — it pinpoints exactly where the communication is breaking down.

Available Scenes

All scenes included in this suite

SceneFileCategoryI/O
Control Panelacc-panel-scene.htmlDiscrete ControlX1–X3, Y1
Conveyor Systemacc-conveyor-scene.htmlMaterial HandlingX1–X4, Y1–Y2
Tank Fill Stationacc-tank-scene.htmlProcess ControlX1–X9, Y1–Y4
Traffic Intersectionacc-traffic-scene.htmlDiscrete / TimingX1–X2, Y1–Y6
Pick & Place Palletizeracc-palletizer-scene.htmlMaterial HandlingX1–X10, Y1–Y5

All scene files must be placed in the same folder as the simulator and acc-scenes.js. The scene registry (acc-scenes.js) controls which scenes appear in the Connect modal — edit it to add custom scenes.

Open each scene's About dialog (Help → About in the scene toolbar) for the complete I/O map, sequence of operation, and the five-step program development guide specific to that machine.