Skip navigation

Community

Currently Being Moderated

.NET PowerModeChanged Notifier - Monitor your UPS or Laptop Power from LabVIEW

VERSION 8  Click to view document history
Created on: Sep 21, 2006 3:15 PM by BetaCommunityContent - Last Modified:  Jan 23, 2013 10:02 AM by Anjelica-W

Overview

Listens for UPS state changes via .NET and generates a LV Notifier containing the UPS state.

 

 

Description

this VI demonstrates how to get the power source status of your computer. It constantly polls the operating system for the power source information. The power source values are an estimate provided by the battery driver. This VI was developed for use in laptop computers, however, it also operates correctly in UPS units with a Windows battery driver. The return values of the call to the Windows DLL are formatted and presented in the front panel.

 

 

Steps to Implement or Execute Code

  1. Run the dotNET System Power VI.

 

 

Requirements

Software

.NET 2.0

LabVIEW Development System 8.0 or later

Windows 98 or later

 

Hardware

N/A

 

 

Additional Images or Video

http://decibel.ni.com/content/servlet/JiveServlet/download/1154-5-1178/dotNET%20SystemPower.PNG

 

Registers for the Microsoft.Win32.SystemEvents.PowerModeChanged Event. The included Callback VI performs a "GetSystemPowerStatus" Win32 API call and sends the returned structure as a LV Notification.

 

I've modified the original SystemPower VI from here and included it as an example of how to use the notifier.

 

17 May 2007 - Note: There are problems/issues in using this with APCC software. See this NI Forum thread. http://forums.ni.com/ni/board/message?board.id=170&message.id=212642#M212642.

 

Change control:

Added Link to forum thread discussing use and limitations of this function...

 

by Phillip Brooks

 

 

VI Snippet

N/A

 

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**


Attachments:
Comments (1)