12-04-2013 05:03 PM
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?
12-04-2013 11:09 PM
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.
12-04-2013 11:33 PM
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.
12-05-2013 06:52 AM
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.
12-05-2013 09:53 AM
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.
12-05-2013 04:49 PM
Hi,
The UPS we are using is Back-UPS XS 1500.
Thanks.
12-05-2013 08:15 PM
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.
02-03-2022 01:45 PM
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?
02-03-2022 05:20 PM - edited 02-03-2022 05:21 PM
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...
02-04-2022 04:03 AM
@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.