GETPR, GETPI, GETPB – Blocks for remote parameter acquirement
Block SymbolsLicensing group: STANDARD
Function Description
The GETPR, GETPI and GETPB blocks are used for acquiring the parameters of other blocks
in the model remotely . The only difference among the three blocks is the type of
parameter which they are acquiring. The GETPR block is used for obtaining real
parameters, the GETPI block for integer parameters and the GETPB block for Boolean
parameters.
The blocks operate in two modes, which are switched by the GETF parameter. For the output y (or k, Y) is set to the value of the remote parameter at the start and every time when the remote parameter changes. If the parameter is set to on, then the blocks work in single-shot read mode. In that case the remote parameter is read only when rising edge (offon) occurs at the GET input.
The name of the remote parameter is determined by the string parameter sc (string connection), which has the form <block_path:parameter_name>. It is also possible to access individual items of array-type parameters (e.g. the tout parameter of the ATMT block). This can be achieved using the square brackets and item number, e.g. .ATMT:touts[2]. The items are numbered from zero, thus the string connection stated above refers to the third element of the array.
The path to the block whose parameter should be read can contain hierarchic levels separated by dots followed by the block name. The path can be either relative or absolute:
- Relative – starts at the level where the GETPR block (or GETPI, GETPB) is located. The string has to be prefixed with ’.’ in this case. Examples of relative paths: ".GAIN:k", ".Motor1.Position:ycn".
- Relative to task – starts at the root level of the task where the GETPR block (or GETPI, GETPB, GETPS) is located. The string has to be prefixed with ’%’ in this case. Examples of paths: "%GAIN:k", "%Motor1.Position:ycn".
- Absolute – complete sequence of hierarchic levels down to the block. For referring to blocks located in the driver task (see the IOTASK block for details on configuration) the ’&’ followed by the driver’s name is used at the beginning of the absolute path. Examples of absolute paths: "task1.inputs.lin1:u2", "&EfaDrv.measurements.DER1:n".
The order and names of individual hierarchic levels are presented in a tree-like structure within the Diagnostics section of the REXYGEN Studio program.
Warning: If the remote parameter is in a task other than the GETPx block, block execution is delayed until the remote task is completed. It is necessary to avoid the so-called race conditions and guarantee the correct value reading. Therefore, it is recommended to include the GETPx block in a slower task (longer period/execution time) and read parameter in a faster task (shorter period/execution time). In the opposite situation (e.g. the GETPx block in a faster task), the SETPx block should be used in a slower task.
Note: When using multiple GETPx blocks, it is not guaranteed to read all data from a remote task in the same tick. It is only guaranteed that the previous block will receive a value in the same or previous period as the next block (the order of blocks execution can be checked in REXYGEN Diagnostics). To obtain multiple values in the same period, it is needed to use the Inport and Outport blocks or the GETPA block.
Input
GET | Input for initiating one-shot parameter read (offon) | Bool |
Outputs
y | Parameter value, output of the GETPR block | Double (F64) |
k | Parameter value, output of the GETPI block | Long (I32) |
Y | Parameter value, output of the GETPB block | Bool |
E | Error flag | Bool |
|
|
|
Parameters
sc | String connection to the remote parameter respecting the above mentioned notation | String |
GETF | Continuous or one-shot mode | Bool |
|
|
|
[Previous] [Back to top] [Up] [Next]
2024 © REX Controls s.r.o., www.rexygen.com