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

Inline C Node

LabVIEW 2009 Embedded Module for Blackfin Processors Help

Edition Date: June 2009

Part Number: 371653E-01

»View Product Info

Owning Palette: Structures

Requires: Embedded Module for ARM Microcontrollers, Embedded Module for Blackfin Processors, Microprocessor SDK, Mobile Module, or Touch Panel 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 easily implement 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, 1D, and 2D arrays of scalar 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. To define the data type of the output, create an input with the same name and wire the correct data type to the input.

The LabVIEW C Code Generator 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 Properties from the shortcut menu to display the Inline C Node page of the Options dialog box.


 

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