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
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.