Tips to ensure proper On Show script execution
- Last UpdatedJul 16, 2024
- 2 minute read
When an On Show script includes external references to ApplicationObject attributes, data from these attributes may not be immediately available when the On Show script runs. As a result, the script might not work properly.
To mitigate this possibility, you can enter a value in the Data Timeout field. The Data Timeout period sets a time limit to allow reference data to become available. At the end of the Data Timeout interval, or before the timeout expires if the reference data is available sooner, the On Show script is executed. Note that data quality is not checked, only that the data is available.
If the Data Timeout expires before all reference data is available, the On Show script is still executed. However, the script might not work properly.
You can reduce the possibility of linking to invalid data by having the script first test the quality and status of the attribute before using it in the rest of the script.
The default value in the Data Timeout field is 1000 ms (one second). The maximum data time-out value is 30,000 ms (30 seconds).
Note the following issues regarding On Show 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 On Show script is not delayed if there is an invalid reference (that is, the reference's quality is Bad).
-
Named scripts are blocked until the On Show script has completed, so some could be missed. For example, the named script OnDataChange might not run for the first few updates.
-
Delayed On Show 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.
Note: You can increase the effective data time out period for an On Show script by using the Additional settings feature when editing an OMI ViewApp. See Set additional properties for a ViewApp for more information.