【发布时间】:2018-11-09 12:23:06
【问题描述】:
我正在尝试使用具有以下接口的库定义函数(CCaux for Cross Control Products):
FUNCTION Lightsensor_GetIlluminance : eErr (* return error status. 0 ERR_SUCCESS, otherwise error code.*)
VAR_OUTPUT
value: UINT;(*Illuminace value (Lux)*)
END_VAR
我似乎找不到从输出变量中获取“值”的正确语法。这是我的程序中的内容:
VAR
illumen : UINT;
END_VAR
我希望将illumen 设置为Lightsensor_GetIlluminace 的输出变量。以下不起作用,因为它将变量设置为eErr:
illumen := CCAux.Lightsensor_GetIlluminance();
还有:
illumen := CCAux.Lightsensor_GetIlluminance.value;
不起作用,因为我收到错误 'value' is no input of 'Lightsensor_GetIlluminance'
还有:
illumen := CCAux.Lightsensor_GetIlluminance(value := illumen);
因为Lightsensor_GetIlluminance take exactly '0' inputs而失败
我正在使用 CoDeSys 作为上下文。
【问题讨论】: