Including Generated C Code in External Applications (C Generator)

LabVIEW 2011 C Generator Help

Edition Date: June 2013

Part Number: 373144C-01

»View Product Info

If you have an existing makefile or project you created in another IDE in which you want to include the generated C code, you can use that makefile or project instead of the makefiles generated by the LabVIEW C Generator. You can include the generated C code in an external project in one of the following ways:

  • Add the necessary files directly into the external project.
  • Build the generated C code files into a static library, or archive file, and link the static library into the external project.
  • Build the generated C code files into a DLL and load the DLL from the external project at run time.

Regardless of which method you choose to include the generated C code in the external project, you must compile the following files:

  • All generated C files.
  • Run-time library files from the labview\CCodeGen\libsrc\blockdiagram directory, which include the following files:
    • CCGArrSupport.c
    • CCGArrSupport2.c
    • CCGArrSupport3.c
    • CCGClusterSupport.c
    • CCGCmplxSupport.c
    • CCGDVRSupport.c
    • CCGEnumSupport.c
    • CCGFltSupport.c
    • CCGFXPSupport.c
    • CCGIntSupport.c
    • CCGStrSupport.c
    • CCGTimeSupport.c
    • CCGTokString.c
    • CCGUDClassSupport.c
    • CCGVariant.c
    • CCGXMLSupport.c
    • ExecStack.c
    • LVBlockDiagram.c
    • LVCGenRTInit.c
    • LVContext.c
    • LVHeap.c
    • LVTdp.c
    • MemCheck.c
    • nbemptybin.c
    • nbfifo.c
    • nbfifo_inst.c
    • nbitemtable.c
    • NumText.c
    • rtmath.c
    • ViLib.c
  • The following files from the labview\CCodeGen\libsrc\comms:
    • CCGVIRefSupport.c
    • crc.c
  • The following files from the labview\CCodeGen\libsrc\frontpanel:
    • LVArrayControl.c
    • LVBoolean.c
    • LVClusterControl.c
    • LVEnumCtl.c
    • LVFrontPanel.c
    • LVListbox.c
    • LVNumeric.c
    • LVRadioClustCtl.c
    • LVRing.c
    • LVScrollbar.c
    • LVString.c
    • LVTab.c
    • LVTable.c
    • LVTimestamp.c
    • LVTree.c
    • Pict.c
  • Headless.c from the labview\CCodeGen\libsrc\os\common directory
  • arrresize.c from the labview\CCodeGen\libsrc\analysis directory

You also must set the compiler options to include the following build specification output path directories in the header search paths:

  • The directory in which you saved the generated C files. You specify this directory in the Destination directory option on the Information page of the C Code Generation Properties dialog box.
  • labview\CCodeGen\include\blockdiagram
  • labview\CCodeGen\include\comms
  • labview\CCodeGen\include\frontpanel
  • labview\CCodeGen\include\platform\subdirectory, where subdirectory is the platform you are using
  • labview\CCodeGen\analysis\development\include
  • labview\CCodeGen\analysis\LV\source\include

You also must build and link to the analysis library if you use the Mathematics or Signal Processing VIs in the exported VI.

Tip  You also can generate C code from the command line.


Not Helpful