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
⚠️ Should Not Be Used:
- Instantaneous measurements (temperature, pressure, current)
- Status information (on/off, running/stopped)
- Speed values (RPM, m/s)
- Level measurements (tank level, %fullness)
Important Notes:
- Forward Filling only works on TAGs with SaveToDatabase active
- Forward Filling does not activate until first data read
- When value decrease is detected, last value is automatically used
- If TAG value is manually reset, Forward Filling continues from new value
Update Rate (Storage Schedule)
Storage Schedule (Timing Configuration)
Storage Schedule determines how often the TAG value will be saved to the database. Offers flexible scheduling options with advanced cronjob structure:
| Schedule Type | Description | Usage Example |
|---|---|---|
| Second | Run every X seconds | Record every 5 seconds for critical security TAGs (fast changing values) |
| Minute | Run every X minutes | Record every 15 minutes for energy meters (standard measurements) |
| Hourly | Run every X hours | Record every 1 hour for temperature sensors (slowly changing values) |
| Daily | Run at specific time each day | Record at 23:59 each day for daily summary reports |
| Weekly | Run on specific days of week | Record at 08:00 every Monday for weekly maintenance TAGs |
| Monthly | Run on specific day of month | Record at 00:00 on 1st of each month for monthly meter readings |
| Custom | Run with custom time ranges | Working hours: Every 10 minutes between 08:00-17:00 Mon-Fri, every 1 hour between 01:00-06:00 at night |
Custom Scheduling Example
With Custom option, you can define different time ranges for each day and custom run time for each range:
- Monday-Friday: Every 5 minutes between 08:00-17:00 (working hours)
- Monday-Friday: Every 30 minutes between 17:00-08:00 (off hours)
- Saturday-Sunday: Every 1 hour all day (weekend)
Performance Tips:
- Too frequent recording (e.g: every second) rapidly increases database size
- Use longer intervals for non-critical TAGs
- Define different intervals for working hours and off hours
- Prevent data loss with Forward Filling feature
Adding New TAG
Step by Step TAG Addition
- Go to Tag List page
- Click "Add New Tag" button
- Select TAG type (Standard/Static)
- Enter Tag Name and Friendly Name
- Select Category
- Select Station (for Standard TAG)
- Specify Address and Data Type
- Set Forward Filling (if needed)
- Check Writable (if needed)
- Set SaveToDatabase and Storage Schedule (if needed)
- Save and test
TAG List Page
TAG Listing
You can see real-time values of all TAGs on Tag List page:
- Instantaneous TAG values
- Last update time
- Quick filtering and search
- Export features (Excel, CSV, JSON)
- Go to Tag Detail(History) page
- Tag Edit
- Tag Delete
Best Practices
Recommendations
- Keep TAG names standard and descriptive
- Write Friendly Names understandably
- Assign category for each TAG
- Optimize Storage Schedule according to need
- Don't SaveToDatabase unnecessary TAGs
- Regularly test critical TAGs
- Establish and apply naming convention
Common Issues
Cannot Read TAG Value
- Check Station connection
- Verify TAG address is correct
- Check data type is compatible
- Check that relevant area exists in PLC
Reading Wrong Value
- Check data type (INT/DINT/REAL)
- Check Byte order (Endianness) settings
Cannot Establish Connection
- Check IP address and port number
- Test network connection (ping)
- Check firewall settings
- Make sure PLC is in RUN mode
- Check Rack and Slot numbers are correct (For Siemens)
- Check Node ID/Unit ID numbers are correct (For Modbus)
- Check Address numbers are correct (For OPC)
Cannot Read Data
- Check device connection is active
- Verify TAG addresses are correct
- Check data types are compatible
- Make sure relevant data blocks in PLC are not optimized
Write Operation Failed
- Check TAG's "Writable" feature is active
- Make sure there is no write protection in PLC
- Check value to be written is compatible with data type
- Check user permissions