LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Xcontrol does not work in built application

I can't seem to get my custom xcontrol to work in the final built application.  It works perfectly fine when the top-level .vi is started from the development environment.  But all I get is the broken control image when I run the built application.  Is there something I'm missing in the build definition?
 
I tried puting the thermometer xcontrol example into a built application and everything works fine.  The build definition only included the top-level file, so I don't think it's a problem with support/dynamic files...
 
By the way, is there some trick to maintaining these xcontrols?  I love the concept, but man they are a pain in the butt to work with.  One wrong move in the project manager and they're messed up for life.  I finally learned to back everything up on a regular basis so I wouldn't lose everything if it one decided to go psycho on me.
 
TIA,
Greg
0 Kudos
Message 1 of 5
(3,011 Views)
Hello,
 
I'm not sure what the problem is, but as you've seen with the example, the general idea is of course ok.  Is it possible for you to post a very simple version of your code which shows this so I can try to reproduce it on my end?  As far as "tricks" to maintaining XControls, I'm afraid I don't have any.  But just like with any feature, new or old, your feedback and recommendations are very much appreciated.  If you have some workflow suggestions for XControls, please submit them by clicking the "feedback" link in the lower left corner of our Contact NI page.
 
If you can't post your code, perhaps at least a screenshot of the problem will lead to some ideas.
 
Thank you,
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 5
(2,993 Views)
I've got it working now, but I'm going about it in a round-about way.  My application has (had) a splash-screen/launcher vi that dynamically loads and launches the actual top-level user-interface vi.  The top-level vi was included in the build definition as a dynamic file.  This is the ONLY dynamic call in the entire application.  All other vi are called the normal way on the wiring diagram.  I could never get the xcontrol to work this way.  I even tried including ALL of the relevant files as dynamic/support file and could never get it to work.  In one experiment, I placed an xcontrol on the top-level vi (the top-level vi doesn't have any of the xcontrols, only a couple dialog-box sub-vis that it calls).  Again, everything worked fine from the development environment.  But, when compiled, the top-level vi would fail to start completely.  I never bothered to check what the execution state of the top-level vi was before I called it, but I assume it was "bad" so the dynamic call would fail.
 
I got it working by eliminating the dynamic call and calling the top-level vi as a normal sub-vi from the wiring diagram.  BUT, it still had problems and would always ask me to find a couple files from the 'XControlSupport.lvlib', specifically 'Action.ctl' and 'Container State.ctl'.  The xcontrol also uses the standard 'eventkey.ctl' from the 'event_ctls.llb' and it would ask me to find this file every time as well.  I tried including the libraries in the project and including these libraries in the build as dynamic/support files, but still no good.  To fix the problem, I copied these files into my project folder, specifically included them in my project, and then replaced all of the controls wherever they appeared with the corresponding controls included within the project.
 

Message Edited by GTM on 07-14-2006 08:48 AM

0 Kudos
Message 3 of 5
(2,983 Views)
Now that I think about it, the "missing" files are probably why it doesn't work with the dynamic call.  With the "static" call, LabView knows it needs these files right away, so it asks me to find them.  With the dynamic call, it doesn't know it needs to find them and just sees the xcontrol as broken.
 
But, the question remains.  Why can't the xcontrol find these files automatically?  Before I decided to clone the problem files into my project, I even tried deleting all the problem controls, exiting labview comletely to make sure everything was out of memory, and then going back in and putting the controls back in (loaded from their normal location).  The only thing that finally worked was making my own copies and explicitly including them in my project.
0 Kudos
Message 4 of 5
(2,975 Views)
Hello,
 
It sounds like the linking wasn't correct, but I'm not sure why in that case.  I am wondering, were you including your dynamically called subVI as a dynamic VI in your application/exe build specification?  The reason I asked is that you indicated that you made copies of files and then explicitly included them in your project - if they were not included in your project, then you would not see them as source files in your exe build specification, and would therefore not be able to include the dynamically called subVI as a dynamic VI.  Could this be the problem?
 
If not, I'd really like to take a closer look at this, so if you could get your code down to something you can post, please do!  I'd like to figure out exactly what's causing it to fail, to determine if it's a bug or just something we're missing!
 
Thank you, and I am glad it's at least working now!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 5 of 5
(2,954 Views)