Battery driver for Windows CE

Beckhoff Industrial PCs with Windows CE and 24 V UPS support are supplied with a special Beckhoff battery driver for Windows CE. In these devices the driver is included in the standard CE image. No further configuration settings are required. The UPS hardware is wired internally with the on-board electronics. Only the external UPS battery pack has to be connected to the device (see description in the device documentation).

Activating UPS

The UPS is disabled by default under Windows CE and must be activated via the registry entry Enable_Beckhoff_CX2100-09xx_UPS under HardDisk\RegFiles\Samples\UPS.

Power Options in the Control Panel

Battery driver for Windows CE 1:

The Power Options dialog in the Control Panel shows the status of the external power supply and the remaining battery capacity.

Battery driver for Windows CE 2:

Windows CE API interface for applications

Windows CE applications can access the UPS status information cyclically via the GetSystemPowerStatusEx2 API function call.


DWORD GetSystemPowerStatusEx2(
PSYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2,
DWORD dwLen,
BOOL fUpdate
);

typedef struct _SYSTEM_POWER_STATUS_EX2 {
BYTE ACLineStatus;
BYTE BatteryFlag;
BYTE BatteryLifePercent;
BYTE Reserved1;
DWORD BatteryLifeTime;
DWORD BatteryFullLifeTime;
BYTE Reserved2;
BYTE BackupBatteryFlag;
BYTE BackupBatteryLifePercent;
BYTE Reserved3;
DWORD BackupBatteryLifeTime;
DWORD BackupBatteryFullLifeTime;
DWORD BatteryVoltage;
DWORD BatteryCurrent;
DWORD BatteryAverageCurrent;
DWORD BatteryAverageInterval;
DWORD BatterymAHourConsumed;
DWORD BatteryTemperature;
DWORD BackupBatteryVoltage;
BYTE BatteryChemistry;
// Add any extra information after the BatteryChemistry member.
} SYSTEM_POWER_STATUS_EX2, *PSYSTEM_POWER_STATUS_EX2, *LPSYSTEM_POWER_STATUS_EX2;

Please note that not all parameters are supported by the Beckhoff UPS. The main member variables include:

ACLineStatus: Status of the external power supply.

BatteryLifePercent: Battery charge status in percent.

BatteryLifeTime: Remaining battery capacity.

Further information about this API function can be found in the Microsoft online documentation.

UPS interface for TwinCAT PLC

Battery driver for Windows CE 3:

A TwinCAT PLC application can access the UPS status information in read mode via function block FB_GetUPSStatus. Detailed documentation of the function block can be found here: FB_GetUPSStatus.