FB_CXSimpleUps

FB_CXSimpleUps 1:

The function block FB_CXSimpleUps can be used on the CX1000 or CX1020 in order to activate the UPS CX1190-UPS from the PLC. In this case the UPS settings must be deactivated in the TwinCAT System Manager.

FB_CXSimpleUps 2:

FB_CXSimpleUps 3: Inputs

VAR_INPUT
    bDIPDisable     : BOOL;
    iDischargeLevel : USINT;
    tDelay          : TIME;
END_VAR

Name

Type

Description

bDIPDisable

BOOL

If bDIPDIsable = TRUE, then the position of the charge level switch on the UPS is ignored and iDischargeLevel is used instead.

iDischargeLevel

USINT

Discharge switch-off threshold: 0 = 100% (maximum discharge), 9 = 90%, 8 = 80%, ..., 2 = 20%, 1 = 10% (minimum discharge).

tDelay

TIME

Holding time before the shutdown is carried out. It is used to bridge short power failures (up to 10 s).
After exceeding the holding time, the holding period is aborted. Internally the FB waits for 2.5 s.
If the voltage has returned by then, the FB returns to normal operation, otherwise the system is shut down. If the voltage returns during or after shutdown, the CX automatically reboots after discharging and recharging the UPS.

FB_CXSimpleUps 4: Outputs

VAR_OUTPUT
    bPowerFailure      : BOOL;
    bShutdownActive    : BOOL;
    bUpsReady          : BOOL;
    b24VInOK           : BOOL;
    bHolding           : BOOL;
    tTimeUntilShutdown : TIME;
    eUpsState          : E_UPS_STATE;
END_VAR

Name

Type

Description

bPowerFailure

BOOL

Becomes TRUE when a power failure of the supply voltage is detected, becomes FALSE when the input voltage returns.

bShutdownActive

BOOL

Becomes TRUE as soon as the stop or shutdown is executed.

bUpsReady

BOOL

Becomes TRUE as soon as the 24 V input voltage is available.

b24VInOK

BOOL

Becomes TRUE as soon as the UPS provides the output voltage.

bHolding

BOOL

Becomes TRUE as soon as a failure in the supply voltage has been detected, and the holding time has not yet elapsed.

tTimeUntilShutdown

TIME

Indicates the holding time remaining until shutdown.

eUpsState

E_UPS_STATE

Displays the status of the UPS [UNDEF | CHARGING | CHARGED | DISCHARGE | DISCHARGE_RESTART | OUTPUT_OFF | OVERLOAD].

Configuration variables

VAR_CONFIG
    Ii24VState    AT %I* : BYTE;
    IiChargeState AT %I* : USINT;
    QiControl     AT %Q* : BYTE;
    QiDipControl  AT %Q* : USINT;
END_VAR

Name

Type

Description

Ii24VState

BYTE

Must be linked with input '24V State', see picture above.

IiChargeState

USINT

Must be linked with input 'Charge State', see picture above.

QiControl

BYTE

Must be linked with output 'Contol', see picture above.

QiDipControl

USINT

Must be linked with output 'DIP Ctrl', see picture above.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

CX (x86)

Tc2_SystemCX

FB_CXSimpleUps 5:

For other CX and PC please refer to the function block FB_S_SUPS_BAPI in the Tc2_SUPS library.