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

TypeDescriptionExample
Standard TAGReal data read from PLC/DeviceSiemens DB100.DBD0, Modbus 40001
Static TAGFixed value, used in formulasPi number, conversion coefficients
Calculated TAGCalculated from other TAGsCreated 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 NameDescriptionStatus
Friendly Name/Global Tag NameUser-friendly name and unique TAG nameRequired
Tag CategoriesTAG categoriesOptional, Recommended
Select Tag SourceTAG source - type. OPC, Siemens, Modbus, StaticRequired
Station NameConnected stationRequired for Siemens - Modbus TAG
Data Block TypeData Block type (REAL, INT, DINT, BOOL, STRING)Required for Siemens - Modbus TAG
Data Block NumberData Block numberRequired for Siemens TAG
Data Block OffsetData Block offsetRequired for Siemens TAG
Modbus TypeModbus type (Discrete Input, Coil, Holding Register, Input Register)Required for Modbus TAG
Modbus AddressModbus addressRequired for Modbus TAG
Tag NameOPC tag nameRequired for OPC
OPC AddressOPC tag addressRequired for OPC
Static ValueFixed valueFor Static TAG
Forward FillingFill with previous value in case of data loss (Useful for metrics that should not be reset (e.g. electricity, water, gas))Optional
WritableWritable TAG (If TAG will be intervened with formula)Optional
Save To DatabaseEnable historical data storage for this tagOptional
Storage ScheduleDatabase 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 TypeDescriptionSizeExample Address
BOOLBoolean (true/false)1 bitM0.0, DB1.DBX0.0
BYTE8-bit unsigned1 byteMB0, DB1.DBB0
INT16-bit signed integer2 byteMW0, DB1.DBW0
DINT32-bit signed integer4 byteMD0, DB1.DBD0
LINT64-bit signed integer8 byteML0, DB1.DBW0
REAL32-bit float4 byteMD0, DB1.DBD0
WORD16-bit unsigned2 byteMW0, DB1.DBW0
DWORD32-bit unsigned4 byteMD0, DB1.DBW0
STRINGTextVariableDB1.DBB0

Address Formats

PLC Address Examplesjavascript
// 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 1

Siemens Address Structure

DB (Data Block): DB[BlockNo].DB[Type][Offset]
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

0xxxx: Coil (Read/Write)
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

Situation: Electricity meter shows 1000 kWh
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

Static TAG Usage

Fixed Value TAGs

Static TAGs are fixed values not read from PLC. Used as coefficient, conversion factor or reference value in formulas.

Example Uses:

  • Pi number (3.14159)
  • Electricity unit price (TL/kWh)
  • Natural gas conversion coefficient
  • Maximum/minimum limits
  • Alarm threshold values

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 TypeDescriptionUsage Example
SecondRun every X secondsRecord every 5 seconds for critical security TAGs (fast changing values)
MinuteRun every X minutesRecord every 15 minutes for energy meters (standard measurements)
HourlyRun every X hoursRecord every 1 hour for temperature sensors (slowly changing values)
DailyRun at specific time each dayRecord at 23:59 each day for daily summary reports
WeeklyRun on specific days of weekRecord at 08:00 every Monday for weekly maintenance TAGs
MonthlyRun on specific day of monthRecord at 00:00 on 1st of each month for monthly meter readings
CustomRun with custom time rangesWorking 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

  1. Go to Tag List page
  2. Click "Add New Tag" button
  3. Select TAG type (Standard/Static)
  4. Enter Tag Name and Friendly Name
  5. Select Category
  6. Select Station (for Standard TAG)
  7. Specify Address and Data Type
  8. Set Forward Filling (if needed)
  9. Check Writable (if needed)
  10. Set SaveToDatabase and Storage Schedule (if needed)
  11. 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