Ensuring Proper OnShow Script Execution
- Last UpdatedJul 13, 2023
- 2 minute read
When an OnShow script includes external references to tags, it is possible that the data from these tags is not yet available when the OnShow script runs. As a result, the script might not work properly.
To avoid this situation, you can enter a value in the Data Timeout field. For the duration of the data time-out period, the system checks for the presence of the external reference data. After all external reference data is present, the system executes the OnShow script.
If the data time-out period expires before all external data is present, the OnShow script is executed. However, the script might not work properly.
The default value in the Data Timeout field is:
-
For new Industrial Graphics, 1,000 ms.
-
For some HMI symbols, 0 ms; that is, the presence of external reference data is not checked. Verify the behavior of your HMI/SCADA software.
The maximum data time-out value is 30,000 ms.
Note the following issues regarding OnShow scripts and the Data Timeout function:
-
The Data Timeout function is not available for the other trigger script types. It would be rare for external reference data to not be available in time for those scripts.
-
The execution of the OnShow script is not delayed if there is an invalid reference (that is, the reference's quality is Bad).
-
Named scripts are blocked until the OnShow script has completed, so some could be missed. For example, the named script OnDataChange might not run for the first few updates.
-
Delayed OnShow scripts within nested embedded graphics might run out of order for the different nested levels. If the outer-most level is delayed but the inner levels are not delayed and are executed immediately, the order of execution will be changed.