Tags
Definitions for reading Siemens, Modbus and OPC TAG values. Advanced control with SaveToDatabase and Writable features.
Overview
The Tags module is the heart of the system. Each TAG represents a data point and reads real-time data from PLCs, sensors or other devices. TAGs can also be used in formulas, saved to database and visualized on dashboards.
What is a TAG?
TAG is the name of a data point in industrial automation systems. For example, a compressor's pressure value, a motor's operating status, or an energy meter's instantaneous power value are all TAGs.
TAG Types
| Type | Description | Example |
|---|---|---|
| Standard TAG | Real data read from PLC/Device | Siemens DB100.DBD0, Modbus 40001 |
| Static TAG | Fixed value, used in formulas | Pi number, conversion coefficients |
| Calculated TAG | Calculated from other TAGs | Created with Advanced TAG |
Key Features
- Real-time data reading and writing
- Automatic database recording (SaveToDatabase)
- Flexible update frequency settings
- Multiple data type support
- Static TAG support (for formulas)
- TAG-based alarms and notifications (with formulas)
- Detailed TAG history and trend analysis
- Export features
TAG Fields
| Field Name | Description | Status |
|---|---|---|
| Friendly Name/Global Tag Name | User-friendly name and unique TAG name | Required |
| Tag Categories | TAG categories | Optional, Recommended |
| Select Tag Source | TAG source - type. OPC, Siemens, Modbus, Static | Required |
| Station Name | Connected station | Required for Siemens - Modbus TAG |
| Data Block Type | Data Block type (REAL, INT, DINT, BOOL, STRING) | Required for Siemens - Modbus TAG |
| Data Block Number | Data Block number | Required for Siemens TAG |
| Data Block Offset | Data Block offset | Required for Siemens TAG |
| Modbus Type | Modbus type (Discrete Input, Coil, Holding Register, Input Register) | Required for Modbus TAG |
| Modbus Address | Modbus address | Required for Modbus TAG |
| Tag Name | OPC tag name | Required for OPC |
| OPC Address | OPC tag address | Required for OPC |
| Static Value | Fixed value | For Static TAG |
| Forward Filling | Fill with previous value in case of data loss (Useful for metrics that should not be reset (e.g. electricity, water, gas)) | Optional |
| Writable | Writable TAG (If TAG will be intervened with formula) | Optional |
| Save To Database | Enable historical data storage for this tag | Optional |
| Storage Schedule | Database save frequency (e.g. every 15 minutes or more complex structures). Configure different time ranges for each day. Each time range can have a custom run time. | Optional |
Data Types
| Data Type | Description | Size | Example Address |
|---|---|---|---|
| BOOL | Boolean (true/false) | 1 bit | M0.0, DB1.DBX0.0 |
| BYTE | 8-bit unsigned | 1 byte | MB0, DB1.DBB0 |
| INT | 16-bit signed integer | 2 byte | MW0, DB1.DBW0 |
| DINT | 32-bit signed integer | 4 byte | MD0, DB1.DBD0 |
| LINT | 64-bit signed integer | 8 byte | ML0, DB1.DBW0 |
| REAL | 32-bit float | 4 byte | MD0, DB1.DBD0 |
| WORD | 16-bit unsigned | 2 byte | MW0, DB1.DBW0 |
| DWORD | 32-bit unsigned | 4 byte | MD0, DB1.DBW0 |
| STRING | Text | Variable | DB1.DBB0 |
Address Formats
// Siemens S7 Adres Örnekleri
DB100.DBD0 // Data Block 100, Double Word 0
DB100.DBW10 // Data Block 100, Word 10
DB100.DBX0.0 // Data Block 100, Byte 0, Bit 0
M10.5 // Memory Bit 10.5
MW20 // Memory Word 20
MD30 // Memory Double Word 30
// Modbus Adres Örnekleri
40001 // Holding Register 1
30001 // Input Register 1
10001 // Coil 1
00001 // Discrete Input 1Siemens Address Structure
M (Memory): M[Type][Offset]
I (Input): I[Type][Offset]
Q (Output): Q[Type][Offset]
Type: X (Bit), B (Byte), W (Word), D (Double Word)
Modbus Address Structure
1xxxx: Discrete Input (Read Only)
3xxxx: Input Register (Read Only)
4xxxx: Holding Register (Read/Write)
Note: xxxx = starts from 0001 (40001 = Register 0)
SaveToDatabase Feature
Automatic Database Recording
When the SaveToDatabase feature is activated, TAG values are automatically saved to the database at the specified update frequency.
Advantages:
- Ability to perform historical data analysis
- Creating trend charts
- Reporting and comparison
Considerations:
- Database size can grow rapidly
- Adjust update frequency according to need
- Don't save unnecessary TAGs
Writable Feature
Writable TAGs
When the Writable feature is activated, the TAG value can be changed through the Smart Energy system. This feature is used for automatic intervention in formulas.
Use Cases:
- Automatic energy optimization
- Device on/off controls
⚠️ Security Warning:
- Make only necessary TAGs writable
- Don't make critical security TAGs writable
- Monitor write operations in logs
Forward Filling Feature
Data Continuity and Forward Filling
Forward Filling is the feature of using the last recorded value in case of data loss or value decrease. This feature is especially critical for continuously increasing metrics such as meter readings.
When to Use:
- Data loss: When connection is lost or data cannot be read
- Value decrease: When meter value unexpectedly drops
Use Cases:
- Electricity meters: kWh values continuously increase, not reset
- Water meters: m³ values continuously increase
- Natural gas meters: m³ values continuously increase
- Production counters: Total production count
- Operating hour counters: Machine operating hours
Example Scenario
Problem: Network connection lost or PLC not responding
Forward Filling OFF: TAG value becomes NULL or 0 ❌
Forward Filling ON: TAG value remains as 1000 kWh ✅
Result: No data loss, reporting works correctly, charts are not broken