Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

C Code Generation Options Properties Page

LabVIEW 2009 Help

Edition Date: June 2009

Part Number: 371361F-01

»View Product Info

Requires: Embedded Module for ARM Microcontrollers, Embedded Module for Blackfin Processors, Microprocessor SDK, Mobile Module, or Touch Panel Module

From the front panel or block diagram window of a VI, select File»VI Properties and select C Code Generation Options from the Category pull-down menu to display this page.

Note  These options are applicable only for Mobile targets, Touch Panel targets, and embedded targets that use the LabVIEW C Code Generator.

Use this page to set code generation options per VI rather than per application.

You need to set the options here only if you want to override the code generation settings in the project.

This page includes the following components:

  • Embedded, Mobile, and Touch Panel Targets—You can use the following code generation options with embedded, Mobile, and Touch Panel targets.
    • Expression folding—Generates better performing and more efficient code by collapsing groups of nodes into single expressions that are easily recognized by C compilers. You cannot debug a VI while using expression folding because expression folding eliminates some of the wires in the generated C code. If you overrun the bounds of an array or divide by zero, the application might crash.
    • Generate serial only—Generates C code without cooperative multitasking code. Removing this cooperative multitasking code makes the C code easier to read, which usually makes the application run much faster. However, you lose parallel execution behavior. This execution behavior most closely resembles subroutine priority VIs running on Windows.
    • Allow inlining—Allows inlining of subVIs into callers, which can eliminate overhead and increase code optimization. Inlining subVIs is most useful for small subVIs, subVIs called in a loop, or subVIs with only one call site. The default is TRUE. This option only allows inlining. To actually inline a subVI, you must select True from the Inline subVI pull-down menu on the Source File Settings page in the Build Specification Properties dialog box.
  • Embedded Targets Only—You can use the following code generation options only with embedded targets.
    • Generate C function calls—Generates the calling interface to the VI as C function calls without any default data initializations, which can reduce the code size by as much as 50% for a small VI. An error occurs if any input or output to the VI is unwired when you build the VI into an application. To generate C function calls, you also must select True from the Generate serial only pull-down menu.
    • Generate guard code—Generates extra code to prevent common coding mistakes that can cause an application to crash or function incorrectly. For example, guard code can prevent dividing by zero or indexing out of range in an array. Guard code makes an application slightly larger and slower.
    • Generate integer only—Generates C code without any floating-point declarations or operations. This option creates a smaller application because it does not link any floating point-specific libraries.
    • Use stack variables—Uses stack variables rather than heap variables to represent signals in the generated C code, which enables better C compiler optimizations and makes the C code faster. To use stack variables, you also must select True from the Generate serial only pull-down menu.
    • Optimize subVI calls—Generates C code for subVI calls with as little default data initialization as possible. You cannot debug a VI if you optimize subVI calls.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit