Skip to main content
Version: 1.0.0

Simulation Server

The TwinEdge Simulation Server is a free OPC UA server that generates realistic industrial data for testing, development, and demos.

Download

PlatformDownloadRequirements
WindowsDownload (.msi)Windows 10+
macOSDownload (.dmg)macOS 11+
Dockerdocker pull twinedge/simulation-serverDocker 20+

Features

  • Realistic simulations: Industrial equipment models
  • Multiple asset types: Pumps, motors, HVAC, sensors
  • Configurable scenarios: Normal operation, faults, maintenance
  • Standard OPC UA: Full UA specification support
  • No hardware needed: Perfect for development and testing

Getting Started

Installation

Windows/macOS:

  1. Download the installer
  2. Run and follow prompts
  3. Launch Simulation Server

Linux:

chmod +x TwinEdge-SimServer.AppImage
./TwinEdge-SimServer.AppImage

Docker:

docker run -d -p 4840:4840 twinedge/simulation-server

Starting the Server

  1. Launch the Simulation Server
  2. Server starts on opc.tcp://localhost:4840
  3. Connect with any OPC UA client

Quick Test

Using the TwinEdge OPC UA Client:

  1. Open OPC UA Client
  2. Connect to opc.tcp://localhost:4840
  3. Browse to ObjectsSimulation
  4. View simulated values updating

Simulated Assets

Centrifugal Pump

Realistic pump simulation with:

VariableTypeRangeUnit
Vibration_XFloat0-10mm/s
Vibration_YFloat0-10mm/s
Vibration_ZFloat0-10mm/s
Motor_TemperatureFloat20-120°C
Bearing_TemperatureFloat20-100°C
Discharge_PressureFloat0-20bar
Suction_PressureFloat0-5bar
Flow_RateFloat0-500L/min
Motor_CurrentFloat0-100A
Motor_SpeedInt0-3600RPM
Run_StatusBoolOn/Off-

Electric Motor

Motor simulation variables:

VariableTypeRangeUnit
Stator_TemperatureFloat20-150°C
Rotor_TemperatureFloat20-120°C
Voltage_L1Float380-420V
Voltage_L2Float380-420V
Voltage_L3Float380-420V
Current_L1Float0-100A
Current_L2Float0-100A
Current_L3Float0-100A
Power_FactorFloat0.8-1.0-
Active_PowerFloat0-75kW
SpeedInt0-1800RPM

HVAC Unit

HVAC system simulation:

VariableTypeRangeUnit
Supply_TemperatureFloat10-30°C
Return_TemperatureFloat15-35°C
HumidityFloat30-80%
CO2_LevelFloat400-2000ppm
Fan_SpeedInt0-100%
Compressor_StatusBoolOn/Off-
Filter_StatusInt0-100%

Generic Sensors

Configurable sensor simulation:

Sensor TypeVariables
TemperatureValue, Unit, Status
PressureValue, Unit, Status
LevelValue, Unit, Status
FlowValue, Unit, Status
VibrationX, Y, Z, RMS

Simulation Scenarios

Normal Operation

Default scenario with stable, realistic values:

  • Minor random fluctuations
  • Day/night cycles
  • Gradual drift

Fault Conditions

Simulate equipment faults:

Bearing Failure:

Enable: Scenarios → Pump → Bearing Failure
Effect: Vibration increases over time, temperature rises

Cavitation:

Enable: Scenarios → Pump → Cavitation
Effect: Pressure fluctuations, flow instability

Motor Overload:

Enable: Scenarios → Motor → Overload
Effect: Current spikes, temperature increase

Maintenance Events

Simulate maintenance activities:

  • Scheduled shutdown
  • Parameter changes
  • Recovery patterns

Configuration

Server Configuration

Edit config.yaml:

server:
port: 4840
security:
mode: None # None, Sign, SignAndEncrypt
policy: Basic256Sha256
max_sessions: 10
max_subscriptions: 100

Asset Configuration

Configure simulated assets:

