Signal Generator

Signal Generator

ID: uniflow.plugin.signalgenerator Category: Simulator / Logic Version: v1.3.0 Min Uniflow Version: Uniflow ≥ v1.4.0

Signal Generator Plugin Reference Manual

1. Overview

Plugin Name: Signal Generator

Type: Simulator / Logic

Identifier: uniflow.plugin.signalgenerator

Description

Generates synthetic signals, waveforms, state transitions, and pulse triggers for device simulation and rule testing.


2. Technical Architecture

The Signal Generator plugin implements a high-precision synthetic signal calculation engine. It uses high-resolution background timers to evaluate mathematical waveform algorithms (Sine, Square, Triangle, Sawtooth, Pulse, and Gaussian Random Noise), applying configurable time scaling, phase offsets, and amplitude bounds to publish simulated telemetry values into the Uniflow catalog.

System Interaction & Exposed Catalog Routes

The Signal Generator plugin generates synthetic mathematical waveforms (Sine, Cosine, Square, Triangle, Sawtooth, Ramp, Random Noise). It provides sample telemetry streams at configurable frequencies for testing rule pipelines.

Catalog Routes & Node Integration

Input Event Triggers (Input Nodes):

  • signal.sample_generated - Emitted on waveform sample generation.
  • signal.waveform_period_completed - Emitted when a full signal period finishes.
  • Executable Actions (Action Nodes):

  • signal.set_frequency - Configures generator frequency (Hz).
  • signal.set_amplitude - Adjusts waveform amplitude.
  • signal.set_waveform_type - Switches signal wave function.
  • signal.toggle_generator - Starts or pauses signal generation.
  • Architecture Diagram

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...

    3. Configuration Parameters

    The Signal Generator plugin configuration is divided into Global Source Settings (controlling engine tick rates and global time scaling) and Signal Point Configurations (defining individual synthetic signal channels and their mathematical wave parameters).

    3.1 Global Source Settings

    Setting NameCode ParameterDefaultDescription
    Base Tick Interval (ms)  signal.baseIntervalMs
    100Defines the background generation tick loop interval in milliseconds (default 100 ms = 10 Hz sample rate). Controls update frequency for all points under this source.
    Time Scale Multiplier  signal.timeScale
    1.0Real-time simulation clock speed multiplier. For example, setting 2.0 doubles the speed of all wave frequencies, ramp durations, and timers.
    Auto Start Engine  signal.autoStart
    trueWhen true, background signal generation starts automatically on source initialization. When false, the engine remains paused until triggered.

    3.2 Signal Point Common Attributes

    Every signal point configured within a Signal Generator source defines the following core properties:

  • Id: Unique string identifier for the signal point.
  • Display Name: Human-readable name shown in the catalog UI.
  • Path: Catalog node address (e.g. Signals/Point1).
  • Output Type (SourceValueType): Data type emitted (Double, Int32, Int64, Bool, String, Json, DateTimeOffset).
  • Generator Type (GeneratorType): Selection of the signal generation algorithm.

  • 3.3 Generation Types & Parameter Reference

    Below is a detailed breakdown of all 13 supported signal generation algorithms, explaining the displayed UI configuration parameters, their mathematical operation, and how they influence the generated output.

    1. Sine Wave (SineWave)

    Generates smooth, continuous harmonic oscillations according to a sinusoidal wave equation.

    Setting NameCode ParameterDefaultDescription
    Amplitude  Amplitude
    10.0Peak wave excursion above and below the offset line. Higher values increase wave height.
    Frequency (Hz)  FrequencyHz
    0.1Number of complete sine wave cycles per second.
    Offset  Offset
    20.0Vertical DC bias added to the wave center line.
    Phase (Degrees)  PhaseDegrees
    0.0Initial phase angle shift (0° to 360°).
    Noise Level  NoiseLevel
    0.0Standard deviation of additive Gaussian noise layered onto the sine signal.
  • Mathematical Model:
  • Value = Amplitude × sin(2π · FrequencyHz · t + ϕrad) + Offset + 𝒩(0, NoiseLevel)
  • Simulation Use Case: Modeling cyclic process variables such as daily temperature swings, AC voltage waveforms, or pressure oscillations.

  • 2. Square Wave (SquareWave)

    Generates bi-level switching pulses alternating between HIGH and LOW output states.

    Setting NameCode ParameterDefaultDescription
    High Value  HighValue
    1.0Signal output value during the HIGH state.
    Low Value  LowValue
    0.0Signal output value during the LOW state.
    Frequency (Hz)  FrequencyHz
    0.5Oscillation frequency in Hertz (T = 1 / FrequencyHz).
    Duty Cycle (%)  DutyCyclePct
    50.0Percentage of period T spent in the HIGH state (1% to 99%).
    Phase (Degrees)  PhaseDegrees
    0.0Time offset phase shift in degrees.
  • Influence & Behavior:
  • Evaluates whether the normalized time within the period is less than the active duty cycle duration. When OutputType is set to Bool, outputs true (HIGH) or false (LOW); otherwise emits HighValue or LowValue.

  • Simulation Use Case: Simulating digital clock triggers, binary equipment state indicators, or PWM control signals.

  • 3. Triangle Wave (TriangleWave)

    Generates symmetric linear rise and fall sweeps between configured bounds.

    Setting NameCode ParameterDefaultDescription
    Min Value  MinValue
    0.0Lower floor bound at the bottom peak.
    Max Value  MaxValue
    100.0Upper ceiling bound at the top peak.
    Frequency (Hz)  FrequencyHz
    0.1Cycle repetition frequency in Hertz.
    Symmetry (%)  SymmetryPct
    50.0Percentage of period spent ramping up (50% yields equal rising/falling slopes).
  • Influence & Behavior:
  • Ramps linearly from MinValue to MaxValue over T · (SymmetryPct / 100), then ramps linearly back down to MinValue.

  • Simulation Use Case: Linear actuator position sweeps, triangular test ramp inputs, or sensor calibration testing.

  • 4. Sawtooth Wave (SawtoothWave)

    Generates asymmetric ramp signals that rise linearly and drop instantly upon cycle completion.

    Setting NameCode ParameterDefaultDescription
    Min Value  MinValue
    0.0Ramp starting floor value.
    Max Value  MaxValue
    100.0Peak ramp value prior to reset.
    Frequency (Hz)  FrequencyHz
    0.1Ramp repetition frequency in Hertz.
  • Influence & Behavior:
  • Equivalent to a Triangle Wave with SymmetryPct = 100%. Linearly increases from MinValue to MaxValue over period T, then resets instantly to MinValue.

  • Simulation Use Case: Accumulator fill counters, conveyor index position trackers, or charging capacitor cycles.

  • 5. Step Wave (StepWave)

    Generates discrete staircase steps with configurable step counts, duration, and reset behaviors.

    Setting NameCode ParameterDefaultDescription
    Start Value  StartValue
    0.0Initial baseline value at step 0.
    Step Delta  StepDelta
    5.0Value increment added at each step.
    Steps Count  StepsCount
    5Total number of discrete steps in a full cycle.
    Step Duration (ms)  StepDurationMs
    1000Dwell time in milliseconds at each step.
    Reset Mode  ResetMode
    "ResetToStart"Wrap-around strategy ("ResetToStart", "Bounce", or "HoldMax").
  • Influence & Behavior:
  • Calculates step index S = ⌊ (t · 1000) / StepDurationMs. Under "ResetToStart", wraps back to 0; under "Bounce", steps back down; under "HoldMax", holds at maximum. Output is StartValue + Seffective · StepDelta.

  • Simulation Use Case: Multi-stage setpoint testing, multi-level tank filled levels, or batch processing stages.

  • 6. Trapezoidal Profile (TrapezoidalProfile)

    Generates a 4-phase motion profile consisting of acceleration (ramp up), steady state (hold), deceleration (ramp down), and idle rest.

    Setting NameCode ParameterDefaultDescription
    Idle Value  IdleValue
    0.0Baseline value during the rest state.
    Target Value  TargetValue
    100.0Peak plateau value during the hold phase.
    Ramp Up (ms)  RampUpMs
    2000Duration in ms to accelerate linearly from IdleValue to TargetValue.
    Hold (ms)  HoldMs
    5000Duration in ms held at TargetValue.
    Ramp Down (ms)  RampDownMs
    2000Duration in ms to decelerate linearly from TargetValue to IdleValue.
    Rest (ms)  RestMs
    3000Dwell duration in ms held at IdleValue before starting the next cycle.
  • Influence & Behavior:
  • Executes a total cycle of duration Tcycle = RampUp + Hold + RampDown + Rest, providing continuous piecewise linear output.

  • Simulation Use Case: Industrial motor speed profiles, valve opening/closing routines, or automated production cycles.

  • 7. White Noise (WhiteNoise)

    Generates random noise values using either Gaussian (Normal) or Uniform probability distribution models.

    Setting NameCode ParameterDefaultDescription
    Distribution  Distribution
    "Gaussian"Statistical distribution model ("Gaussian" or "Uniform").
    Mean  Mean
    50.0Expected central mean value for Gaussian distribution.
    StdDev  StdDev
    5.0Standard deviation/spread for Gaussian distribution.
    Min Value  MinValue
    0.0Lower clamp limit (or minimum range for Uniform).
    Max Value  MaxValue
    100.0Upper clamp limit (or maximum range for Uniform).
  • Influence & Behavior:
  • Uniform distribution selects uniformly within [MinValue, MaxValue]. Gaussian distribution samples 𝒩(Mean, StdDev) using Box-Muller transformation and clamps result to [MinValue, MaxValue].

  • Simulation Use Case: Sensor signal jitter, thermal electrical noise, or unconditioned measurement variation.

  • 8. Random Walk (RandomWalk)

    Generates bounded stochastic drift (Brownian motion) with optional directional trend bias.

    Setting NameCode ParameterDefaultDescription
    Initial Value  InitialValue
    25.0Starting value at engine initialization.
    Max Step Delta  MaxStepDelta
    0.5Maximum random step change magnitude per evaluation tick.
    Drift Factor  DriftFactor
    0.0Constant directional trend bias per step (positive = upward drift, negative = downward drift).
    Min Value  MinValue
    0.0Hard lower boundary clamp.
    Max Value  MaxValue
    100.0Hard upper boundary clamp.
  • Influence & Behavior:
  • Performs stateful step integration: Vn+1 = Clamp(Vn + Rand(-1, 1) · MaxStepDelta + DriftFactor, MinValue, MaxValue).

  • Simulation Use Case: Slowly drifting process telemetry (e.g. ambient tank temperature drift, pressure decay, or financial/market rate simulation).

  • 9. Heartbeat Pulse (HeartbeatPulse)

    Generates periodic short pulse triggers for liveness monitoring and watchdog simulation.

    Setting NameCode ParameterDefaultDescription
    Interval (ms)  IntervalMs
    1000Repeat interval between pulse triggers in milliseconds.
    Pulse Width (ms)  PulseWidthMs
    100Duration of active pulse HIGH state in milliseconds.
    Emit As Trigger  EmitAsTrigger
    falseWhen true, outputs boolean true/false trigger states.
  • Influence & Behavior:
  • Evaluates (t · 1000) ±od{IntervalMs} < PulseWidthMs. Emits HIGH state (1.0 or true) during active pulse width and LOW (0.0 or false) during off interval.

  • Simulation Use Case: Device heartbeat signals, watchdog timers, stroke counters, or periodic trigger events.

  • 10. Anomaly Spike (AnomalySpike)

    Generates baseline telemetry with stochastic transient spike anomalies for anomaly detection testing.

    Setting NameCode ParameterDefaultDescription
    Baseline Value  BaselineValue
    22.0Normal steady-state operating value.
    Spike Probability (%)  SpikeProbabilityPct
    5.0Percentage probability (0% to 100%) of triggering an anomaly spike per tick.
    Spike Magnitude  SpikeMagnitude
    50.0Value offset added to BaselineValue during a spike event.
    Spike Duration (ms)  SpikeDurationMs
    500Duration in milliseconds that an active spike persists.
  • Influence & Behavior:
  • Normally outputs BaselineValue. Upon random spike trigger, enters anomaly state and outputs BaselineValue + SpikeMagnitude for SpikeDurationMs before reverting to baseline.

  • Simulation Use Case: Testing high-threshold alarm rules, emergency shutoff triggers, or anomaly detection pipelines.

  • 11. State Machine (StateMachine)

    Generates state transition outputs based on a configurable sequence of states and dwell durations.

    Setting NameCode ParameterDefaultDescription
    States JSON  StatesJson
    4-state loopJSON array defining objects with Id, Name, Value, and DwellTimeMs (Stopped [3s] Starting [2s] Running [10s] Fault [4s]).
  • Influence & Behavior:
  • Sequentially steps through state definitions. Outputs numeric state ID (for Int32/Double output types) or state Name (for String output type).

  • Simulation Use Case: Simulating multi-state machine lifecycles, equipment operating modes, or alarm state sequences.

  • 12. Sequence Player (SequencePlayer)

    Plays back pre-recorded or user-defined arrays of values with optional interpolation and looping modes.

    Setting NameCode ParameterDefaultDescription
    Raw Sequence Data  RawSequenceData
    "10,20,50,80,30"Comma-separated sequence of values.
    Sample Interval (ms)  SampleIntervalMs
    1000Dwell duration in milliseconds per step.
    Play Mode  PlayMode
    "Loop"Playback mode ("Loop", "PingPong", or "OneShot").
    Interpolation  Interpolation
    "Step"Transition mode ("Step" for immediate jump, "Linear" for smooth linear interpolation).
  • Influence & Behavior:
  • Steps through sequence items. In "Linear" mode with numeric data, smoothly interpolates values between step boundaries over SampleIntervalMs.

  • Simulation Use Case: Replaying custom test curves, historical field data samples, or multi-point profile tests.

  • 13. JSON Template (JsonTemplate)

    Generates dynamic structured JSON payloads populated with real-time timestamps, engine ticks, random values, or cross-referenced catalog fields.

    Setting NameCode ParameterDefaultDescription
    Template Text  TemplateText
    Payload patternJSON template string containing dynamic replacement tokens (e.g. {"deviceId": "SIM-01", "timestamp": "{TimeIso}", "value": {RandomDouble}}).
  • Supported Dynamic Tokens:
  • {TimeIso}: Replaced with current UTC timestamp in ISO-8601 format.
  • {Tick}: Replaced with total background tick count.
  • {RandomDouble}: Replaced with a random double value (0.00 to 100.00).
  • {Catalog/Node/Path}: Replaced with live values from any catalog node path.
  • Influence & Behavior:
  • Evaluates all token macros on each tick and emits a formatted JSON string payload (SourceValueType.Json).

  • Simulation Use Case: Simulating complex IoT gateway payloads, telemetry JSON packets, or structured MQTT messages.

  • 4. Exposed Routes & Data Types

    This plugin exposes catalog fields across the following rule graph nodes:

    Input Source

    The Input Source node reads generated synthetic signal values and engine control state.

    Human-Readable Field NameData TypeDescription
    Configured Signal Waveform  Double` / `Int32` / `Bool` / `String
    Live synthetic value emitted by configured signal algorithm (Sine, Square, Triangle, Sawtooth, Pulse, Noise).
    Generator Enabled  Bool
    Flag indicating whether the background signal generation clock is active (True) or paused (False).
    Time Scale Multiplier  Double
    Current time scale frequency multiplier.

    Output Target

    The Output Target node acts as an action sink node to control generator execution and reset internal wave clocks.

    Target NameData TypeAssociated ParametersParameter Data TypeRequiredDescription
    Generator Enabled  Bool
    ValueBoolTrueSet generator running state (True to start, False to pause).
    Time Scale Multiplier  Double
    ValueDoubleTrueAdjust execution frequency time scale speed.
    Reset Generator Clock  Bool
    ValueBoolTrueCommand action sink to reset wave phase calculation and internal tick counter back to zero.

    5. Usage Examples

    Scenario A: Synthetic Sine Wave Telemetry Mirrors to Modbus Holding Register & Publishes to MQTT

    Workflow Overview:

    For testing automated control loops without hardware, a Signal Generator source generates a synthetic 0-100°C Sine Wave (Configured Signal Waveform). Uniflow samples the waveform at 1 Hz and executes two parallel target writes:

    1. Mirrors the simulated float value into Modbus TCP HoldingRegister 200.

    2. Publishes the telemetry JSON payload to MQTT topic telemetry/simulated/temperature.

    Rule Node Configuration:

    1. Input Source Node: Signal Generator Poller

  • Waveform Type: Sine
  • Exposed Field: Configured Signal Waveform (Double)
  • 2. Logic Pass-Through Node: Value Scale / Formatter

  • Output: SimulatedTemp (Double)
  • 3. Output Target Node A: Modbus Client Writer

  • Action Target: Direct Access
  • Type: Holding Register
  • Address: 200
  • Value: SimulatedTemp
  • 4. Output Target Node B: MQTT Client Action

  • Action Target: Publish Message (mqtt.publish_message)
  • Topic: telemetry/simulated/temperature
  • Payload: {"temperature": ${SimulatedTemp}}
  • Logic Flow Diagram:

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...

    Scenario B: High-Temperature Emergency Event Pauses Signal Generator Simulation Clock

    Workflow Overview:

    When an actual Modbus boiler alarm fires (HoldingRegister 101 > 90.0°C), Uniflow issues a command to pause the simulation engine (Generator Enabled = False) to prevent synthetic data interference during physical emergency conditions.

    Rule Node Configuration:

    1. Input Source Node: Modbus Client Poller

  • Register Type: Holding Register
  • Address: 101
  • Exposed Field: BoilerTemp (Double)
  • 2. Logic Condition Node: GreaterThan

  • Expression: BoilerTemp > 90.0
  • 3. Output Target Node: Signal Generator Action

  • Action Target: Generator Enabled (signal.toggle_generator)
  • Value: False
  • Logic Flow Diagram:

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...
    Architecture Flow Diagram — Full Preview