KFadgen Posted August 22, 2006 Report Share Posted August 22, 2006 Hello All, I have an application which uses an XControl as part of a dynamically loaded vi template (.vit). In the development environment everything works fine. When I build it into an application I get a program crash whenever I close one of the dynamically loaded vis with the xcontrol on it. I've built up a simple example and included it in the .zip archive. If I remove the XControl everything runs fine. I'm running WinXP and LabVIEW 8.20. This "feature" has been confirmed also with 8.0.1 on WinXP. I've emailed support at NI and got the following response: Thank you for contacting National Instruments, and for alerting us of this issue. I was able to reproduce the crash, and have reported this to our R&D department for further investigation. This will probably be addressed in a future release of LabVIEW. However, in the mean while, I beleive there is a different way you can go about resolving this issue, without having to use the .vit method. It is possible to open multiple instances of an executable by adding the line allowmultipleinstances=True to the ini file of the executable. With that in mind, I suggest you workaround this issue by creating an executable of the test template, and call it in the main VI using the system exec.vi, located in the Connectivity palette. I tried it with an already created Xcontrol (from the example finder), and it worked as expected. The workaround seems like it will function, but not the solution I would have preferred. -Keith Fadgen Download File:post-689-1156204554.zip Quote Link to comment
James N Posted August 22, 2006 Report Share Posted August 22, 2006 Keith, See how this VI works for you. I'm a fan of disposing of references manually. I like to see it being done vs. thinking it's being handled for me. The draw back is that the VI probably stays loaded into memory. -James Download File:post-5791-1156210685.vi Quote Link to comment
KFadgen Posted August 22, 2006 Author Report Share Posted August 22, 2006 James, I tried your file and it works. Your Main.vi in it's current format only allows for one copy of the template to be loaded at a time. For my app I'm planning on having separate instances of the template running at the same time. I modifed your version to open several copies, keeping track of the references in the parent. This worked as well. For the app I have I will be setting up Ques for comms between the caller and each .vit instance. I'll try coding in an exit routine which will tell the parent to close the reference when the child window wants to exit. This should minimize the memory footprint over time. Thanks for this, it definatley points me in the right direction for this app. -Keith Keith,See how this VI works for you. I'm a fan of disposing of references manually. I like to see it being done vs. thinking it's being handled for me. The draw back is that the VI probably stays loaded into memory. -James Quote Link to comment
jhoskins Posted August 23, 2006 Report Share Posted August 23, 2006 James,I tried your file and it works. Your Main.vi in it's current format only allows for one copy of the template to be loaded at a time. For my app I'm planning on having separate instances of the template running at the same time. I modifed your version to open several copies, keeping track of the references in the parent. This worked as well. For the app I have I will be setting up Ques for comms between the caller and each .vit instance. I'll try coding in an exit routine which will tell the parent to close the reference when the child window wants to exit. This should minimize the memory footprint over time. Thanks for this, it definatley points me in the right direction for this app. -Keith I have tried both solutions and both of them work, however it is a good idea to explicitly close references yourself. Quote Link to comment
wingnut Posted September 8, 2006 Report Share Posted September 8, 2006 I am encountering this same problem in LV 8.0.1. I'm unable to open your example VI because it's in 8.20. Any chance of posting this solution saved down to 8.0.1? Thanks!! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.