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