Data specific to the thin clients

July 19, 2016 | Stepan Drzka

Up to version 4.7.2, all Reliance's thin clients connected to the data server (Reliance Server or Reliance Control Server) had always had the same data, i.e., values of all tags. This is all right when physical tags are concerned (e.g., the tank-level value transferred from the PLC) – each client must have the same data about the level in the tank. Auxiliary (internal) tags, however, may have a different behavior. In some cases, the clients must not share tag values.


One such an example is an application that displays data depending on which user is logged on. A thin client user logs on. Then, based on the user's name, the data server prepares data (tag values) that will be displayed to the user. Different data, however, must be displayed to a different user (who can be logged on at the same time). This data is only intended for this user. But both users use the same set of tags and view the same visualization window. On the server, therefore, there is
a separate version of these tags for each connected client. The question arises as to how the server prepares data for the client.


This can be solved using scripts: each script invoked by the thin client gets executed in its context and always works with its version of tags. The RScr.GetCurrentScriptDataEx function allows you to find out the name of the user in a script and, based on this name, prepare the data. If needed, you can also detect the name of the thin client session and thus verify that the script was invoked by the thin client (if not, the session's name will be an empty string).


Another example can be an application that shows the user the contents specified by the value of the “control” tag. For example, the Container component allows displaying data of a structured tag with a dynamic link. The structured tag's name is specified by the value of another (control) tag.



In that case, it is desirable that each thin client have its own value of this tag (each client needs to see another structured tag's data). The value of the control tag need not be transferred to the server at all. The data server doesn't work with it.


There are more similar cases and, in the future, it is expected that their number will increase as dynamic links expand within the Reliance SCADA system.


The behavior described above can be configured for internal tags via the Device Manager using a combination of the following two options: Share with thin clients, Transfer between server and thin clients:


Device Manager – Sharing

Device Manager – Sharing



Share with thin clients

Transfer between server and thin clients

Behavior

Yes

The data server and all connected thin clients have a common tag value.

No

Yes

The tag value is transferred between the server and the client.
The data server maintains a separate tag value for each connected client.

No

No

The tag value is not transferred between the server and the client at all. The value written into this tag is not transferred to the server, it is only stored in the thin client's internal memory.

If you want to use tags specific to a thin client for working in a script, it is essential that the script get executed in the context of this thin client. To achieve this, the user must execute the script from the thin client based on an operation (user log-on/log-off, button click, etc.). However, it is sometimes necessary that the script get executed in the context of a thin client without any user operation. The RScr.ExecScript function, to which an optional parameter named ExecForEachThinClient was added in version 4.7.3, is used for this purpose.


RScr.ExecScript Script: Variant; PriorExec: Boolean; [ExecForEachThinClient: Boolean]

If the value of ExecForEachThinClient is True, the script gets executed in the context of all currently connected clients. This allows, for example, updating the values of tags specific to the thin clients at the server side.


Reliance Earth Icon

Top