Internal (Memory Channel)
Internal is a channel type that does not connect to a field device and keeps tag values in the memory of the 2WinScada service. Its connection type code is 999; in REST API responses, the channel type appears with this code.
The Internal channel is used for these purposes:
- Calculated and simulated values: Advanced tags whose value is calculated with an expression can be defined on an Internal device. The simulated tags of the sample project work this way.
- Memory tags: Hold settings, commands and intermediate values written by the operator, pages, recipes or event code (e.g. a selection or a counter shared by several pages).
- Tags created by the system: Recipe state tags (the last applied group and recipe) are kept on the RecipeState device in the Internal channel.
License
The Internal channel can be used in all license packages. Active Internal devices and tags count toward the license's device and tag capacity, as with other protocols. For license details, see the License page.
Internal channel created at installation
In a new database, when the 2WinScada service starts for the first time, it creates a channel named Internal and, in this channel, the Demo, Trafo1_EA and Trafo2_EA devices of the sample project (see Sample project). The recipe module also uses the same channel for the recipe state tags; if the channel does not exist, it creates the Internal channel and the RecipeState device itself when the first recipe group is created or the first recipe is applied.
| Device | Content |
|---|---|
| Demo | The pump station of the sample project: 14 simulated tags (pump, valve, tank, energy, etc.). Pages and expressions bind to these tags with the name Internal.Demo.<tag>. |
| Trafo1_EA, Trafo2_EA | The two simulated energy analyzers of the sample project; each has the same 17 tags: line voltages U12, U23, U31, frequency F, phase and neutral currents I1–I3, IN, power factor PF, phase and total active power P1–P3, KW, reactive power KVAR, KVARC, KVARL and the active energy counter KWH. Each KWH tag has a consumption log. The Enerji Analizörü (Energy Analyzer) template page binds to these tags with relative names (.KW, etc.); the links on the Genel Bakış (Overview) and Tesis Özeti (Plant Summary) pages open it with the tag prefix Internal.Trafo1_EA or Internal.Trafo2_EA. |
| RecipeState | Recipe state tags (e.g. currentRecipeName). Listed in the Recipe state section of the System tab in the tag picker. See Recipe Management. |
Do not delete or rename the Internal channel
If the channel is deleted, all devices and tags under it are deleted too. Page indicators, log and alarm definitions, and expressions bound to these tags stop working.
- If you no longer need the simulation, set the Demo, Trafo1_EA and Trafo2_EA devices to inactive instead of deleting them; an inactive device does not count toward the license capacity, its consumption logs do not write records, and the pages remain.
- Do not rename the channel or the Demo, Trafo1_EA, Trafo2_EA and RecipeState devices. The expressions of the sample project read the tags with the names
Internal.Demo.…andInternal.Trafo1_EA…/Internal.Trafo2_EA…; the recipe module finds the channel and the device by name and creates a new one if it cannot find them. - Do not delete or change the tags on the RecipeState device manually; the system writes them when a recipe is applied.
Channel Definition
For your own memory tags, you can add a new device to the existing Internal channel or open a separate Internal channel.
On the General tab of the new channel window, enter the channel name and select Internal as the Connection Type. This protocol has no connection parameters at channel level. Click Save to create the channel. The common definition screens are described on the Tag Management page.
Device Definition
Internal devices have only a device name and the Active state; there are no connection or communication parameters.
The connection state of an active Internal device becomes Connected when the service starts. Because there is no communication, no connection error occurs.
Tag Definition
Tags are defined in the device's tag table in the same way as for other protocols. Two kinds of tags are used on Internal devices:
| Tag kind | Source of the value | When the service restarts |
|---|---|---|
| Advanced tag | The expression in the Expression field (see Advanced Tag Definition). If the expression is _self.Value, the value written to the tag is kept as is. | Starts with the Start Value. If Persistent is selected, it continues with the last stored value. |
| Non-advanced tag | Only the value written to the tag (by the operator, a page, a recipe or event code). | The value is lost; the tag has no value until the first write. |
- The Address field is not used for the connection. If the field must be filled in, write a short text that describes the purpose of the tag.
- Define memory tags that must keep their value when the service restarts as advanced tags with the expression
_self.Valueand Persistent selected. - Writing to Internal tags, like other tags, requires the Operate or Editor role and the tag not being read-only.
Example: Simulation in the sample project
The Demo device of the sample project has two kinds of tags:
- Command and setting values such as
Pump1_StartCmdandPump1_SpeedSPare advanced tags with the_self.Valueexpression. The buttons and input fields on the page write to these tags. - Measurements such as
Pump1_Speed,Tank1_LevelandTank1_Temperatureare advanced tags with the trigger type Cyclic. Their expressions read the other Demo tags withTAG(Internal.Demo.…)and add small random fluctuations.
The tags of the Trafo1_EA and Trafo2_EA devices are read-only advanced tags calculated every second. Voltage, current and power factor are generated with small fluctuations; the phase powers are calculated from these values, KW from the sum of the phase powers, and KWH by adding KW / 3600 kWh to the counter every second. Trafo1_EA feeds the pump: its phase currents include the value of TAG(Internal.Demo.Motor_Current), so the current and power of Transformer 1 rise while the pump is running.
In your own project, you can use the same method to test screens before the field devices are connected: on an Internal device, define simulated tags with the same names as the field tags and test the pages with them. When the real device is connected, change the tag names on the page with Replace a string (see Page Editor).
Troubleshooting
| Symptom | Checks |
|---|---|
| The value of a memory tag is lost when the service restarts | The tag is a non-advanced tag. Define it as an advanced tag with the expression _self.Value and Persistent selected. |
| No values appear on the sample project pages | Check that the Demo, Trafo1_EA and Trafo2_EA devices are active and that the license capacity is not exceeded. When the Enerji Analizörü page is opened from the menu, it shows no values because there is no tag prefix; open the page with the TR1 Energy Analyzer and TR2 Energy Analyzer links on the Pages card of the Genel Bakış page or with the transformer links on the Tesis Yerleşimi or Tesis Özeti page. |
| Yesterday or Last Month is empty on the Enerji Analizörü page | The sample project does not come with historical data; the consumption logs write records from the time of installation. Yesterday fills when the first day after the installation is over, Last Month when the first month is over. |
| Recipe state tags do not appear in the tag picker | The tags are created when the first recipe group is created or the first recipe is applied. Check that a recipe group has been created. |