Tags
Definitions for reading Siemens, Modbus and OPC TAG values. Advanced control with SaveToDatabase and Writable features.
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 |
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 |
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
SaveToDatabase Feature
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.
⚠️ 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.
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
Update Rate (Storage Schedule)
| 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 |
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
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
Best Practices
- 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