Sign in to follow this  
Followers 0
Tim Jackson

Problem when restarting a SFC POU in GX IEC Developer

5 posts in this topic

Edit: The simple version of my problem: My SFC program ends up being in two states at the same time if I turn the PLC off then on again. Should this happen and how can I stop it? I am porting and updating a machine control program for a FX3U PLC from GX Developer to GX IEC Developer (7.01). It looks as though large chunks of it would be ideal as SFC POU's, partly so I can stop the machine part way through a cycle and restart from where it left off (by switching the parent task on and off). I wrote a test program to see how SFC behaves when used in this way (see the attached project) but came across a couple of problems: When I turned off the task, the SFC POU stopped running (eg would not step to the next step if the conditions were met) but any coils it was outputting stayed on. I found that to stop this it is possible to tick the box in the Task properties that says 'Timer/ Output Control'. So far so good. Now when I turn off the Task, all associated coils go off; when I turn the task on again the program continues from the step I stopped it on. Perfect. But then there's problem 2: if I turn the PLC off and on again (or STOP then RUN) and restart the SFC Task, the initial step and the step I stopped it in are both active! That is, both of them are running and will allow transition to their respective following steps. This only stops when one 'instance' catches up with the other (gets to the same step) or when I use the SFC reset flag in the SFC POU properties. Should this happen? If not, what should I do about it? If it should happen, how can I get round it so when I start up, the program can start where it left off? (I would also want the operator to be able to reset the machine and not start where it left off, but I would use the SFC reset to achieve that) Any suggestions? How the project works: The 'Main' task contains a ladder POU which crudely toggles output Y10 (POU_on) on or off when there is an input on X11 The 'Switched' task is turned on or off by Y10 and contains an SFC POU which outputs Y0 at the intial step, Y1 at step1, etc. The transition conditions are input X1 to transition to Step1, X2 to transition to step 2 etc. When step 3 is reached input Y4 causes a jump back to the initial step. Input X0 (Reset) is the SFC reset so transfers control back to the initial step. I used step2 to test whether a PLS command operates again if a step is repeated (i.e. jumps back to itself after its transition.) It therefore outputs Y6 for 5 seconds at the start of this step. X10 causes this step to be repeated. This timed output confirmed that the PLS did happen again and also enabled me to see whether the step started at the beginning when the POU was stopped and restarted or whether it carried on from where it left off. Test.zip Edited by Tim Jackson

Share this post


Link to post
Share on other sites
Maybe the first time I've ever had to ask this, but could you provide a little "less" info?? Maybe just a short description of what your problem actually is??

Share this post


Link to post
Share on other sites
My SFC program ends up being in two states at the same time if I turn the PLC off then on again. Should this happen and how can I stop it?

Share this post


Link to post
Share on other sites
I'm really no expert on SFC programming, but it sounds strange that the program should en up in two states at the same time (this would break the "law of SFC"). I'm sorry but I really son't have any good suggestions to you and it seems like there's no one in the forum that have any good suggestions so maybe you should try your local Mitsu dealer.....!?

Share this post


Link to post
Share on other sites
Like Kaare, I can not boast of great programming experience in the SFC language, but a long ago learned this language and many times built a step ladder programs in STL. The situation itself is not surprising, it is natural, since the flags of steps are stored in nonvolatile memory area, and can be reset within the steps or within the initialization sequence. As far as remember, such a procedure in SFC is present, it determines what steps will be initially active, and what does not.

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
Sign in to follow this  
Followers 0