BECKHOFF CX1100-09xx UPS User Manual
Page 38
Commissioning
36
Embedded PC
VAR
UPS : FB_CX1000UPSHANDLING;
END_VAR
It is then called from the program with its parameters. There are seven parameters for this function block:
bAutoReset : BOOL;
bDIPDisable : BOOL;
bShutdown24V : BOOL;
bShutdown5V : BOOL;
iDischargeLevel : USINT;
bTcStopOnly : BOOL;
tDelay : TIME;
"bAutoReset" does not switch the CX10x0 system off if the supply voltage returns in time (this is set under "tDelay").
If this behaviour is wanted, the input must be set to "TRUE". As in the case of the other module, "bDIPDisable" can
be used to ignore the setting of the rotary switch (by setting the input to "TRUE"). In that case again, the value set
under "iDischargeLevel" is used. "bShutdown24V" switches off the 24V voltage. Warning! "bShutdown5V" is not
used at present. This input must always be set to "FALSE"! It is, however, only necessary to ignore it, as it is
initialised with "FALSE". "iDischargeLevel" indicates the discharge capacity of the UPS. The range of values extends
from 0 to 9, whereby, for instance, 3 corresponds to switch setting 3 and means that the UPS will switch off after
losing 30% of its capacity. "TDelay" indicates the retention time before a stop or shutdown is initiated. The
"bTcStopOnly" switch is required for writing the persistent data under the "Microsoft Windows CE" operating system.
Shutdown causes the system to reboot. It is necessary, however, to stop TwinCAT in order to write the persistent
data. This stop signal is set through the "bTCStopOnly" input ("bTcStopOnly" := "TRUE"). Under "Microsoft Windows
XP embedded" shutting down causes the persistent data to be written. The switch is therefore not necessary
(bTcStopOnly = FALSE).
The call then looks like this:
UPS(
bAutoReset
:= TRUE; (*TRUE if operation continues if supply returns*)
bDIPDisable
:= TRUE;(*TRUE for DIP switch override*)
bShutdown24V
:= FALSE;(*Only TRUE if switching off is desired*)
bShutdown5V
:= FALSE;(*DO NOT USE ---> reserved function*)
iDischargeLevel
:= 3;(*Values from 0.1, ... 9*)
bTcStopOnly
:= TRUE;(*Under WIN CE in order to save the persistent data*)
tDelay
:= t#5s; (*Retention time before shutting down *)
);
This function block also needs further variables for its operation. They are linked in TwinCAT's System Manager with
signals from the UPS. These variables still have to be created. This is done automatically when the process image is
read into the System Manager. The linking process stores the addresses in the "TwinCAT_Configuration" file, and
they are introduced during the next call to the compiler. (A more precise description can be referred to in the
description of TwinCAT.) Alternatively it is possible to assign the addresses by hand. After compilation, warnings
about the missing configuration for the signals are displayed. The signals are inserted into the
"Variablen_Konfiguration" file through the "Insert -> All instances" menu item. It is possible to enter the addresses for
the signals here. (E.g. MAIN.UPS.Li24VState AT %IB0 : BYTE for memory address 0).