LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code coverage used when building an executable

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?

0 Kudos
Message 1 of 8
(2,825 Views)

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.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 8
(2,810 Views)

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?

0 Kudos
Message 3 of 8
(2,791 Views)

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?

Jared S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 8
(2,768 Views)

These are indeed cases of a case structure.  I ensure that they other cases cannot be executed by wiring the selector to a constant.

0 Kudos
Message 5 of 8
(2,757 Views)

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.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 6 of 8
(2,751 Views)

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.

0 Kudos
Message 7 of 8
(2,742 Views)

You are welcome. Good luck with your project.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 8 of 8
(2,735 Views)