09-01-2010 10:33 AM
I have an action engine with two methods.
The instance compiled into my PC app uses only methods A and B.
The instance compiled into my cRIO app uses methods A, B, C, and D.
Is the code for methods C and D included in my PC executable?
09-01-2010 11:06 AM
What do you mean it has two methods, the mention, in the cRIO version 4 methods? If the code in the PC app is different, i.e. only the two methods mention are ever used, base on a typedef constant for instance, the compiler probably doesn't include the code. If you can give us a bit more information, more than likely one of the NI folks that actually work on the compiler can wade in with an answer. Also, what version of LabVIEW are you using, as they do make significant compiler changes between versions, some designed to improve performance by eliminating code that is never accessed.
09-01-2010 03:06 PM
I am using LV2009SP1 and LV2010.
By method, I mean a case of the action engine. In other words, if there are multiple cases and the case value can never be certain values, will those cases that cannot be selected be included?
09-03-2010 05:45 AM
Hi kc64,
I'm assuming these are cases in a case structure, but correct me if I'm wrong. In general, I would assume that these cases are included, since LabVIEW won't always know what code is unreachable. How are you ensuring that these cases aren't selected on the PC version?
09-03-2010 08:07 AM
These are indeed cases of a case structure. I ensure that they other cases cannot be executed by wiring the selector to a constant.
09-03-2010 08:31 AM
Generally the compiler is "smart enough" that if a case statement is wired to a constant it eliminates the "unreachable" code. Why are you concerned, unless the the other cases contain massive code there shouldn't be too big a difference in the exe size and if anything the cRIO would be the one with the memory limitations.
09-03-2010 09:33 AM
Some questions are simply asked out of pure curiosity and a desire to know how the tool works. This is one such case directly related to my current project.
Thank you all for your inputs.
09-03-2010 09:53 AM
You are welcome. Good luck with your project.