
Commissioning
5.3 TwinCATPLCUPSinterface
5.3.1 FUNCTION_BLOCKFB_GetUPSStatus
Fig.1:FB_GetUpsStatus
RequirementsunderNT4,Win2K,WinXP,WinXPembedded:
• TheBeckhoffUPSsoftwarecomponentsareinstalled(additionaltabunderControlPanel>Energy
Options>BeckhoffUPSConfiguration);.
• TheUPShasbeenconfiguratedwiththeWindowsUPSservice(ControlPanel>EnergyOptions
>UPS)ortheBeckhoffShellextension(ControlPanel>EnergyOptions>BeckhoffUPS
Configuration).FurtherinformationabouttheUPSconfigurationcanbefoundintheconsidering
documentation.
RequirementsunderWindowsCE:
• BeckhoffCEdeviceswith24VUPSservicearedeliveredwithaspecialBeckhoffBatteryDriverfor
WindowsCE.ThedriverisincludedinthestandardCEImage.Nofurtherconfigurationsettingsare
required.
WiththeFB_GetUPSStatusfunctionblockthePLCcanreadthestatusofaUPShardware.Theblockis
leveltriggered,whichmeansthatthestatusinformationisonlycyclicallyreadwhilethebEnableinputisset.
Tomaintainsystemloadingatalowlevel,thestatusinformationisonlyreadapproximatelyevery4.5s.
WhenthebValidoutputisset,themostrecentlyreaddataisvalid.Themostrecentreadcyclewas,inother
words,executedwithouterror.Ifanerroroccurs,thereadcycleisrepeated,andtheerrorsignalis
automaticallyresetassoonasthecauseoftheerror(e.g.nocommunicationwiththeUPS)hasbeen
corrected.
VAR_INPUT
VAR_INPUT
sNetId:T_AmsNetId;
nPort:T_AmsPort;(*0=WindowsUPSservice/WindowsBatterydriver*)
bEnable:BOOL;
END_VAR
sNetId:ItispossibleheretoprovidetheAmsNetIdoftheTwinCATcomputeronwhichthefunctiontobe
executed.Ifitistoberunonthelocalcomputer,anemptystringcanbeentered.
nPort:ADSportnumber.Setthisvaluetozero.Otherportnumbersarereservedforapplicationsinfuture.
bEnable:Iftheinputisset,theUPSstatusisreadcyclically.
VAR_OUTPUT
VAR_OUTPUT
bValid:BOOL;
bError:BOOL;
nErrId:UDINT;
stStatus:ST_UPSStatus;
END_VAR
ST_UPSStatus [}70]
CX210009x468 Version1.1
Kommentare zu diesen Handbüchern