assets:
- id: Pump_001
type: centrifugal_pump
enabled: true
update_rate_ms: 1000
initial_state: running

- id: Motor_001
type: electric_motor
enabled: true
update_rate_ms: 500
linked_to: Pump_001

Custom Variables

Add custom variables:

custom_variables:
- name: CustomSensor
node_id: ns=2;s=CustomSensor
data_type: Float
initial_value: 50.0
simulation:
type: sine
amplitude: 10
period_seconds: 60

Simulation Patterns

Available Patterns

PatternDescriptionParameters
constantFixed valuevalue
randomRandom within rangemin, max
sineSinusoidal waveamplitude, period, offset
rampLinear increasestart, end, duration
stepStep changesvalues[], interval
noiseGaussian noisemean, stddev
replayReplay CSV datafile, loop

Pattern Examples

Random with drift:

simulation:
type: random
min: 60
max: 80
drift: 0.1 # Gradual drift per minute

Sine wave:

simulation:
type: sine
amplitude: 5
period_seconds: 3600 # 1 hour cycle
offset: 65

CSV Replay:

simulation:
type: replay
file: historical_data.csv
timestamp_column: time
value_column: temperature
loop: true

API Control

REST API

Control the simulation via REST:

# Get server status
GET http://localhost:8080/api/status

# Start/stop simulation
POST http://localhost:8080/api/simulation/start
POST http://localhost:8080/api/simulation/stop

# Trigger scenario
POST http://localhost:8080/api/scenarios/bearing_failure/enable

# Set variable value
POST http://localhost:8080/api/variables/Pump_001/Temperature
Content-Type: application/json
{"value": 85.0}

Command Line

Control via CLI:

# Start server
simserver start --port 4840

# Load configuration
simserver config load myconfig.yaml

# Trigger scenario
simserver scenario enable bearing_failure

# Stop server
simserver stop

Docker Usage

Basic Usage

docker run -d \
--name twinedge-sim \
-p 4840:4840 \
-p 8080:8080 \
twinedge/simulation-server

With Custom Config

docker run -d \
--name twinedge-sim \
-p 4840:4840 \
-v $(pwd)/config.yaml:/app/config.yaml \
twinedge/simulation-server

Docker Compose

version: '3.8'
services:
simulation-server:
image: twinedge/simulation-server:latest
ports:
- "4840:4840"
- "8080:8080"
volumes:
- ./config:/app/config
environment:
- LOG_LEVEL=info

Use Cases

Development Testing

Test your OPC UA client code:

  1. Start simulation server
  2. Connect your application
  3. Test read/write/subscribe operations
  4. Verify error handling

Integration Testing

Automated testing scenarios:

# pytest example
def test_alarm_on_high_temperature():
# Enable high temperature scenario
requests.post('http://localhost:8080/api/scenarios/high_temp/enable')

# Wait for alarm
time.sleep(5)

# Verify alarm triggered
alarms = client.get_active_alarms()
assert any(a.name == 'High Temperature' for a in alarms)

Demos and Training

Demonstrate TwinEdge features:

  • Dashboard creation
  • Alert configuration
  • ML model training
  • Report generation

Load Testing

Stress test your infrastructure:

# Start multiple instances
for i in {1..10}; do
docker run -d -p $((4840+i)):4840 twinedge/simulation-server
done

Troubleshooting

Server Won't Start

Port in use:

# Check if port is in use
netstat -an | grep 4840

# Use different port
simserver start --port 4841

Permission denied (Linux):

# Run with sudo or change port > 1024
sudo ./simserver start
# Or
./simserver start --port 14840

Connection Issues

Cannot connect:

  1. Verify server is running
  2. Check firewall rules
  3. Ensure correct endpoint URL

Security errors:

  • Use security.mode: None for testing
  • Or configure certificates properly

Performance Issues

High CPU:

  • Reduce update rate
  • Disable unused assets
  • Limit subscription count

Support

License

The TwinEdge Simulation Server is open source under the MIT License.

Next Steps