Script block
The Script block provides for the manipulation of fields through the use of a script. A script is comprised of a group of commands stored in a file that are run one at a time, from the beginning of the file to the end, that describe a sequence of actions to be performed on input data (although this is not always the case) to generate one or more output fields.
Note: This block has been deprecated, and this help information is available simply to ensure backwards compatibility.
Script block
Description
The Script block allows the user to introduce new variables or manipulate existing ones. The value, time stamp and quality of output fields are controlled by the script. The script is run from top to bottom every time the block executes. If an output field is configured that has the same name as a particular input field, the value, time stamp and quality of the input field is copied to the output field before the script executes. The scripting language, very similar to Pascal, allows for the implementation of rules and custom formulas.
Script block
Block Type
Rules and Models block
Input/Output ports
The input port can accept any number and any type of fields.
The number and type of output fields are determined by the configuration
Functions performed on tags
The values, timestamps and qualities of fields are controlled by the script.
-
The value of a field stays unmodified if the script does not assign a value to it. In the first execution the output value is 0.
-
The time stamp of a field stays unmodified if the script does not assign a value to it. In the first execution the time stamp is a value that is before any other time stamp.
-
The quality of a field stays unmodified if the script does not assign a value to it. In the first execution the quality is bad.
Example
Assume we wish to implement the equation shown below, and that f' and u are inputs to the block and that l, d and g are constants.
The script will have to specify the values of the constants and must then calculate hf. The script would look similar to the one shown below, note that in this example a check is done on the quality of the input fields to determine whether they may be used with confidence or not.
>> More Examples showing typical uses for the script block
Related topics: