SFC in Mitsubishi plc

3 posts in this topic

i have a question about SFC , if the step is active then processor execute code inside this step and writes on outputs true or false , then when the step deactivated the processor won't execute the code inside the step and won't write true or false on outputs. this means if output Y1 becomes true in activated step then it will remain true after deactivation , right ?

in this picture if S41 is active , then M77 becomes true , then S43 becomes active , and S41 isn't active , then M77 will remain true and the processor won't execute S41 , or will becomes false then processor stops executing S41 .


Share this post

Link to post
Share on other sites

Hello m.rahmy,

To implement the SFC by using stepladder in FX you must combine the usage of S type bits with STL instruction. The way it's programmed in your example will not work as SFC.

As I'm answering from my cellphone, I cannot take a picture from GXW2 so, I will try to represent using text (if not clear, please ask again I will answer tomorrow):

To work as an SFC, your ladder must be programmed like this:


1 --| |---------------------------[SET S41]


2 --------------------------------[STL S41]


3 --| |------------------------(M50)


4 --| |------------------------[SET S42]

5 --------------------------------[STL S42]


6 --| |------------------------(Y1)

7 --------------------------------[ RET ] 

Ok! Line 1 runs all the time because it's not under any previous STL instruction. Consider the first STL instruction is on line 2 from the beginning of the program.

Considering initial state S41 and S42 off, M50 and Y1 are off two because they depend on some of those states to be active. 

Now, let's consider X1 turns on. Then, S41 state becomes active so, lines 1 to 4 are being processed (every line between the current STL active until and before next STL (S42) will become active and being processed). At this moment, as S41 is active and M8000 is always on, M50 now go on and stay like this, as long as S41 is active.

Now, let's consider after a while, M78 goes on. Now, S41 goes automatically off (because of STL working way, no need to reset it) and S42 goes on. Lines 1 to 4 become inactive, so M50 also goes off. Because of STL S42 active, now lines 5 to 7 (RET instruction delimit the last STL region) become active, so Y1, that was off previously, becomes on.

This is basically how SFC in ladder - stepladder - works on FX PLC.

Hope it helps!








Share this post

Link to post
Share on other sites

SFC in step-ladder can be confusing at first as there are things you can do and things you can't.

But it's very easy to program a sequence - and easy to fault find as the problem will only be in the active step.

Take for instance the drawing below:

In STL step 20, you can put an output coil direct from the left vertical bar - but you can't put a timer like that?

If you want Y0 to still be on in STL S30, you have to have to program it in again. It ignores the double coil as STL 20 is now not scanned.

If you do not put the line -----------------------------------[STL S30} before a step, the S bits will be treat like normal M bits

And you mark the end of the STL routine with ------------------------------------[RET]



1 person likes this

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now