Data Model
2WinScada keeps every value from the field as a tag. Tags are placed in two separate structures:
| Structure | Levels | Used for |
|---|---|---|
| Communication structure | Channel → Device → Tag | Where and how the value is read |
| Monitoring structure | Process group → Task center → Device | How values are grouped on the dashboard and who sees them |
The communication structure is defined on the Tag Management screen, the monitoring structure on the Process Groups and Task Centers screens. In the communication structure a device is always under a channel; adding it to the monitoring structure is a separate step.
Channel, Device and Tag
| Level | Defines |
|---|---|
| Channel | The communication protocol and its protocol-specific connection settings. Channel names are unique in the system. |
| Device | A single source reached through the channel (PLC, energy analyzer, OPC server, external system). Device names are unique within the channel. If Active is not checked, 2WinScada does not communicate with the device. |
| Tag | A single value on the device: address, data type, update interval, unit, scaling and write permission. |
A tag is referred to by its full name together with the channel and device names, in the form Channel.Device.Tag. Page bindings, expressions and snapshot names use this full name.
With most protocols 2WinScada reads the device itself. With some protocols, such as REST Server, the value is sent to 2WinScada by the external system. Protocol-specific settings are in the Protocols section. For many devices of the same type you can use Device Profiles.
When device or tag definitions change, the device must be restarted for the change to reach the running communication. Such devices are marked Needs ReInitialize on the Device States screen.
Tag Types
Normal Tag
A tag whose value is read from the device or sent by the device. If Scale Active is checked, the raw value read is scaled according to the Scale Min Raw/Scale Max Raw and Scale Min/Scale Max ranges.
If Read Only is not checked, values can be written to the tag. To write a value, the user needs the Operate or Editor role (see Process Groups and Access). For Pulse and Rising edge commands, the user must also see the tag within their process group scope (see Tag Write Scope).
Advanced Tag
The value of a tag with Advanced Tag checked is not read from the device; it is calculated from the values of other tags with the expression in the Expression field. One advanced tag definition can be made per tag. The steps are on the Advanced Tag Definition page.
| Setting | Meaning |
|---|---|
| Trigger Type | When the calculation runs: Cyclic (at the tag's update interval), On Change (when a tag in the expression changes), On Trigger Change, Trigger Rising Edge, Trigger Falling Edge (based on the Trigger Tag). |
| Value Type | Whether the calculated instantaneous value or an accumulated value, such as an average, is used. |
| Linked Tag | If selected, the calculated value is also written to this tag. The write is made only while the linked tag's quality is good. |
| Bad Quality Behavior | What to do while the quality of tags in the expression is bad: Not Calculate, Previous Value or Custom Value (with Custom Bad Tag Value). |
| Start Value | The value given to the tag when the service starts, before the first calculation. |
| Persistent | If checked, the last calculated value is stored and used instead of the start value when the service restarts. |
System Addresses
Every device reports its communication state through two system addresses. You add them from the Choose a device system address menu in the tag definition or with the Quality tags button in the tag table:
| Address | When the value is 1 |
|---|---|
_ConnError | There is no connection to the device. |
_TagQualityBad | The device has at least one tag with bad quality. |
These tags are not read from the device; 2WinScada produces their values. Their data type is Bool and they are read-only. Like normal tags, they can be used in alarm definitions, log definitions and pages; for example, to raise an alarm when a device loses its connection, define an alarm on the _ConnError tag.
Quality
Every tag value comes with quality information. Quality shows whether the value can be trusted:
| Quality | Meaning |
|---|---|
| Good | The value was read correctly from the device or the remote system. |
| Bad | Reading failed; the tag's value is not current. |
| Uncertain | The tag has not been read yet or, with some protocols, the configured address was not found in the response. |
The device itself also has Good or Bad quality. On the dashboard, the connection state of a process group or task center is derived from the quality of the records under it: green if all are good, red if all are bad, orange if mixed (see Dashboard).
Quality is not only an indicator:
- Timed and triggered archive records are not taken while the quality of the tag (and of the trigger tag, if any) is not Good. Details: Archiving.
- For advanced tags, Bad Quality Behavior decides what happens with bad-quality inputs.
Tag and device quality is monitored live on the Tag States and Device States screens.
Update Interval
The Update Interval in the tag definition is, for protocols that read the device, how often the tag is read, in seconds. This interval matters in three places:
- Screens: Changed values are sent to open screens immediately, but a change on the device is seen at the next read at the earliest.
- Archive and alarms: Alarm conditions, archive records with the On Change log type and accumulated log values are evaluated when the tag's value changes. A change that starts and ends between two reads is not seen (see Archiving).
- Advanced tag: Advanced tags with the Cyclic trigger type are recalculated at their own update interval.
A short update interval increases the load on the device and the network. You can change the update interval of all tags of a device at once from the tag table toolbar.
Task Centers, Buildings and Departments
In the monitoring structure, devices are collected in task centers and task centers in process groups:
- Every Task Center belongs to exactly one process group; selecting a process group is mandatory.
- A device is in at most one task center. A device that is not added to a task center keeps communicating, but it does not appear under any process group on the dashboard.
- Tags can be attached to a process group not only through task centers but also directly, through process groups of the Tag Group type. The difference between the two types is explained on the Process Groups and Access page.
Two optional details can be added to a task center:
| Detail | Source |
|---|---|
| Department | Department Definitions: a unique code, a name and a description. Departments can also be assigned to users. |
| Location | Building Definitions: the Locations in Building defined under each Building. |
Department and location do not grant permissions. They are used to filter task centers and devices and to show location information on the dashboard. Department selection lists are narrowed to the task centers in the process groups the user can see.