Function Signatures

Every script function has the same signature, takes one input argument and returns one output argument. In VBScript and Perl, the input and output arguments are arrays; in MATLAB, each argument is a MATLAB Struct.

Each script function is called for at least two purposes:

  1. To register a list of requested inputs and outputs for the compute function.
  2. To compute the outputs based upon the inputs.

The registration process for a plugin script occurs as an initialization step; if the script successfully initializes, then it can provide the requested inputs and handle the requested outputs when asked to compute. The list of requested inputs and outputs cannot be changed until another initialization step is performed. To aid computational efficiency, the initialization process for a plugin script is performed as infrequently as possible: some plugin scripts initialize only when the STK application starts up (e.g. some calls made for Access Constraint Plugin Points); some re-initialize only when the user requests them to be re-initialized (e.g., Vector Geometry Tool Plugin Points); others re-initialize every time a computational process starts (Astrogator Plugin Points).

The available input and output arguments depend on the Entry Point of the plugin point itself. Some Entry Points have no inputs or outputs, but others can have many inputs and outputs.

The units for inputs and outputs are STK internal units. In most cases, these units are standard SI units such as meter, kilogram, second, etc. An exception is Power, for which the unit is dbW (decibel Watts). Note that angles are in radians.

For examples of a language's function signature, click one of the following:

Note that a condition is checked to determine whether the script function is to return a list of descriptors or is to compute the outputs on the basis of the input values.

 

STK 11.2.1 Programming Interface