LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW .Net Power Management Notifications for Windows Mobile

Hi all,
 
I'm currently developing a LabVIEW application to run on various Windows Mobile 6.0 PDA devices.
 
The application intefaces with a sensor via a compact flash usb host card.
 
Unfortunately, when the PDA is powered down (or goes into software standby) the compact flash card loses power (as would be expected). This causes the handle my application has to the sensor to become invalid. When the device is then powered on (comes out of stanby) the low level driver that I have no control of attempts to use the invalid handle and crashes, causing not only my application but the entire OS to freeze.
 
I have been looking into avoiding this behaviour by capturing the "power resume" event thrown by the .net powermanagement object. I have found the following article (http://bytes.com/forum/thread441918.html) on how to do this using C#. However, as im sure you know integrating .net into LabVIEW code is not always straight forward. The problem I have is that I cannot assign a function for the event watcher to perform upon a notification.
 
Does anybody understand my explanation/have any insights they can offer?
 
Many Thanks,
 
Steve
0 Kudos
Message 1 of 2
(2,463 Views)
Hi Steve,

The best thing to do in this instance would be to implement a timeout function in your LabVIEW application. So when your PDA is being powered down, close all references to the sensors and when it is powered up again, create the references again. This should not cause the application to freeze.

From your explanation, it sounds as if the application is still looking and waiting for the handle to be passed through, which has been unintentionally closed when the PDA was powered down. This might be causing your OS to freeze as there is no more resources for it to use, all of it is being used by your application to look for that reference.

Regards,
0 Kudos
Message 2 of 2
(2,418 Views)