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