SFC SoMachine CodeSys Question

Ok. So, I see where your confusion is. I am editing my response because I understood what you are trying to do and what is happening.

The qualifier is more of an attribute of the action itself , how it's explained in the help files sounds more like "qualifying" a step but it's not.

So, you are trying to enable the step 147 only if the boolean LoPro_moveFlag1 is TRUE. But how this works is different, when the step becomes active the "S0" is setting the boolean LoPro_moveFlag1 to TRUE . This boolean will remain TRUE even if the associated step becomes inactive.


Did I understand you right ? If yes, then you will have to rework your code to incorporate your logic .
 
This is a pretty stripped out program and I do reset the flags in below steps that aren't there. These are two axis's moving at the same time and I'm comparing two Global flags when the motions are done.

Simply put, If I set LoPro_Move_flag1 to true in step 147 and set Picker_Move_Flag1 in step 151 to true, why does the transition that just ands these two flags not become true depending on the location of the POU's in the task.

With that said I'm programing this with little PLC experience at all. Just the help files and a book so I'm sure somethings are obvious to most. :confused:

Hope that helps.
 
I don't see a problem when I run your test code. So, maybe you have to look further in the code to figure out where your issue lies. The task execution order of POUs is not the problem .

Check attached.

Test.jpg
 
Well I feel stupid. I didn't know you could simply AND to variables right in the transition itself by simply typing FLAG1 AND FlAG2. I thought you had to write some piece of code for it like in the entry step blocks\exit step blocks or another POU.

It's all part of learning I suppose!
 
I see what you are saying with the global variables used for the qualifiers. I have never come across this as I use internal vars for qualifiers if at all I do. Will have to ask CoDeSys to clarify this behavior .

I thought your actual code had some specific logic within each step 147 and 151 , if not then yes you can AND vars in the trans itself or even write code within the transition . You can even AND your vars within the step and use an output var for the trans . So many different ways !

SFC is pretty cool as long as one has spent some time designing the flowchart on paper to avoid running into major issues later on.
 
Last edited:
So just to confirm, I shouldn't be driving any IO global mapping (valves etc) with the action qualifiers? The qualifiers should just be calling action step programs that are declared in my SFC program?

Funny I had this machine running well like that! There's only 6 valves and 10 switches so it seemed so easy. :mad:
 
yes just call your step programs and nice switch on a valve by Setting not just a simple ladder command.
when a step is not active the internals of that step are not active so you can not see or set something.
io is with me always in separate ladder program
just all inputs in one long and the markers so i can see what is happening.
(i make visualalisations for this.
 
Ok I dug deeper. The qualifier is internally handled by the SFCActioncontrol function block.
This block can't be controlled in a user specified manner.
So,the behavior is correct because the variable which is linked to the action and defined in the GVL is treated like an action.

Checked attached.

(y)

SFCActionControl.jpg
 
Just to Clarify, This example from the book I've been "trying" to learn from are incorrect then? The example does drive boolean inputs\outputs with the qualifiers.

Grrr. Dumb book
 
The book is correct.Just that you can't access/control the qualifiers like a global variable can be accessed/controlled ( back to your original problem).
 
The page you see is not correct on the naming it should be %QX0.0
and not QB0.0
i am missing an init block in the top
but the program seems to be correct yes.
N means the action is done as long as the step is active etc.
D means the time before the step is left is 10 sec.
this is different from your transition but has the same function.
it is double, you can also make the trans just TRUE
 
you are doing something wrong with an assumption

if the step is not active the output is not controlled
so if the transition is true the steps are not active anymore.

they do appear as running but they are not.
all statuses of the bools are only checked once in a cycle.
 

Similar Topics

I want to initialize SFC with memory bit. my SFC name is a conveyor and the output address is conveyor.sfcint. while building the program, it...
Replies
0
Views
1,254
Running SoMachine v4.3 and writing a small program in SFC. I am stalling on how to comment my logic. I haven't been able to find a way to add...
Replies
1
Views
1,560
Hey. If you haven't already read me, first time I'm building a full project on Rockwell PLC. I started building the sequences last week and I...
Replies
3
Views
131
Hi all. I'm building my first Grafcet using Logix, but I started from another project. From what we usually do with other PLC's, I was expecting...
Replies
3
Views
161
I have a fanuc servo motor and drive that I salvaged from a lathe barfeeder that was headed for the dumps which I'm trying to see if I can get...
Replies
2
Views
157
Back
Top Bottom