Table Of Contents

C Node (G Dataflow)

Version:
    Last Modified: January 9, 2017

    Executes the code inside the node, written in the C programming language. With the C Node, you can add text-based code into the graphical development environment.

    Press <Ctrl-Space> inside the node to get an overview of all available functions.

    To add an input, right-click the node frame and select Create»Input. To add an output, right-click the node frame and select Create»Output.

    terminal_icon

    error in

    Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

    terminal_icon

    error out

    Error information. If error in indicates that an error occurred before this node ran, error out contains the same error information. Otherwise, it describes the error status that this node produces.

    terminal_icon

    input

    The connection between the G dataflow code outside the node and the C code inside the node. The code within the node uses the values that are connected to the inputs for calculations inside the node.

    By default, LabVIEW adapts the data type of the input based on the data type of the terminal you wire. To ensure that the data type of the variable in the C Node is static and always known, you can specify the data type in the Item tab.

    terminal_icon

    input string

    A string data connection between the G code outside the node and the C code inside the node. The input string is accessible in the C code as a nul-terminated C string represented by a char * variable with the same name as the tunnel. The value wired to the input tunnel is the initial value of this variable.

    You can resize the string buffer using the cnode_size_string macro. You can get the length of the string using the strlen function.

    By default, LabVIEW adapts the data type of the input based on the data type of the terminal you wire. To ensure that the data type of the variable in the C Node is static and always known, you can specify the data type in the Item tab.

    terminal_icon

    input array

    An array data connection between the G code outside the node and the C code inside the node. The input array is accessible in the C code as a C array variable with the same name and type as the tunnel. The value wired to the input tunnel is the initial value of this variable.

    You can get the number of elements in the array using the cnode_get_array_length macro. You can resize the array using the cnode_size_array macro. You can index the array using the [i] notation.

    By default, LabVIEW adapts the data type of the input based on the data type of the terminal you wire. To ensure that the data type of the variable in the C Node is static and always known, you can specify the data type in the Item tab.

    terminal_icon

    input string array

    A string array data connection between the G code outside the node and the C code inside the node. The input string array is accessible in the C code as a C array of nul-terminated C strings represented by a char * [] variable with the same name as the tunnel. The value wired to the input tunnel is the initial value of this variable.

    You can get the number of string elements in the array using the cnode_get_array_length macro. You can resize the string array using the cnode_size_array macro. You can index the array using the [i] notation. You can resize the ith element of a string array named my_string_array using cnode_size_string(string_array[i]). Because each element is a C string, you can use ANSI C string functions such as strlen, strcpy, strcat, and so on.

    By default, LabVIEW adapts the data type of the input based on the data type of the terminal you wire. To ensure that the data type of the variable in the C Node is static and always known, you can specify the data type in the Item tab.

    terminal_icon

    output

    The connection between the C code inside the node and the G dataflow code outside the node. The output contains the values that LabVIEW calculated inside the node. The default type of an output terminal is double. For other data types, you can specify the data type of the terminal on the Item tab.

    terminal_icon

    output string

    A string data connection from the C code inside the node to the G code outside the node. The output string is represented in the C code by a char * nul-terminated C string variable with the same name as the tunnel. The final value of this variable is the value available at the output tunnel.

    You can resize the string buffer using the cnode_size_string macro. Because this variable is a C string, you can use ANSI C string functions such as strlen, strcpy, strcat, and so on.

    The default type of an output terminal is double. For other data types, you can specify the data type of the terminal on the Item tab.

    terminal_icon

    output array

    An array data connection from the C code inside the node to the G code outside the node. The output array is represented in the C code by a C array variable with the same name and type as the tunnel. The final value of this variable is the value available at the output tunnel.

    You can get the number of elements in the array using the cnode_get_array_length macro. You can resize the array using the cnode_size_array macro. You can index the array using the [i] notation.

    The default type of an output terminal is double. For other data types, you can specify the data type of the terminal on the Item tab.

    terminal_icon

    output string array

    A string array data connection from the C code inside the node to the G code outside the node. The output string array is represented in the C code by a char * [] C array of nul-terminated C strings variable with the same name as the tunnel. The final value of this variable is the value available at the output tunnel.

    You can get the number of elements in the array using the cnode_get_array_length macro. You can resize the string array using the cnode_size_array macro. You can index the array using the [i] notation. You can resize the ith element of a string array named my_string_array using cnode_size_string(my_string_array[i]). Because each element is a C string, you can use ANSI C string functions such as strlen, strcpy, strcat, and so on.

    The default type of an output terminal is double. For other data types, you can specify the data type of the terminal on the Item tab.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: Not supported


    Recently Viewed Topics