LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

power outage UPS

Hi all,

 

I am writing some codes. The idea is the following.

 

The laptop will be plugged into a UPS, along with the high-V supplies for the detector.  In case of a power outage, the UPS will send a flag to be picked up by LabView software. If the flag lasts longer than, say, 5 minutes the software will assume a serious and long-term power outage. Then it can begin to shut down the detector gently, well before depleting the UPS battery.

 

Does anyone have an example of code?

 

 

0 Kudos
Message 1 of 10
(3,179 Views)

Where do you need help?

 

Do you need to know when the UPS is running on battery?  There is a UPS library somewhere on the NI website.

 

If you need to know how to wait for 5 minutes, then use the elapsed time function to determine when 5 minutes have passed.

0 Kudos
Message 2 of 10
(3,161 Views)

Hi,

 

My thought is when the power from building is down, and then the UPS starts to work and tell Labview the powe outage. After that, another device (connect to UPS) can be shut down by Labview.

Thanks.

0 Kudos
Message 3 of 10
(3,149 Views)

What UPS are you using?  How are you communicating with that UPS?  Many UPS will have a USB connection that Windows can then communicate with it directly.  There's some example code floating around somewhere for reading the UPS status from Windows.

 

The UPS I am currently using flips a relay whenever it goes to running on battery.  I can then read the status of that relay with a DIO.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(3,124 Views)

Look at https://decibel.ni.com/content/docs/DOC-1154 for connections to Windows Power Management which the APC brand of UPS's can tie into.

Message 5 of 10
(3,114 Views)

Hi,

 

The UPS we are using is Back-UPS XS 1500. 

Thanks.

0 Kudos
Message 6 of 10
(3,092 Views)

That's an APC model.

 

Connect the cable that comes with it between the UPS and your PC.  It may work as is.  If not, you might have to install a driver.

 

But APC is THE brand of UPS's and my experience shows they work well with the Windows power management app.

0 Kudos
Message 7 of 10
(3,073 Views)

I have an APC Smart-UPS that I want to check the status from LabVIEW whenever it switch to battery mode. I downloaded the example code; however, it only detects my laptop's battery. Has anyone got it to work?

0 Kudos
Message 8 of 10
(1,468 Views)

My company produces UPS's and our computer grade products have a serial port and a couple of alarm outputs (Line fail, low battery warning, low battery shutdown).

 

Once you know the communication protocol (that we do publish) communicating with them through the serial port is no different than communicating with any other instrument on a serial port. 

 

I believe APC has a similar communication protocol as they have their own software for monitoring their UPS's.

 

I don't know if they publish it though...

========================
=== Engineer Ambiguously ===
========================
Message 9 of 10
(1,455 Views)

@RTSLVU wrote:

 

I believe APC has a similar communication protocol as they have their own software for monitoring their UPS's.

 

I don't know if they publish it though...


There is one fairly good way to find out about how to communicate with UPS's if a manufacturer is shy about publishing their protocol. There is a project called "Network UPS Tools" (NUT) which is the defacto standard for accessing UPS's under Linux. And as most software for Linux, it is of course open source. The official Github repository is here.

 

If you can't get any official documentation from the manufacturer about how to access an UPS, you can always go and look in the source code of NUT if it supports your brand and model of UPS and try to determine the communication interface and protocol from that. It is C source code however, so some basic understanding of that is required.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(1,424 Views)