ā09-28-2009 01:10 PM
I try to get some info about battery status. The "easiest" way I consider to be Call Library Function Node and GetSystemPowerStatus from kernel32.dll.
The problem is the results: an error message or LabVIEW crashes. I use LabVIEW 6.1 and I can't see the example by Aaron on ni.com (buid in 8.6). I try to use reference insted val by the problem persist. It seems to be a memory allocation problem, but how can I solve?
ā09-29-2009 10:29 AM
Hello,
What does your function prototype look like? It should be setup as a stdcall (WINAPI) and look like this within the call library setup: int32_t GetSystemPowerStatus(void *SystemPowerStatus);
Here is a screenshot of the function parameters as well:
Hopefully this will help determine where the problem is occurring. We need to make sure that all the parameters are the same between this example and your code.
-Zach
ā09-29-2009 10:50 AM
Hello,
I was able to track down an older version and saved the example in 6.1. Here it is.
-Zach
ā09-29-2009 10:59 AM
Hi! Zach, thank you for your reply. Now works fine. The problem was to the Name: I put name "Cluster" insted of "SystemPowerStatus". This is the onl;y difference. Of course in prototype I have "void" instead "int32_t", but works fine.
Thank you to help me to solve this problem. I'll use this program to control a relay, to connect and disconnect power supply to a laptop. Thus, charge/discharge cycle is complete and battery life is longer.
ā09-30-2009 01:09 AM
ocd wrote:Hi! Zach, thank you for your reply. Now works fine. The problem was to the Name: I put name "Cluster" insted of "SystemPowerStatus". This is the onl;y difference. Of course in prototype I have "void" instead "int32_t", but works fine.
Thank you to help me to solve this problem. I'll use this program to control a relay, to connect and disconnect power supply to a laptop. Thus, charge/discharge cycle is complete and battery life is longer.
This makes no sense! The Parameter name is just cosmetics. It has no influence whatsover on how the DLL function is called. So there must have been another change.
Rolf Kalbermatter
ā10-01-2009 04:43 AM
ocd wrote: I'll use this program to control a relay, to connect and disconnect power supply to a laptop. Thus, charge/discharge cycle is complete and battery life is longer.
I thought the best way to extend the batteries life is to take out the loaded battery, store it the fridge and use the AC supply š
Unload and recharge every 1-2 month.
My neighbor practice it and claims that it works with very good results. However, I'm to lazy ....
ā10-01-2009 05:57 AM
Hi Henrik,
Yes I know about this method (take out the battery) but some laptop doesen't start without battery (I don't know exactly why) but doesen't start. It is possible with my method to regenerate battery (for improper use battery situations).
Thanks all for info!
Daniel