Back

Topic

[KB728]Reducing client startup time by using SynchronisationByCache

Tags: Client, Multistation, Networking, Varconf.dat

11 years ago
By RM
Options
Print
Applies to:PcVue 10.0 SP1 and later

Summary:The SynchronisationByCache key can be added to a project’s VARCONF.DAT file to reduce the startup time of a client station. This is for client workstations, but the setting is taken into account on the server workstation.

Details:The following key can be added to a project’s VARCONF.DAT file to reduce the startup time of a client station.

[LOCALSERVER\Subscribe]
SynchronisationByCache=1

LOCALSERVER key MUST NOT be replaced with the station name !
Note that it is essential that this key is on the server workstations. This is not a problem if it is also on the client workstations.
So ideally we put the section in the Varconf of version management.

The setting informs the server station not to request the latest value of a variable from the source device. Instead it presents the most recent value that it has in its memory to the client. The theoretical performance gain is the amount of time that it would take to request the value from the device and to wait for its response, multiplied with the amount of variables subscriptions that need to be processed by the server station.

This option is used for variable sources other than internal.

Detailed behavior

When the Variable Manager receives a subscription request the behavior is as follows.

IF the VTQ of variable is refreshed (the variable is connected to the device and has been refreshed by it, the VTQ can be NSCOM if the device is not accessible)

THEN Immediate acknowledgment of the subscription with the current VTQ (which would be the normal case where all is well with communication)

ELSE IF  the variable is already subscribed but the VTQ is not yet refreshed

THEN
      IF SynchronizationByCache = true

      THEN Immediate acknowledgment of the subscription with the current VTQ (VTQ that the server/Asso has in its cache)
      ELSE
Nothing to do, the acknowledgment will be done when the device sends a response (by polling in progress or waiting for device notification) or acknowledgment because of a time out (most likely time out in that case)
      END IF

ELSE IF the variable is not already subscribed

THEN (if NSCOM/NSLAN… = not initialized at client level ; and since it’s suscribe in the Manager PcVue sense, it only makes sense if you’ve unchecked the Permanent Mimic Scan option.)
Send a subscription to the device (subscribes in the “PcVue Manager” sense of the term)     

       IF      SynchronizationByCache = true

      THEN Immediate acknowledgment of the subscription with the current VTQ (VTQ that the server/Asso has in its cache)
      ELSE
Nothing to do, the acknowledgment will be done when the device sends a response (most likely device answers because it was sent just before) or ACK by time out
      END IF
END IF
END IF
What is the meaning of the phrase “VTQ of a variable is refreshed”?

VTQ means Value, Timestamp and Quality.

When you load a variable from its configuration, the Quality is initialized to Bad, the Timestamp is the timestamp at loading and the value is:
0 for a bit,
off for an alarm,
minimum for a register,
empty string for a text.

On the first reception of a request for subscription, if the variable is produced and if the source is not internal then a subscription is sent to the device. When the device responds with a Value (and timestamp if the protocol is timestamped) the VTQ is updated and its status is set to refreshed.

If the variable is consumed, the subscription is redirected to the producer server or association. The producer sends the response containing the VTQ, from which the VTQ of the variable will be refreshed. Refreshed means up to date with the device.

In the case where the active producer station is subscribed to the variable, the VTQ of the client and the server are identical:

Advanced properties of variables subscribed

On the other hand, if the active producer station is not subscribed, the VTQ in memory corresponds to the last time it was subscribed, perhaps 1h or 2h or 24h or more ago. It is a possible scenario if the general setting regarding the permanent scan for mimic is not set:

Permanent scan setting

And the variable is not subscribed by the server:

Advanced properties of variables not subscribed

So when the client subscribes to the variable, the server returns the current VTQ and makes a request to the device associated with the variable to retrieve its VTQ. When the device returns the VTQ, if it is different from the cache then the server updates its cache and sends it to the client.

We see that in this case the client can receive an old value before obtaining the current value.


Created on: 05 Feb 2015 Last update: 27 Mar 2025