Jump to content

XControls and .vit


Recommended Posts

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

Link to comment

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

Link to comment
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.

Link to comment
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.