-

GET_SYMBOL_2

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>.

As soon as the REQ input is set to TRUE, the inputs are validated. The REQ input must remain set to TRUE, until the search for the symbolic name of the variable connected to the VARIABLE input is completed (regardless of whether the operation succeeded or failed). The BUSY output is TRUE while the operation is being executed asynchronously on a Service Thread. Execution of the function block is complete when the DONE output is set to TRUE. The symbolic name is indicated at the SYMBOLIC_NAME output.

The ERROR output indicates whether an error occurred while executing the function block.
Notes
  • If the REQ input is not yet set to TRUE, the state machine remains in the Idle state.
  • As soon as the REQ input is set to TRUE, the inputs are validated. If successful, the inputs are copied for asynchronous processing, and the operation is submitted to the eCLR service thread. The state machine then transitions to the Waiting state, and the BUSY output is set to TRUE. The use of the eCLR service thread ensures that all operations are executed sequentially rather than simultaneously.
  • Once the asynchronous execution of the operation is complete, the state machine transitions to the Done state and BUSY is reset to FALSE. If the operation was successful, the results are subsequently copied to the outputs of the function block, and the DONE output is set to TRUE. If the operation has failed, the ERROR output is set to TRUE, and the error code can be read from the STATUS output.
  • To fully conclude the operation, the REQ input must be set back to FALSE. The state machine returns to the Idle state. Subsequently, the outputs are also reset to their default values.
  • When the function block is used as global function block, it is not thread-safe. In this case, make sure to prevent concurrent calls (e.g., by using the MUTEX function block).
  • 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

VARIABLE

Outputs

DONE

BUSY

ERROR

SYMBOLIC_NAME