Skip to content

Cortex & Synapse documentation

Synapse is the browser IDE for building, testing, and operating a Cortex controller. Start with the quick start for the everyday workflow, then use the Python guides and reference when you want to work directly in code.

The programming model

Program the Neuron Cortex controller in Python. The two program files serve different jobs:

File Runs on You write Job
controller.py the isolated real-time core, every cycle, deterministically one @rt.loop the control law — read inputs, decide, drive outputs
async.py the general-purpose cores, event-driven @app.* handlers + blocks supervision, sequencing, notifications, web services

Use controller.py for cyclic field I/O and output decisions. Add async.py when you need supervision or integrations; supported async-only projects can also run without a real-time program.

The framework handles cycle scheduling, fieldbus access, and the link between the two programs. Synapse provides I/O setup, verification, and runtime views.

HMI requests reach async.py, which exchanges requested values and telemetry with controller.py through shared memory. The real-time program reads field inputs and writes outputs.

Shared memory carries requests and telemetry between the programs. The real-time loop owns output decisions.

A minimal control loop

from rt import rt, io

rt.ui_input("setpoint", kind="f64", min=0.0, max=90.0)
rt.ui_input("run_enable")

@rt.setup
def setup():
    io.heater = False          # initial output state, runs once

@rt.loop
def loop():                    # runs every cycle, forever
    io.heater = io.run_enable and io.temp_c < io.setpoint

With temp_c and heater mapped to field channels, this is a minimal control program. The operator inputs start at zero/off. io is a flat namespace of named tags — field channels and async-supplied signals, indistinguishable. The framework reads every input before your loop runs, flushes your outputs after it returns, and publishes telemetry. The configured scan rate, measured execution time, and recording rate are separate settings; see verification and telemetry.

The two rules that matter most

  1. In controller.py, never block. No sleep, no network, no file I/O, no unbounded loops. Read io, compute, write io. The framework does the waiting — blocking here is the one thing that breaks determinism.
  2. Control and safety live in controller.py, never in async.py. Async can ask (set a setpoint, request a mode), but the real-time loop owns every decision that drives an output or enforces an interlock. Async, the HMI, and the network are advisory.

Early-access documentation

These pages are shared by direct link. Available tabs and capabilities depend on the software installed on your controller, connected hardware, and enabled services. The quick start uses the manual download-and-run workflow.