01-09-2006 07:27 PM
01-10-2006 04:26 AM
You could probably get this info out of the .net framework inside labview. I'll try to work out an example later.
http://www.neowin.net/forum/lofiversion/index.php/t212463.html
01-10-2006 06:18 AM
01-12-2006 07:35 AM - edited 01-12-2006 07:35 AM
This should work. To get the detailed meaning of the different values try to look at: Microsoft Developer Network: SYSTEM_POWER_STATUS.
MilkyStone wrote:Thank you very much.Now I am trying to get the power status use of GetSystemPowerStatus, and it returns code can reflect the power status.
Message Edited by rolfk on 01-12-2006 02:35 PM
01-12-2006 08:32 AM
Rolf, is there any special reason you're not using Adapt to Type with the cluster input?
It would definitely be easier than having to calculate that array and the byte swapping.
My guess is that the VI was written before the adapt to type option was available.
01-12-2006 08:38 AM - edited 01-12-2006 08:38 AM
Message Edited by rolfk on 01-12-2006 03:42 PM
01-12-2006 11:52 PM
01-13-2006 04:05 AM - edited 01-13-2006 04:05 AM
Ok, my previous post basically explains it but here is a more detailed explanation. Before LabVIEW 6.0 the Call Library Node could not be configured to take arbitrary parameters and this VI was created with LabVIEW 5 or maybe even 4.1. The solution then for structure parameters was to calculate its size, preallocate an array of u8 and pass it as an array pointer to the function. On return you of course want to convert it into the actual data structure.
@MilkyStone wrote:Thanks for your patient to give this sample, it's very useful to my application. Before now, I can only read the Ac status and battery capacity using GetSystemPowerStatus, but your vi have ability to get more information about system power, because of I had set wrong type of parameter.But I am so sorry to consult you again, why you add Type cast ,Swap bytes and Swap words after the call Libary function node? As far as I know, we can read these information directly from the output of Call Libary Function Node.Thank you!
Message Edited by rolfk on 01-13-2006 11:06 AM
01-15-2006 08:32 PM