Operator Library: Parameters
Operator FloatParamTranslator allows translated access (read and write) to parameters of one or several other operators. For calculation, you define formulas. The syntax for these formulas complies to GenICam API version 2.0.
Availability | |
---|---|
To use the FloatParamTranslator operator, you need either an Expert license, a Parameter Module license, or the VisualApplets 4 license. |
Operator FloatParamTranslator generates a map parameter of type VA_DOUBLE. The name of the map parameter is Value.
Although the operator defines the type of its parameter Value to be of type VA_DOUBLE, it does not restrict the data types of the parameters which are accessed during the write or read operations.
Read Action
In parameter ReadAction, you define what happens for a read access to parameter Value of the translation operator. Parameter Value doesn't simply hold a value. Instead, the value of parameter Value is calculated out of a formula. This formula you define in parameter ReadAction. As soon as there happens a read access to parameter Value, the formula you defined in ReadAction is carried out and the result is forwarded to the element asking for the value.
The formula can contain values of operator parameters anywhere in the design. As soon as one of these values changes, the calculation of translation operator's parameter Value will end up with a new result (different to the value parameter Value held before). The formula can not only incorporate the values of parameters, but also specific properties of parameters, such as minimal value, maximal value, step size, or the numerical value of enumeration items.
Write Action
In parameter WriteAction, you define what happens during a write access to parameter Value of the translation operator. In contrast to using the reference operators, you do not simply forward the value of parameter Value to another parameter in the design. Instead, the value of parameter Value is used for a set of write actions you define in parameter WriteAction of the translation operator. Write actions are composed of one or several equations. On the left-hand side of these equations you define which parameter of which operator receives the result of the calculation. If you define more than one equation, separate the equations via semicolon. As soon as the there happens a write access to parameter Value, the formula(s) on the right-hand side of the equations you defined in parameter WriteAction is/are carried out and the result(s) is/are forwarded to the parameters specified on the left-hand side of the equations.
The formula can refer to values of operator parameters anywhere in the design. As soon as one of these values changes, the calculation results will differ when you re-write the same value as before to the Value parameter. The formula can not only incorporate the values of parameters, but also specific properties of parameters, such as minimal value, maximal value, step size, or the numerical value of enumeration items.
Formulas for Calculation of Value Range
You can also add formulas to calculate the current value range of parameter Value. You define the according formulas in the parameters RangeFrom, RangeTo, and RangeIncrement (step size). The formulas can contain values of module parameters anywhere in the design, as well as specific properties of these parameters, such as minimal value, maximal value, step size, or the numerical value of enumeration items.
Paths to Parameters |
|||
---|---|---|---|
To access an operator parameter any place within your design, you need to provide the path to this parameter in your formula. For access to an operator's parameter, you use the following construct:
"PathToModule": Here, you define the relative path to the operator who's parameter you want to access. The path is relative to the hierarchical level the translation operator itself is located. You also define the name of the accessed operator. Use a slash as hierarchy separator. "Module": Name of module. As name for the translation operator instance itself you use the name "this".
|
Access to Parameter Properties |
|
---|---|
The formulas can not only incorporate the values of parameters, but also specific properties of parameters, such as minimal value, maximal value, or step size:
|
Syntax for Write Access Equations |
|
---|---|
Equations for write actions you define in parameter WriteAction. They have the following syntax:
Here, you can define multiple equations for multiple target parameters. Use a semicolon as separator between the individual equations. "this" refers to the translation operator instance itself. Example for a WriteAction Equation:
Example:
|
Syntax for Read Access Equation |
|
---|---|
The equation for the read action you define in parameter ReadAction. The equation always starts with "${this.Value}=" . It has the following syntax:
Example for a ReadAction equation:
|
Referencing Map Parameters
You can define a target within the design hierarchy where map parameter Value will be visible and accessible. The target is defined by two parameters: DisplayHierarchy and DisplayName. In DisplayHierarchy you address a hierarchical box within the same process the translation operator itself is located in. In parameter DisplayName you set up the name for the target parameter. If DisplayHierarchy and DisplayName are both set, the parameter defined by DisplayName will be available in the hierarchical box addressed by DisplayHierarchy. If DisplayName is empty, no parameter is created. If DisplayName is set, but DisplayHierarchy is empty, the parameter defined by DisplayName is added to the parent hierarchy (i.e., the hierarchical box the translation operator itself is located in).
This allows you to make map parameter Value accessible on any hierarchical level (of the design) you want. This is especially helpful when workin with protected hierarchical boxes. You can make the parameter available directly under the properties of the protected hierarchical box itself.
Mapped parameters can be referenced themselves. Thus, you can reference either the content of parameter Value in a translation operator, or reference the parameter you have defined in the parameters DisplayName and DisplayHierarchy. This is especially important when protected hierarchical boxes are built up out of other protected hierarchical boxes.
The operator has no inputs and outputs, as it doesn't interfere with the data flow structure of the design.
A general introduction into library Parameters you find in Library Parameters.
Status | |
---|---|
Type | static read (although the GUI displays write) parameter |
Default | none |
Range | OK or error message |
Displays the error status. If parameter Activate is set to Yes, the other operator settings are checked. This parameter displays the result of this check, i.e., either OK or an error message. This parameter is not part of the final applet. |
DisplayName | |
---|---|
Type | static write parameter |
Default | none |
Range | any string |
If you want to grant access from and to the parameter Value at another point in the design, you need to define a new parameter. Specify here the name of this new parameter. If this field is empty, no new parameter is created. |
DisplayHierarchy | ||||
---|---|---|---|---|
Type | static write parameter | |||
Default | none | |||
Range | any string | |||
Specify here the hierarchical box to which you want to attach the new map parameter you defined in parameter DisplayName. For this parameter, you can use the autocompletion functionality and syntax highlighting. To use autocompletion, click into the Parameter Values field of this parameter in the Module Properties dialog, and press the TAB key of your keyboard. More detailed instructions for the autocompletion functionality are available at 'Autocompletion and Syntax Highlighting for Translator and Reference Operators'. If you defined a new parameter DisplayName, but leave parameter DisplayHierarchy empty: The new parameter is added to the hierarchical box that contains the reference operator instance. (Keep in mind this is not possible if the reference operator instance is located on the highest (process) level.)
|
Value | |
---|---|
Type | static, dynamic, write, read parameter |
Default | 0 |
Range | double |
Parameter for access to other parameters via the equations specified for read and write accesses. |
Unit | |
---|---|
Type | static write parameter |
Default | - |
Range | Latin-1 |
Enter here the unit for the parameter Value. |
Description | |
---|---|
Type | static write parameter |
Default | - |
Range | any text |
Enter here the description for the parameter Value. |
RangeFrom | |
---|---|
Type | static write parameter |
Default | 0.1 |
Range | |
Definition of smallest valid value. You can also enter a formula here. |
RangeTo | |
---|---|
Type | static write parameter |
Default | 1.0 |
Range | |
Definition of biggest valid value. You can also enter a formula here. |
RangeIncrement | |
---|---|
Type | static write parameter |
Default | 0.1 |
Range | |
Definition of intervall between valid values (definition of stepsize). You can also enter a formula here. |
WriteAction | |
---|---|
Type | static write parameter |
Default | |
Range | |
Definition of equations for translation during write access to parameter Value. For this parameter, you can use the autocompletion functionality and syntax highlighting. To use autocompletion, click into the Parameter Values field of this parameter in the Module Properties dialog, and type “${”. More detailed instructions for the autocompletion functionality are available at 'Autocompletion and Syntax Highlighting for Translator and Reference Operators'. |
ReadAction | |
---|---|
Type | static write parameter |
Default | |
Range | |
Definition of equation for translation during read access to parameter Value. The equation always starts with "${this.Value}=" . For this parameter, you can use the autocompletion functionality and syntax highlighting. To use autocompletion, click into the Parameter Values field of this parameter in the Module Properties dialog, and type “${”. More detailed instructions for the autocompletion functionality are available at 'Autocompletion and Syntax Highlighting for Translator and Reference Operators'. |
Activate | |
---|---|
Type | dynamic write parameter |
Default | No |
Range | {No,Yes} |
Yes = Access to and from referenced parameters (via read and write equations) is activated. No = Access to and from referenced parameters (via read and write equations) is de-activated and parameter Status disabled. Parameters DisplayName and DisplayHierarchy have no effect. |
The use of operator FloatParamTranslator is shown in the following examples:
-
An example for hardware self test of DMA, RAM, GPIOs, Trigger and LEDs.
-
Examples - Demonstration how to use the parameter translation operators for manipulation of parameters.