FBD function error
-
Hi, when I create function and create some inputs and outputs it gives me an error:
Error MainProgram testFunction 0 1 there is not declared any retval output for function 'thermometer'. FBD functions have to have retval explicitly declared
Error cannot find type unresolved
I don't know what to do. How to build it. There are no other options what I can setup.
Other issue is when I delete something from this function it is ok, but when I delete other variable I have this error:
Value cannot be null.
Parameter name:source. -
@martin-trojan Can you share the whole project or at least the function you are working on?
-
Do you want to send it? But I have just create empty function, add one input(bool) and one function block OR and just delete unput. Then error.
-
@martin-trojan That is different than what you describe or I do not understand the first post. Anyway share the project.
-
Both issues can be seen on the pictures. One in results window and other in popup. Send it to email?
-
@martin-trojan I tried to simulate the second issue but did not succeed. Send both projects with exact steps how to reproduce the issue to our support in czech :)
-
@martin-trojan I just encountered the same error:
"there is not declared any retval output for function 'testfunction'. FBD functions have to have retval explicitly declared"
After some experimentation, I just created a bool output on the right side called "retval".
It's set to "False" by default but it seems happy with True also.Not sure how this is used in FBD, but it might be needed in ST scripts to determine if there were errors encountered while the block tried to execute. (e.g. if it returns > 0 then stop) etc.
Perhaps one of the unipi team can comment on what it is for?
Anyway - it seems to build without errors now.
-
I am having the same problem, but also creating the output variable in the function that is in failure, does not fix the problem. Any other ideas?
-
Hello @wzp, create a output variable by the same name as the function.
Best regards,
Martin -
It's working, thanks!