Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Convert FB to PROGRAM

pnn
2013-08-23
2013-08-26
  • pnn - 2013-08-23

    Hi,

    I want to convert a SFC FB to a PROGRAM.
    Tried to copy/paste steps but it didn't work.
    So I exported the FB to .exp file, and then edited the .exp file with Notepad - just changed
    "FUNCTION_BLOCK Test" to "PROGRAM Test" at he beginning, and
    "END_FUNCTION_BLOCK" to "END_PROGRAM" at the end.
    Then I deleted the FB from the project and imported the edited .exp file.

    So now I have it as a PROGRAM, the project compiles OK, but is this safe?
    There are some things in the .exp file that I don't understand, namely


    ( @OBJECTFLAGS := '0, 8' )
    ( @SYMFILEFLAGS := '2048' )


    What is the meaning of these flags and do they depend on the type of POU?

    Thanks

     
  • shooter - 2013-08-26

    dont mind all these extra texts.

    A function block has its inputs and outputs, and a program can not have this.
    so you must check the VAR list and change the inputs to the normal var and same for outputs.

    better is however to call the FB in your main program and when debugging you can click on the FB and see it actually working.

    I still make the same mistake to make the program and then realise i have to do it in a FB.

     

Log in to post a comment.