|Download Help (Windows Only)|
Owning Palette: Structures
Requires: Embedded Module for ARM Microcontrollers, C Generator, Mobile Module, Touch Panel Module, or LabVIEW WSN Module
Adds C code or assembly code to the block diagram.
|Tip Use the Inline C Node for short blocks of code that you cannot implement easily in VIs, such as I/O register access. Use the Call Library Function Node if you want to add external C files, such as existing libraries, or the C code you want to add is complicated or large.|
|Note The Inline C Node is available only for targets that use generated C code. The Inline C Node is not supported for desktop Windows targets.|
The Inline C Node is similar to the Formula Node with additional support and functionality for low-level programming and header files without the overhead of a function call. You can use the Inline C Node for any C code, including assembly directives and #defines, that syntactically is between the curly braces in a C file. Syntax checking for an Inline C Node occurs at edit time, and red dots on the left bar of the Inline C Node indicate errors. Some errors, such as undefined functions or variables, cannot be detected until the generated C code for the VI is compiled. If errors occur, the build stops and you receive an error.
|Note Do not use return or exit statements in Inline C Nodes.|
Right-click the Inline C Node and select Add Input or Add Output from the shortcut menu to add input variables and output variables to the Inline C Node. Do not use reserved or illegal C names when you name the variable. Outputs are the same data type as the input with the same name. You can use scalar data types and 1D and 2D arrays of scalar data types, including fixed-point data types, for input to and output from the Inline C Node. The Inline C Node correctly handles notations such as a[i][j], where i, j are expressions which recursively might contain other expressions including 1D arrays but excluding 2D arrays. For example, A[b[i...]][c[j]] is valid, but A[ b[i][j] ] [c[i][j] ] is not valid.
Inputs adapt to the data type of the wire. Outputs default as a double-precision, floating-point numeric data types.
|Note LabVIEW represents a fixed-point variable as an integer in the Inline C Node. To create a fixed-point data type output, you must wire a fixed-point data type input to the Inline C Node and the input and output names must match.|
LabVIEW declares a pointer to the element type for arrays. You also can use standard array indexing to access array elements. Array outputs have the same type and size as the corresponding array input. You can change the contents of the array output, but you cannot change the size of the output array or the pointer value.
To include header files when generating the C code, right-click the Inline C Node and select Add/Remove Header Files from the shortcut menu to display the Add/Remove Header Files dialog box.
|Note The Inline C Node becomes a label if you save a VI that contains an Inline C Node to a previous version of LabVIEW.|
To modify the syntax coloring, default tab size, or default external editor, right-click the Inline C Node and select Global C Node Options from the shortcut menu to display the Inline C Node page of the Options dialog box.