Data Sources
TwinEdge connects to industrial equipment through various protocols and data sources. This guide covers how to configure and manage your data connections.
Supported Protocols
OPC UA
OPC UA (Unified Architecture) is the most common protocol for industrial communication.
Connection Parameters:
| Parameter | Description | Example |
|---|---|---|
| Endpoint URL | OPC UA server address | opc.tcp://192.168.1.100:4840 |
| Security Mode | Connection security | None, Sign, SignAndEncrypt |
| Security Policy | Encryption policy | Basic256Sha256, Aes128_Sha256_RsaOaep |
| Authentication | User authentication | Anonymous, Username/Password, Certificate |
Example Configuration:
name: Plant PLC
type: opcua
endpoint: opc.tcp://192.168.1.100:4840
security_mode: SignAndEncrypt
security_policy: Basic256Sha256
authentication:
type: username_password
username: opcuser
password: ${OPC_PASSWORD}
For secure connections, upload your client certificate in Settings → Certificates. TwinEdge will automatically handle certificate exchange with the OPC UA server.
Modbus TCP
Modbus TCP is widely used for PLCs and RTUs.
Connection Parameters:
| Parameter | Description | Example |
|---|---|---|
| Host | Device IP address | 192.168.1.50 |
| Port | TCP port (default 502) | 502 |
| Unit ID | Modbus slave address | 1 |
| Polling Interval | Data refresh rate | 1000ms |
Register Types:
| Type | Code | Address Range | Access |
|---|---|---|---|
| Coils | 0x | 00001-09999 | Read/Write |
| Discrete Inputs | 1x | 10001-19999 | Read Only |
| Input Registers | 3x | 30001-39999 | Read Only |
| Holding Registers | 4x | 40001-49999 | Read/Write |
MQTT
Connect to MQTT brokers for IoT sensor data.
Connection Parameters:
| Parameter | Description | Example |
|---|---|---|
| Broker URL | MQTT broker address | mqtts://broker.example.com:8883 |
| Client ID | Unique client identifier | twinedge-prod-001 |
| Username | MQTT username | twinedge |
| QoS | Quality of Service | 0, 1, or 2 |
Topic Patterns:
# Subscribe to all sensors
sensors/+/temperature
# Subscribe to specific device
devices/pump-001/#
Adding a Data Source
- Navigate to Data Sources in the sidebar
- Click Add Data Source
- Select the protocol type
- Enter connection parameters
- Click Test Connection
- If successful, click Save
Browsing Tags
After connecting, browse available tags:
- Click Browse Tags on your data source
- Navigate the namespace tree (OPC UA) or register map (Modbus)
- Select tags to monitor
- Click Add Selected
Tag Configuration
For each tag, you can configure:
| Setting | Description |
|---|---|
| Display Name | Human-readable name |
| Unit | Engineering unit (°C, bar, m/s) |
| Polling Rate | How often to read (ms) |
| Scaling | Linear scaling (y = mx + b) |
| Dead Band | Minimum change to report |
| Data Type | Override detected type |
Data Quality
TwinEdge tracks data quality using OPC UA status codes:
| Quality | Icon | Description |
|---|---|---|
| Good | 🟢 | Valid data |
| Uncertain | 🟡 | Data may be stale or inaccurate |
| Bad | 🔴 | Communication error or invalid |
High Availability
For critical data sources, configure redundancy:
- Click Configure Redundancy on your data source
- Add backup server addresses
- Set failover timeout
- TwinEdge will automatically switch on failure
Data Source Groups
Organize data sources into groups:
- Go to Data Sources → Groups
- Click Create Group
- Drag data sources into groups
- Use groups for access control and dashboard filtering
Troubleshooting
Connection Failed
- Verify network connectivity (ping the device)
- Check firewall rules for required ports
- Confirm credentials are correct
- Review security certificates
No Data / Timeout
- Increase polling interval
- Check device is not overloaded
- Verify tag addresses are correct
- Monitor network latency
Stale Data
- Check device clock synchronization
- Verify polling is enabled
- Review dead band settings
See Troubleshooting Guide for more solutions.