The data source variables are updated cyclically in runtime mode. Only the data is updated that either is used in the current visualization or has the property “Update always”.
You can define the time interval. Moreover, you can define variables whose data is transferred in each update interval, and therefore they are always update. To update variables that are not used in the application code, you can implement an update programmatically with the help of interface functions from the data source manager.




NOTICE

If data traffic between the remote and local device is too high, then the update rate is reduced automatically. This can lead to an incomplete transfer.
See also
Setting the update rate
-
Open the editor of the data source.
-
Click the “General and Diagnosis” tab.
-
Specify a value in the “Update rate” field.
Example:
100
The data from the remote device to the local device is transferred every 100 ms.
See also
Selecting the variable for 'Update always'




NOTICE

Avoid updating too many variables always. Each update produces additional data traffic at the connection between the remote and local devices. When data traffic is too high, the update rate is reduced automatically. This can lead to an incomplete transfer.
-
Open the editor of the data source.
-
Activate the option “Update always” for a variable.
The data of the variables is transferred at each update cycle, even when the data has not changed.
See also
Updating data programmatically
The data source manager provides interface functions in the Datasources
library. If a data source manager is integrated in the application code, then the
global variable g_Datasources
is instantiated automatically. This provides access to the interface functions.
Then you can update individual variables that are not called in the active visualization.
Example
The variable ivar
is activated and deactivated by means of methods from the Datasources
library so that its value is transferred. Furthermore, you can configure that the
variable is updated only over a defined duration in order to save transfer capacity.
//Synchronize with DatasourcesTask and block until access is possible //Regard the feedback in ERR_OK or in ERR_DE_MULTITASKING_LOCKED g_Datasources.BeginDataConfiguration(TRUE); // Activate variable g_DataServer.UseData(ADR('RemoteDevice.Application.PLC_PRG.iVar')); // Deactivate variable //g_DataServer.ReleaseData(ADR('RemoteDevice.Application.PLC_PRG.iVar')); g_DataServer.EndDataConfiguration();
The data configuration is started with BeginDataConfiguration(TRUE)
, thus initializing the synchronization of the task DatasourceTask
with the application task. The value TRUE
blocks the processing until the access to the variable is possible; FALSE
repeats access attempts without blocking. The return values ERR_OK
and ERR_DS_MULTITASKING_LOCKED
provide feedback about the access attempts.
When synchronization is successful, the variable is activated by means of the UseData
method. Then the data configuration is completed with the EndDataConfiguration
method and the synchronization triggered again with the task DatasourceTask
.
The ReleaseData
method is used in the same way for deactivating the variable again at the desired
processing time.