SendUPS

Windows > Use > Advanced features > Utilities and tools > SendUPS  
 

SendUPS is a tool for reading and writing UPS information using a batch script or any other application.

Location:
The program is located in the PSP installation directory (by default <Windows program group directory>\EATON\Personnal Solution Pac).

Use:
If the SendUPS.exe command is sent without a parameter, the system returns the information below:

Using SendUPS

SendUPS -get objectName [-var varName | -file fileName]
> Retrieve data from UPS.

SendUPS -set objectName value [-var varName | -file fileName]
> Set data on UPS.

SendUPS -list
> List of object names available on connected UPS.

objectName - The name of the object to be retrieved or set. (See SendUPS -list)
value - The value to be set.
varName - The name of the environment variable for storage of the
result value.
After each 'SendUPS' call, the program creates the
"SetVar.bat" file. This batch file should be called each
time to assign the result value to the environment variable.
e.g. SendUPS.exe -get 'PowerSummary.RunTimeToEmpty' -var 'RTTE'
CALL SetVar.bat
ECHO %RTTE%
fileName - The name of the file where the result value is stored.


-get

The -get command is used to read UPS information:

Using the standard output

SendUPS -get PowerSummary.PresentStatus.ACPresent

This command returns 0 or 1 on the standard output.

Using an environment variable

SendUPS -get PowerSummary.PresentStatus.ACPresent -var ACPresent
CALL SetVar.bat

This command creates the SetVar.bat file containing the SET ACPresent=1 command if AC power is present.
Once the SetVar.bat file has been run, the value read on the UPS can be accessed in the %ACPresent% environment variable.

Using a file

SendUPS -get PowerSummary.PresentStatus.ACPresent -file ACPresent.txt

This command creates the ACPresent.txt file in which the read value is saved.

-set

The -set command is used to write information to the UPS. Only certain objects may be accessed in write mode.

After writing, the -set command reads the value on the UPS. It returns the result in the same manner as the -get command (standard output, environment variable or file).

Using the standard output

SendUPS -set PowerSummary.DelayBeforeShutdown 120

This command orders UPS shutoff following a time delay of 120 seconds.
The value 120 is returned on the standard output.


-list

The -list command returns a list of all the accessible objects on the UPS.
Below is a list of the main objects and their meaning.

Object

Meaning

Attribute

PowerSummary.iProduct

Product name

R

PowerSummary.iModel Model name R
PowerSummary.PercentLoad Percent load at output R
PowerSummary.RemainingCapacity Remaining battery power R
PowerSummary.RestartLevel Battery charge level before restart R/W
PowerSummary.DelayBeforeShutdown Delay before shutdown R/W
PowerSummary.DelayBeforeStartup Delay before restart

R/W

PowerSummary.PresentStatus.ACPresent AC-power status R
PowerSummary.PresentStatus. BelowRemainingCapacityLimit Low battery warning R
PowerSummary.PresentStatus.Charging Battery charging R
PowerSummary.PresentStatus.Discharging Battery discharging R
PowerSummary.PresentStatus.CommunicationLost Communication failure R
PowerSummary.PresentStatus.Good UPS output OK R
PowerSummary.PresentStatus.InternalFailure Internal fault R
PowerSummary.PresentStatus.NeedReplacement Battery must be replaced R
PowerSummary.PresentStatus.OverLoad Overload R
PowerSummary.PresentStatus.ShutdownImminent Shutdown imminent R

Example:

ECHO OFF

REM Get UPSName
REM --------------------------------------------------------------

SendUPS.exe -get PowerSummary.iProduct -var iProduct
CALL SetVar.bat
SendUPS.exe -get PowerSummary.iModel -var iModel
CALL SetVar.bat
ECHO %iProduct% %iModel%

REM Get Utility power status
REM --------------------------------------------------------------
SendUPS.exe -get PowerSummary.PresentStatus.ACPresent -var UtilityStatus
CALL SetVar.bat
IF '%UtilityStatus%'=='1' GOTO utilityOK
GOTO utilityFailure

:utilityOK
ECHO Utility OK
GOTO utilityEnd

:utilityFailure
ECHO Power failure
GOTO utilityEnd

:utilityEnd

REM Get Battery Remaining Capacity
REM --------------------------------------------------------------
SendUPS.exe -get PowerSummary.RemainingCapacity -var RemainingCapacity
CALL SetVar.bat
ECHO Battery percent load = %RemainingCapacity% %%

REM Save run time to empty in "rt.txt" file
REM --------------------------------------------------------------
SendUPS.exe -get PowerSummary.RunTimeToEmpty -file rt.txt
ECHO Run time to empty
TYPE rt.txt

REM Send shutdown order
REM --------------------------------------------------------------
SendUPS.exe -set PowerSummary.DelayBeforeStartup 120 -var dbStartup
IF '%ERRORLEVEL%'=='0' GOTO setOK
GOTO setERROR

:setOK
CALL SetVar.bat
ECHO Startup UPS in = %dbStartup%
GOTO end

:setERROR
ECHO Set ERROR = %ERRORLEVEL%
GOTO end

REM End of script
REM --------------------------------------------------------------
:end
PAUSE

 

  See also :

Using the Trace tool
SendUPS
mgeRunAs (only NT, 2K and XP)
Wait