MACS Studio turns a block diagram into a native C program. You connect function blocks on a canvas, run the model in simulation, and build it into a MACS node that reads its inputs from the signal bus and publishes its outputs back, at any update rate from 1 Hz to 10 kHz.
From diagram to running node
- Draw. Drag blocks from the library and wire outputs to inputs. Project signals sit in the same library, so reading a CAN signal is one drag away.
- Simulate. Press Play. Studio compiles the model and runs it locally at the model rate. Live values appear on every block, and Step advances exactly one cycle.
- Build. Studio generates the C code, compiles it, and adds the model to the project as a node. It then runs as a supervised systemd service like any other node.
- Monitor. Attach Studio to the running node to see live values on the canvas. Override individual inputs to test edge cases while the rest of the system stays live.
Function block library
56 blocks in 13 categories. Every block compiles to plain C, and the generated code follows the block order on the canvas.
| Category | Blocks |
|---|---|
| Input/Output | Input signal, Output signal |
| Connectivity | Signal link out, Signal link in |
| Math | Add, Subtract, Multiply, Divide, Clamp, Absolute value, Square root, Scale & offset, Min/Max |
| Lookup tables | 1D lookup table, 2D lookup table (map) |
| Comparison | Greater than, Less than, Equals, Not equals, Greater or equal, Less or equal, Range check |
| Logic | AND, OR, NOT, XOR, NAND, NOR, If/Else, Switch/Multiplexer, Bit extract |
| Counters & timers | Count up, Count down, Count up/down, On/off-delay timer |
| Memory & state | SR latch, Sample & hold, State machine |
| Control | PID controller, Integrator, Derivative, Delay, Rate limiter |
| Signal processing | Debounce, Hysteresis, Moving average, Low-pass filter, Deadband, Edge detect |
| Constants & sources | Constant, Parameter, Clock hour, Comment |
| Data protection | CRC-8 E2E |
| Advanced | Custom C code, Debug print |
An Input Signal block also outputs a valid flag that drops when its source goes quiet, so a model can inhibit or fall back when a device disappears.
Keep large models readable
- Sheets. Put each functional area on its own sheet, and pass values between sheets with Signal Link blocks.
- Subsystem frames. Group blocks under a title and description. A frame can be linked to project requirements and shows how many of them are verified.
- Composite blocks. Export a model as a single block with its own ports, and import it into other models. An import is a copy, so a model builds anywhere and never changes under you.
- Custom Code. Write C directly in a block with the ports you define. The editor ships with examples such as a Kalman filter, 2-of-3 voting, and an alarm with acknowledge.
Bring your Simulink models
Already have control models in Simulink? The Simulink node loads Simulink-generated C code, compiled as a shared library, and runs it at a fixed rate. A mapping file connects model inputs and outputs to MACS signals, and you choose what happens when an input is missing: fail, use zero, or hold the last value. Simulink models and MACS Studio models run side by side in the same project.





