I'm trying to use a library defined function (CCaux for Cross Control Products) with the following interface:
FUNCTION Lightsensor_GetIlluminance : eErr (* return error status. 0 ERR_SUCCESS, otherwise error code.*)
VAR_OUTPUT
value: UINT;(*Illuminace value (Lux)*)
END_VAR
I can't seem to find the correct syntax for getting the "value" from the output variable. Here is what I have in my program:
VAR
illumen : UINT;
END_VAR
Where I want illumen
to be set to the output variable of Lightsensor_GetIlluminace
. The following doesn't work since it sets the variable to the eErr
:
illumen := CCAux.Lightsensor_GetIlluminance();
And:
illumen := CCAux.Lightsensor_GetIlluminance.value;
Doesn't work because I get the error 'value' is no input of 'Lightsensor_GetIlluminance'
And:
illumen := CCAux.Lightsensor_GetIlluminance(value := illumen);
fails because Lightsensor_GetIlluminance take exactly '0' inputs
I am using CoDeSys for context.