The Expression tool is similar to the Data Item tool in that is allows you to place dynamic data items. However, the Expression tool lets you combine several data items in a mathematical expression. This is useful if you don't want to decode a specific data block using an according mathematical expression but just want to setup a quick Conversion Function. This way you don't have to set up a decoder that decodes the source block(s) into a destination block, define the destination block and finally display the result. Once you define an Expression and load the Formula Definition file you can access the function from the dialog displayed below as well as from Python code.
Expression objects can be displayed in the same styles as a simple data item. Please refer to the Style/Data Item section for a detailed explanation of the various formats available. The Expression tool can also be activated from the toolbar with the
button. After you finish selecting your drawing area the specific dialog to specify your Expression and parameters pops up:
The Expression dialog is structured into two parts. First you have to select a predefined Expression. Expressions are defined in Formula Definition files and have to be loaded before they can be accessed. If you don't find your Expression function in the drop down list you can use the GSEOS Explorer to show you all loaded Expressions. Once you select an Expression, the function is displayed with it's formal parameters. The second part of the dialog assists you with filling in the actual parameters to be evaluated. Actual parameters can either be data items as described in the block definition file or constants. It is not possible to nest Expressions. Although, when defining an Expression you can use other Expression functions and nest them in this way.
Triggers
The actual parameters of an Expression can be data items located in different blocks. This means that these blocks will arrive at different times. The question is: When should the function be evaluated? To allow you to specify the execution sequence the concept of triggers is introduced. If your function takes parameters from different data blocks you can set a trigger on any block to invoke the evaluation of the function. A trigger is indicated with an asterisk. There only needs to be one trigger per block, however, if you set a trigger on multiple items of the same block the function is only evaluated once. There needs to be at least one trigger on one of the data items to evaluate the Expression.
To set a parameter select the according formal parameter in the Select Parameters list box. To select a data item click on the Select Item... button, to select a constant click on the Enter Constant... button.
When you click on the Select Item... button the standard data item select dialog opens and you can specify the data item you want to use as the actual parameter. Note that you can use array items as parameters, however in this case the dimensions of all parameters need to be the same. Constants can be used in conjunction with array item parameters. To specify a constant use the Enter Constant Dialog:
Any valid float number is acceptable as a constant.
Please note that data items are not typed, so if you need a signed or floating point representation of the bit pattern you have to use one of the conversion functions available. For more complex Expressions a specific decoder is the more appropriate solution. As with the data item be careful with displaying large array items. Otherwise, all the stlye options that can be set for a data item are also applicable to Expressions.