Type | Function block |
Description | The function block can be used to retrieve diagnostic data from the UPS (Uninterruptable Power Supply). The diagnostic data includes the charge level of the UPS in percent and the health status of the UPS.The output of the diagnostic data is triggered with a rising edge at the REQ input. When the FB is instantiated or reset with a falling edge at REQ, the BUSY, DONE, and ERROR outputs are set to FALSE and STATUS, CHARGE_LEVEL and HEALTH are set to the value 0.If an error occurs during execution, the ERROR output is set to TRUE and the DONE output is set to FALSE. While ERROR = TRUE, the STATUS output contains the error code. |
Notes | 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 | Input
REQ
Data type: | BOOL |
Description: | A rising edge at the REQ input (REQ = Request) starts the execution of the function block. If the execution finished, the DONE output is set to TRUE.If an error occurs during execution, ERROR is set to TRUE and DONE is set to FALSE. A falling edge at the input resets all outputs. |
Outputs
DONE
Data type: | BOOL |
Description: | Set to TRUE after the function block has finished the execution successfully. The outputs are ready to read. |
ERROR
Data type: | BOOL |
Description: | If an error occurred during execution, the output is set to TRUE. As long as ERROR = TRUE, the error code providing information for the cause of the error is output at ERROR. |
BUSY
Data type: | BOOL |
Description: | Set to TRUE while the function block is being executed. |
STATUS
Data type: | DWORD |
Description: | Provides the error code in the event of an error (ERROR = TRUE). Only valid for ERROR = TRUE.Possible values:
|
CHARGE_LEVEL
Data type: | DINT |
Description: | Provides the UPS state of charge in percent. Only valid for DONE = TRUE. |
HEALTH
Data type: | DINT |
Description: | Provides the health status of the UPS. Only valid for DONE = TRUE.Possible values:
|
|
Timing Diagram |  |