LabVIEW UserInterface gives PropertyObject Warnings when using UIMessages Primary Software: TestStandPrimary Software Version: 3.0 Primary Software Fixed Version: N/A Secondary Software: LabVIEW Development Systems>>Base Package
Problem: I have a LabVIEW UserInterface (UI) that handles UIMessages that pass a PropertyObject from TestStand to LabVIEW via the ActiveX parameter of the UIMessage. When I shut down my UI, I receive a warning that I have PropertyObjects that were not released:
How can I prevent this warning from appearing? Solution: To prevent this warning from happening, you will need to change how your LabVIEW UI handles your UIMessages. This warning is happening because of the way that LabVIEW handles variants. When LabVIEW has an variant wire, the memory for that data is not freed until the VI leaves memory. Because your UIMessage callback is registered for an event, it will not be unloaded until your top-level VI is unloaded. When the TestStand Engine shuts down, your top-level VI has not completed yet. So the TestStand engine still has open PropertyObject references, and gives the warning. To prevent this, you must unload the VI that handles your UI Message when it is done using the PropertyObject. You can do this by calling the VI dynamically from the UIMessage Callback. So instead of one VI that is registered to the callback handling the UIMessage, you instead create a callback VI that dynamically calls a second VI that then handles the callback. The callback VI might be something like: If the VI is being used anywhere else, it will not be unloaded. This is very important! For instance, if you have the VI open for editing, LabVIEW will not close the reference, and you will still experience PropertyObject leak warnings. Attached, you can find three VIs that demonstrate the proper procedure for handling the ActiveX property of a UIMessage in LabVIEW. Related Links: Attachments:
Report Date: 01/07/2008 Last Updated: 01/07/2008 Document ID: 4H6DULT3 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
