I have declared in my SFC properties the use of SFCinit (also in the menu Tool\options) but when I try to acces to mySFC.SFCInit form PLC_PRG , I have the message
"SFCInit" is no input of mySFC
I have try to declared :
VAR_INPUT
SFCInit:BOOL;
END_VAR
in the declaration part my SFC POU, but it is the same.
Thank you very much
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In order to activate SFCInit for a SFC POU you must open the property window of SFC POU object (right button click over the POU name) and in the "SFC Configuration" tab click "Active" in SFCInit variable.
Also the declaration of input variable in the POU is needed:
VAR_INPUT
SFCInit : BOOL ;
END_VAR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I see this post is so old, but I have a question regarding SFC Configuration flags.
I can create an SFC Pou and, for instance, add SFCInit:BOOL; to the declaration text. But in order to use it, I have to check SFCInit flag from SFC Configuration window.
So, is it possible to configure flags from a python script?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Sirs,
I have a problem with SFC. I'd like to jump to init step from a PLC task (for example when an error occurs),I can't use SFCInit as a global variable.
How can I do that? Could someone help me?
Thank you very much.
Roberto
Hi,
you could declare SFCInit within a class
VAR_INPUT
END_VAR
in the declaration part of your SFC-POU.
Then you can access to it from another POU for example like this:
MySFC.SFCInit:=TRUE;
I hope this can help.
I try to make the same with Codesys V3 :
I have declared in my SFC properties the use of SFCinit (also in the menu Tool\options) but when I try to acces to mySFC.SFCInit form PLC_PRG , I have the message
"SFCInit" is no input of mySFC
I have try to declared :
VAR_INPUT
SFCInit:BOOL;
END_VAR
in the declaration part my SFC POU, but it is the same.
Thank you very much
With my version 3.1 SP2 Patch 2 it works pretty fine. So the question ist what is your version?
Regards
Ralph
My version is 3.1 SP3 Patch 1
Did you made just the declaration the use of SFCinit in the SFC properties (and also in the menu Tool\options)
or did you made the declaration explicit of
VAR_INPUT
SFCInit:BOOL;
END_VAR
in the declaration part my SFC POU ?
Regards
You have to do both. Check the box for use and declare in element properties and declare the SFC-Flags you want to use as input.
By the way I was wrong My current version is 3.1 SP3 Patch 2 so it is one patch newer than yours.
I've tried again with the declaration & the validations in the properties but i still have the same message "SFCInit" is no input of mySFC.
What's wrong ? is there a correction in the Patch 2 ?
Regards
Hi bells,
could you post a project archive? I'll have a look for it. Maybee i can see whats wrong.
Regards
Ralph
In order to activate SFCInit for a SFC POU you must open the property window of SFC POU object (right button click over the POU name) and in the "SFC Configuration" tab click "Active" in SFCInit variable.
Also the declaration of input variable in the POU is needed:
VAR_INPUT
SFCInit : BOOL ;
END_VAR
Hi all,
I see this post is so old, but I have a question regarding SFC Configuration flags.
I can create an SFC Pou and, for instance, add SFCInit:BOOL; to the declaration text. But in order to use it, I have to check SFCInit flag from SFC Configuration window.
So, is it possible to configure flags from a python script?
Thanks!
Accessing the 'Use' flags directly is not possible, but you can export the POUs to PLCOpenXML and edit the flags there before reimporting.
https://forge.codesys.com/tol/scripting/snippets/5/
Thanks! That solves my problem.
If your question is about python scripting, then this thread is totally the wrong place π
Maybe you want to explain your problem in more detail in the "Engineering" forum.
But just in case, that I got your question right, here is a pointer:
simimar to read_value, you can do a write:
https://forge.codesys.com/tol/scripting/snippets/14/
Yep, but I don't think I can do a write to an SFC configuration property. Thanks by the way.