01-25-2013 07:55 AM
I'm a bit stuck and don't know how to solve it and couldn't find online a solution.
I have a parent class and its child class. The child class only overrides one method, but not the run method. I would like to compile the project to an executable, where the run method is called, but the class type is of the child, not of the parent. How to do this?
I tried three things, but all in vain:
1) In the build properties when I select Startup VI the run method of the parent, I get in the executable the parent class, not the child class. This makes sense. However, I couldn't find the option to use the child class as type.
2) When I add the run method to the child class and make a call to parent, I get two windows popping up. The run method of the parent and of the child. One too many. Even though for the child class run method (see below block diagram of child, red run method is parent), I have set not to show the front panel when called in the VI properties.
3) When I tried with a separate VI calling the run method of parent class but the type of the class is the child, I get the front panel of this separate VI and of the run method of the parent. See below (blue is child class, red is parent).
For both case 2 and 3 I selected to put a FALSE at the check mark "Show front panel when called", but still the front panels appear.
Would someone know either: i) how to use in the executable build options to build an executable where the method of a different class is used, or ii) when you compile an executable with a certain startup VI, to not show this startup VI?
Solved! Go to Solution.
01-25-2013 08:03 AM
Do i understand it correctly if i say "You want to configure the RUN method of the class as 'startup VI' in the EXE, but it should run the RUN method for a child object"?
If this is correct, your third approach is the correct one. This new startup VI is often used as "Splash Screen" which covers the task of a "spawning demon" for your application.
You simply have to close this VI once it has finished. This can be done using VI server functions on its own frontpanel.
hope this helps,
Norbert
01-25-2013 08:18 AM
Yes, you understood correctly.
I indeed use now the FP.Close method to close the front panel. This can be used in both solution 2 and 3. However, it is still surprising for me that though set to NOT show the front panel, they are still shown when compiled.