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

C Code Generation Options Properties Page (Embedded Targets, PDA Module, Touch Panel Module)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

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 PDA 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.

The default is Use project setting, so you need to set the options here only if you want to override the code generation settings in the project. If you use this page to set a code generation option for a VI, you cannot change the option in the Build Specification Properties dialog box.

This page includes the following components:

  • Embedded, PDA and Touch Panel Targets—You can use the following code generation options with embedded, PDA, 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 an embedded, PDA, or Touch Panel 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 embedded application run much faster. However, you lose parallel execution behavior. This execution behavior most closely resembles subroutine priority VIs in LabVIEW for Windows.
  • 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 embedded VI into an embedded 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 embedded 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 embedded application slightly larger and slower.
    • Generate integer only—Generates C code without any floating-point declarations or operations. This option creates a smaller embedded 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.

Resources


 

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