Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Testing and Troubleshooting Generated C Code (C Generator)

LabVIEW 2011 C Generator Help

Edition Date: June 2013

Part Number: 373144C-01

»View Product Info

National Instruments recommends you test the exported VI before generating C code and test generated C code before you use it externally. You can test the exported VI in LabVIEW to simulate the behavior of the generated C code.

Note  You cannot debug an exported VI in LabVIEW. Debug the generated C code in an external IDE.

You might encounter the following issues when generating C code:

  • The C Generator supports some block diagram objects differently in exported VIs and all VIs in their hierarchy.
  • The exported VI cannot contain parallel code.
  • The C Generator cannot generate C code for a VI that is not under the My Computer target in the project.
  • The C Generator cannot generate C code if the exported VI hierarchy contains unsupported data types, VIs, functions, or structures.

The C Generator includes syntax checking of the exported VI. When you create a C Code Generation build specification, the C Generator enables syntax checking for the exported VI. When LabVIEW checks the syntax of the VI for which you want to generate C code, LabVIEW is checking that the C Generator can create generic C code based on the design of the exported VI. LabVIEW always checks the syntax of the exported VI before it builds the VI.

If the exported VI contains a syntax error, the LabVIEW toolbar displays the Warning button, which is shown as follows.

Note  If you remove the checkmark from the Show Warnings checkbox in the Error list window, LabVIEW no longer displays syntax warnings for C code generation. If you disable warnings, you can check the syntax of the exported VI by right-clicking the C Code Generation build specification in the Project Explorer window and selecting Check Syntax from the shortcut menu.

LabVIEW displays the Warning button during syntax checking if the exported VI hierarchy contains unsupported data types, VIs, functions, or structures. While syntax warnings do not prevent you from running the exported VI in LabVIEW, you cannot generate C code for the VI until you correct all syntax warnings. To locate a specific error on the block diagram, double-click the error description in the Error list window to highlight the error on the block diagram.


 

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