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.
- Synapse quick start — open the IDE, name I/O, build a small program, test it, and download it.
- Synapse capabilities — a tour of authoring, I/O, HMI, history, and controller workflows.
- Your first Python program — a worked control program with an optional async supervisor.
- Neuron data SDK — query cloud history from Python, load rows into pandas, and download a runnable example.
- Python reference — functions, decorators, and project configuration, with complete examples.
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.
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¶
- In
controller.py, never block. Nosleep, no network, no file I/O, no unbounded loops. Readio, compute, writeio. The framework does the waiting — blocking here is the one thing that breaks determinism. - Control and safety live in
controller.py, never inasync.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.