Type
| Function block |
Description
| The function block searches for the symbolic name of a variable.For local variables the symbolic name is the instance name <programinstancename>.<variablename>, separating the parts of the instance path by a dot. For resource-global variables the symbolic name is the <variablename>.With a rising edge at the REQ input, the symbolic name of the variable connected to the Variable input is searched. The Busy output is set to TRUE while the search is running. If the function block has finished execution and the variable has been successfully found, the Done output is set to TRUE and the symbolic name is indicated at the SymbolicName output. The Error output indicates whether an error occurred while executing the function block. The ErrorID indicates whether the symbolic name was found or not or in case of an error the reason for the error. |
Notes
|
- When a request for a symbolic name of a variable was triggered with a rising edge at the REQ input (set to TRUE) and REQ remains TRUE after the function block has been triggered, the values of the output parameters are kept after the function block has finished execution.
- When a request was triggered with a rising edge at the REQ input and REQ switches back to FALSE after the function block has been triggered, the values of the output parameters are kept for one cycle after the function block has finished execution.
- A new request is ignored, if the new request is triggered (with a rising edge at the REQ input) while an old request is currently being processed. The Error output is set to TRUE and the ErrorID output indicates the reason for the error as long as the function block is executing the old request (i.e., until the old request has been completed).
- Function blocks have to be instantiated. The instance name of the function block has to be declared in the 'Variables' table of the POU where the FB is going to be used. The instance name must be unique within the POU.
|
Parameters
| Inputs
REQ
Data type: | BOOL |
Description: | The function block is triggered for execution with a rising edge (TRUE). Execution is continued when REQ is set to FALSE. |
Variable
Data type: | ANY |
Description: | Variable whose symbolic name is going to be searched. |
Outputs
Done
Data type: | BOOL |
Description: | Set to TRUE after the function block has finished the execution and the symbolic name of the variable has been successfully found. The symbolic name of the variable is indicated at the SymbolicName output. |
Busy
Data type: | BOOL |
Description: | Set to TRUE as long as the function block is executing the request for the symbolic name of the variable. |
Error
Data type: | BOOL |
Description: | If an error occurs while getting the symbolic name, the Error output is set to TRUE. As long as Error = TRUE, the ErrorID provides details on the error. |
SymbolicName
Data type: | STRING |
Description: | Symbolic name of the variable, if found. |
ErrorID
Data type: | UINT |
Description: | Error number of the error that occurred while getting the symbolic name.
0 | No error. The symbolic name has been found. |
1 | The symbolic name has not been found. |
2 | A new request for the symbolic name is ignored because the new request is triggered (with a rising edge at the REQ input) while an old request is currently being processed (the Busy output is set to TRUE while a request is processed). |
|
|