05-23-2013 10:15 AM - edited 05-23-2013 10:18 AM
Hello
I am developing an application which I would like to execute on both normal and real-time systems using LabVIEW Proffesional Development System 2012 SP1
To control how the application interacts with the user, I have created a class which defines the type of user-interface behaviour which should allow me to have nice dialog boxes when the system is executing on a windows machine and have no dialog boxes (or other non-Real-Time friendly code) when operating on a real-time target.
The parent class is the code that is suitable for Real-Time and the child class is the one with dialog boxes.
To control which class is loaded, I have a conditional disable structure. This will work fine when the application is built into a executable or real-time executable but the problem arises when I want to use the code during development on the real-time target.
I find that with the application under a real-time target (RT PXI), the correct conditional-disable case is activated so the parent class is used, but the child classes are also listed under the dependancies - I pressume this is because they exist on the block diagram in the disabled case of the conditional disable diagram.
This means that I cannot deploy the code to the Real-Time target as it is unhappy with the child class code - even though this will never be run.
To save posting my real project, I have created an example with a Parent and Child class and a Conditional Disable Flag called "CLASS" to demonstrate the problem.
If you run Test.vi you will see that the Child class still gets locked (i.e. is a dependancy) during execution even though it is not called.
So - basically my question is: Is there anything I can do about this or will I just have to do-away with the conditional disable and just put the correct Class constant on the block diagram during testing?
Thanks in advance
John.
Solved! Go to Solution.
05-23-2013 10:39 AM
I feel your pain. I ran into a similar problem a short time back.
Apparently Official NI stance is that you need to put a conditional Disable structure IN EVERY ONE OF YOUR CLASS VIs. In the Windows VIs, you simply have an empty conditional disable case with the windows code in an appropriate other case and vise versa on the RT.
I too would much prefer the method you describe...
05-23-2013 10:44 AM
Thanks very much for you rapid response.
I guess it is one of those things that you just have to accept for the time being.
Cheers
John
05-23-2013 12:58 PM
An easier solution that might apply would be to dynamically load the child class from disk in the disabled structure instead of having a constant of the class on the block diagram. You can use this method to load class instances from disk, then use the To More Specific Class function to cast it to the correct base type.
This will only work, however, if you don't ever need to call any child-specific VIs that don't exist as part of the parent class.