Referencestable
Block System
Built-in blocks, custom block development, and the Component Finder
Block System
The SimFusion block system is the foundation of visual modeling. Learn about built-in blocks, creating custom blocks, and finding components with the Component Finder.
Block Anatomy
Every block has:
┌─────────────────────┐
│ Block Name │ ← Title
│ [Configuration] │ ← Parameters
├─────────────────────┤
│ ○ Input 1 │ ← Input ports
│ ○ Input 2 │
├─────────────────────┤
│ ● Output 1 │ ← Output ports
│ ● Output 2 │
└─────────────────────┘
Port Types
| Type | Color | Data Direction |
|---|---|---|
| Data | Teal | Numeric arrays |
| Control | Orange | Triggers, events |
| Config | Green | Static parameters |
Built-in Libraries
Signal Sources
| Block | Function | Parameters |
|---|---|---|
| Sine Wave | Generate sinusoidal signal | frequency, amplitude, phase |
| Noise | Random noise generator | distribution, seed |
| Step | Step function | delay, final value |
| File Reader | Load from disk | filepath, format |
Signal Processing
| Block | Function | Parameters |
|---|---|---|
| FFT | Fast Fourier Transform | size, window |
| Filter | Digital filter | type, cutoff, order |
| Math | Arithmetic operations | operation, constant |
| Delay | Time delay | samples |
Sinks
| Block | Function | Parameters |
|---|---|---|
| Scope | Real-time plot | channels, time window |
| Spectrum | Frequency domain plot | bins, averaging |
| File Writer | Save to disk | filepath, format |
| Export | Data export | destination |
The Component Finder
SimFusion does not have a marketplace — it ships with a library of components you search with the built-in Component Finder:
- Open the Component Finder from the project workspace toolbar (or the block library panel)
- Search by name, category, or function (e.g. "butterworth", "control", "import")
- Read the block's documentation inline — every block is well documented
- Drag the block straight into your project workspace
When the library doesn't have what you need, write your own block in C/C++ or Python.
Creating Custom Blocks
Custom processing blocks are written in C/C++ & Python, directly in the built-in IDE.
Python Template
from simfusion import Block, Input, Output, Parameter
import numpy as np
class MyCustomBlock(Block):
"""Description of what this block does."""
# Define ports
input_signal = Input(type="data", description="Input signal")
gain_factor = Parameter(type="float", default=1.0, description="Gain multiplier")
output_signal = Output(type="data", description="Amplified signal")
def process(self, input_signal):
"""Main processing function called each tick."""
amplified = input_signal * self.gain_factor
return {"output_signal": amplified}
Block Configuration
# block.yaml
name: "MyCustomBlock"
category: "Signal Processing"
icon: "waveform"
inputs:
input_signal:
type: data
required: true
outputs:
output_signal:
type: data
parameters:
gain_factor:
type: float
default: 1.0
min: 0.0
max: 100.0
Debugging Blocks in a Simulation
Use the simulation debug tools while your model runs:
- Breakpoints: Pause the simulation at a time (in seconds) or at an exact sample
- Buffer inspection: Inspect any block's input/output buffers at the paused point
- Block documentation: Open a block's docs directly from the project workspace when something behaves unexpectedly
Block Styling
Custom Appearance
class StyledBlock(Block):
style = {
"color": "#4BA6A1",
"shape": "rectangle", # or "circle", "diamond"
"icon": "custom_icon.svg",
"width": 120,
"height": 80
}
Performance Optimization
Vectorization
Always use NumPy/vectorized operations:
# Good: Vectorized
output = input_array * 2 + 1
# Bad: Loop-based
output = np.array([x * 2 + 1 for x in input_array])
Caching
Cache expensive computations:
from functools import lru_cache
@lru_cache(maxsize=128)
def expensive_calculation(params):
...
Further Reading
- API Reference — Complete API documentation
Help us improve
Found an issue or have a suggestion?