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

    FBD function error

    Scheduled Pinned Locked Moved Mervis
    10 Posts 5 Posters 4.5k Views
    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áčekM 1 Reply Last reply
                    Reply Quote 0
                    • Martin KudláčekM
                      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

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post