• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    FBD function error

    Mervis
    5
    10
    1713
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Martin Trojan last edited by

      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.

      T 1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators @Martin Trojan last edited by

        @martin-trojan Can you share the whole project or at least the function you are working on?

        1 Reply Last reply Reply Quote 0
        • M
          Martin Trojan last edited by

          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.

          0_1540819752801_8f516811-630b-409f-ad3c-add048cd2367-image.png

          T R 2 Replies Last reply Reply Quote 0
          • T
            tomas_hora administrators @Martin Trojan last edited by

            @martin-trojan That is different than what you describe or I do not understand the first post. Anyway share the project.

            1 Reply Last reply Reply Quote 0
            • M
              Martin Trojan last edited by

              Both issues can be seen on the pictures. One in results window and other in popup. Send it to email?

              T 1 Reply Last reply Reply Quote 0
              • T
                tomas_hora administrators @Martin Trojan last edited by

                @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 :)

                1 Reply Last reply Reply Quote 0
                • R
                  robl @Martin Trojan last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • W
                    wzp last edited by

                    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?ef91571b-e548-4151-b311-0b3f1c561977-image.png

                    Martin Kudláček 1 Reply Last reply Reply Quote 0
                    • Martin Kudláček
                      Martin Kudláček @wzp last edited by

                      Hello @wzp, create a output variable by the same name as the function.

                      Best regards,
                      Martin

                      1 Reply Last reply Reply Quote 0
                      • W
                        wzp last edited by

                        It's working, thanks!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post