2024年4月14日发(作者:)
0. 参考示例:
LabVIEW
1. 调用库函数节点
2. 配置参数
2.1. 返回参数
类型:有Void,Numeric和String三种,如下图所示。
(1)Void
Void is only available for return type and is not available for other parameters. Use Void for
the return type if your function does not return any values.
Even if the function you call returns a value, you can use Void for the return type. When the
function returns a value and you select Void as the return type, the value returned by the
function is ignored.
(2)Numberic
以为例,如下图。另外数据类型中的“指针大小整型”(pointer-sized integer),
帮助文档的解释如下:
(3)String
目前还没碰到过,等遇到时再补充。
2.2. 输入(出)参数
其类型共有9种,常用的有数值、数组、字符串和匹配值类型。
2.2.1. 数值
需要注意的是,其传递选项有“值”和“指针”两种,分别对应值传递和指针传递。
a. 数据类型为int32
函数原型为void LVint32(int32 input, int32 *output);
本函数计算输入值的平方,然后将结果显示在“输出”中。
返回类型为void,
input类型为int32,值传递
output类型为int32,指针传递
注:如将结果返回至某个控件,该控件本身即可为返回数据提供必要的内存空间。
b. 数据类型为float64
函数原型为void LVfloat64(float64 input, float64 *output);
本函数计算输入值的平方,然后将结果显示在“输出”中。
返回类型为void,
input类型为8字节双精度,值传递
output类型为8字节双精度,指针传递
c. 数据类型为BOOL
函数原型为void WinBOOL(BOOL input, BOOL *output);
本函数将输入值反转后显示在“输出”中。
BOOL在头文件中的定义为typedef int BOOL,因此在LabVIEW中其数据类型选择int32.
d. 数据类型为BOOLEAN
函数原型为void WinBOOLEAN(BOOLEAN input, BOOLEAN *pinput, PBOOLEAN output);
本函数对值传递和指针传递的输入值执行“逻辑与”操作,并将返回结果反转后显示在
“输出”中。
BOOLEAN在头文件中的定义为typedef unsigned char BOOLEAN,即无符号字符类型,占1


发布评论