TYPE ST_UPSStatus

TYPE ST_UPSStatus
STRUCT
        Vendor                          : STRING;(* Reports the UPS vendor name as displayable string.*)
 Model                           : STRING;(* Reports the UPS model name as displayable string.*)
 FirmwareRev                     : STRING;(* Reports the UPS firmware revision as a displayable string.*)
 SerialNumber                    : STRING;(* Reports the UPS serial number as a displayable string.*)
 BatteryLifePercent              : DWORD;(* The percent of battery capacity remaining in the UPS, represented as a value in the range of 0..100%.*)
 BatteryLifeTime                         : DWORD;(* The amount of remaining UPS run time, in minutes.*)
 eBatteryStatus                  : E_BatteryStatus;(* The current status of the UPS batteries.*)
 eCommStatus                     : E_UpsCommStatus;(* The status of the communication path to the UPS.*)
 ePowerStatus                    : E_UpsPowerStatus;(* Reports the status of utility-supplied power into the UPS.*)
 nPowerFailCnt                   : DWORD;(* Power fail counter. Increments every time the UPS service detects power fail.*)
 dwChargeFlags                   : DWORD;(* Battery charge status flags. This member can be one or more of the following values.
        Bits0..7 := General battery status flags (if all bits are set to 0 => unknown status)
                Bit0 := High (bit set => high battery charge)
                Bit1 := Low (bit set => low battery charge)
                Bit2 := Critical (bit set => battery is near empty)
                Bit3 := Charging (bit set => battery is charging)
                Bits4..6 := reserved (all bits are 0)
                Bit7 := No Battery (bit set => battery not found or not connected, bit not set => battery is existing or unknown state)
        Bits8..15 := Special status information (if all bits are set to 0 => state ok or uknown state)
                Bit8 := UPS Fan Error (bit set => fan hardware is reporting an error, bit not set => fan is ok)
                Bit9 := Overt Temperature (bit set => over temperature detected, bit not set => temperature is ok)
                Bit10 := Service Interval Notify (bit set => service interval time expired, bit not set => service interval time not expired)
                Bit11 := Under Temperature (bit set => under temperature detected, bit not set => temperature is ok)
                Bit12 := Fuse Not Ok (bit set => fuse broken or missed, bit not set => fuse ok)
                Bit13 := Alarm1 (reserved for later use, bit is 0)
                Bit14 := Alarm2 (reserved for later use, bit is 0)
                Bit15 := Alarm3 (reserved for later use, bit is 0)
        Bits16..31 := reserved for later use, all bits are 0)
         *)
END_STRUCT
END_TYPE

 

Not all UPS devices are able to deliver status infomation.

X : The status info is present.

*) Only available if model "Smart Signaling to any APC UPS & TwinCAT" configured!

Status info

Beckhoff
HID UPS,
BAPI v1

Beckhoff
P24Vxxxx

Beckhoff
CP903x ISA or PCI card

Beckhoff
CX2100-09x4

APC
Back-UPS Pro 280,
Smart-UPS 420

Description

Vendor

X

X

X

X

X

Reports the UPS vendor name as displayable string.

Model

X

X

X

X

X

Reports the UPS model name as displayable string.

FirmwareRev

X

X

X

X

X

Reports the UPS firmware revision as a displayable string. Empty string if not available.

SerialNumber

X

X

None

X

X

Reports the UPS serial number as a displayable string. Empty string if not available.

BatteryLifePercent

X

X

None

X

X

The percent of battery capacity remaining in the UPS, represented as a value in the range of 0 through 100.  Zero if not available.

BatteryLifeTime

X

X

None

X

X

The amount of remaining UPS run time, in minutes. Zero if not available.

eBatteryStatus

  • BatteryOk
  • BatteryUnknownStatus if no battery found. Only with UPS software version >=2.0.0.6 and  UPS firmware >= 25.1.I.
  • BatteryOk
  • BatteryUnknownStatus if no battery found.
  • BatteryOk
  • BatteryUnknownStatus if no battery found (only "Smart Battery" and not capacitive model).
  • BatteryOk

X

The current status of the UPS batteries.

eCommStatus

X

X

X

X

X

The status of the communication path to the UPS.

ePowerStatus

X

X

X

X

X

Reports the status of utility-supplied power into the UPS.

nPowerFailCnt

X

X

X

X

*X

Power fail counter. Increments every time the UPS service detects power fail.

dwChargeFlags

  • No Battery (bit 7 set) only with UPS firmware >= 33.12-0 if battery not found or not connected.
  • Service Interval Notify (bit 10 is set) The configured battery replace service intervall has expired.
  • No Battery (bit 7 set) only with UPS software version >=2.0.0.6 and UPS firmware >= 25.1.I. The battery existence is checked every minute.
  • UPS Fan Error (bit 8 set) only with UPS software version >=2.0.0.7 and UPS firmware >=40.1.I The fan status is checked every minute. New (second) UPS hardware revision required!
  • Service Interval Notify (bit 10 is set) The configured battery replace service intervall has expired. Implemented in UPS Software version >= 3.0.0.8.
  • High (bit 0 set) if battery full loaded.
  • Charging (bit 3 set)
  • No Battery (bit 7 set) if no battery found.
  • No Battery (bit 7 set). No coummunication to battery or battery not found (only "Smart Battery" and not capacitive model).
  • Over Temperature (bit 9 set) Over temperature detected and charging of battery is stopped. New (second) UPS hardware revision required. Implemented in UPS software version >= 3.0.0.18.
  • Service Interval Notify (bit 10 set) The configured  battery replace service interval is expired.
  • Under Temperature (bit 11 set) Under temperature detected and charging of battery is stopped. New (second) UPS hardware revision required. Implemented in UPS software version >= 3.0.0.18.
  • Fuse Not Ok (bit 12 set) The "Smart Battery" fuse is broken or not available. New (second) UPS hardware revision required. Implemented in UPS software version >= 3.0.0.18.

None

Battery charge status flags and special status information.

UPS hardware

Target system type

Development environment

PLC libraries to include

  • Beckhoff HID UPS;
  • Beckhoff BAPI v1;
  • Beckhoff P24Vxxxx;
  • Beckhoff CP903x card (PCI/ISA);
  • Beckhoff CX2100-09x4 models (e.g. CX2100-0904 or CX2100-0914 + "Smart Battery" CX2900-0192);
  • With Beckhoff Industrial PC's delivered APC UPS models supporting smart protocol and configured with Windows UPS Service;

PC or CX

TwinCAT v2.8.0, Build > 745

TwinCAT v2.9.0, Build > 945

TcIoFunctions.Lib

( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib are included automatically )

TwinCAT v3.0 and above

Tc2_IoFunctions