找回密码
 注册
LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 639|回复: 1

Inline C Node (Embedded Targets, PDA Module, Touch Panel Module)[转自NI]

[复制链接]
发表于 2009-7-6 13:13:18 | 显示全部楼层 |阅读模式
今天lgh269版主兄弟发了个东西让我看,感觉不错,这里贴出来大家分享一下!转自NI:



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[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[j] ] [c[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.
javetu 该用户已被删除
发表于 2009-11-19 16:15:41 | 显示全部楼层
回复 顶

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2026-9-29 09:11 , Processed in 0.024634 second(s), 8 queries , Gzip On, File On.

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表