Configuring the Function Prototype (C Generator)

LabVIEW 2011 C Generator Help

Edition Date: June 2013

Part Number: 373144C-01

»View Product Info

Use the Define VI Prototype dialog box to define the parameters for the exported VI for which you want to generate a C function interface. The LabVIEW C Generator generates a C function interface for the VI you specify in the C Code Generation build specification. The generated function converts the C-type parameters into C Generator data types. The generated function calls an internal function that implements the functionality of the exported VI. The generated function name is the same as the VI name unless the VI name contains a disallowed character, such as a space, in the file name. Underscores replace disallowed characters. The exported VI uses default data if any input or output terminal has an unsupported data type.

The C Generator creates a header file that contains the function prototype for the exported VI. You can include this header file where the exported function is called. The header file has the same name as the exported VI appended with Lib.h.

The exported VI is more restrictive in terms of data type support than the rest of the VI hierarchy because the C Generator maps exported VI terminals to standard C data types. The C Generator supports the following data types for exported VIs:

  • Strings
  • Scalars, including Boolean, numeric, and fixed-point data types
  • Arrays that contain only scalar values. For example, you cannot use an array of strings or an array of clusters.
  • Flat clusters, which are clusters that contain only scalar values. For example, you cannot use a cluster that contains a string or an array.

The execution behavior of the C code that the C Generator creates differs from the typical execution behavior of LabVIEW VIs running on Windows.

Note  Input strings to the function prototype must be null-terminated C strings.

To view related topics, click the Locate button, shown at left, in the toolbar at the top of this window. The LabVIEW Help highlights this topic in the Contents tab so you can navigate the related topics.


Not Helpful