I usually use ST for most of my programming, but I am looking to use SFC for the machine sequence on my next project. The concept looks good, but now I have to handle (of course) the ALL STOP or ESTOP button. Must I create a transition in every step with a jump to ESTOP (would look ugly)? I am interested to see how others have handled this situation. Also, can I "reset" the whole SFC routine and force it back to the init state (sorry, I am used to state machine thinking).
Here is my simplistic machine sequence:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To stop an sfc in case of any gemma change state, I am using sfc_init variable to pass sfc to his init step.
I like a lot sfcs, but from my point of view is an old language which has not evolutioned to be oop.
If you look for grafcet or sfc examples you can see that in steps only siple booleans variables are setted or resetted.
From my point of view an step would have control his own transition. Now, in many cases, we need a global variable (global in sfc space) to set inside step to enable the step transition.
And I d like, to make the steps code reusable, that the method inside step knows which is the step which call him.
Imagine that you want to do an cnc iso translator. You could have an step with an fb_moveabsolute inside with his execute connected to one hipotetical steptimeqctive=0, and with his done connected to his hipotetical enable_transition.
In this case we only need transitions in case of alternative branching.
Someone could say why? For example: In one step you can enable a valb, and in the transition you can evaluate his limit switch. But using oop you can have an fb which controlls the cillinder using fb_moves (as an axe).
I am using sfcs in finals fbs, in which I dont use, normally, inouts, normally I give orders to others fb which controlls cillinders, axes...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-08-15
Originally created by: scott_cunningham
I agree that SFC is not my first choice, but my customer is using ladder normally and the goal is they should be able to make some adjustments on the code after the first layout. For this, I think SFC is not too hard of a jump. ST and a state machine is way too far of a jump and I will get push back. I am breaking pieces up anyway - in my example the "Cut" state simply pulses a VAR_OUTPUT "TriggerCut" which will be linked to a different POU to handle the fine details of linking to real output, signal conditioning, etc.
For the ESTOP, I maybe have some luck - their ESTOP simply cuts power to the machine. So I get an automatic SFC restart anyway.
What concerns me some is I only find simple SFC examples, but in real life I am not sure SFC can really do a whole machine control when I think about ESTOP and even simple things like a momentary push of the STOP button should cancel the index, or the auto cycle... so now I have two jumps from every state. I guess I have to program this response whether it is in ST and a state machine, SFC or CFC....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the customer is used to ladder, whey don't you just program in ladder? Then they are in the environment they are used to?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-08-15
Originally created by: scott_cunningham
The customer wants to see what the other languages can offer them. They are used to ladder because their previous platform only offered ladder. Some parts of the project are in ST and will stay that way, some parts could be in ladder, but I was hoping to see SFC in real use...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: scott_cunningham
I usually use ST for most of my programming, but I am looking to use SFC for the machine sequence on my next project. The concept looks good, but now I have to handle (of course) the ALL STOP or ESTOP button. Must I create a transition in every step with a jump to ESTOP (would look ugly)? I am interested to see how others have handled this situation. Also, can I "reset" the whole SFC routine and force it back to the init state (sorry, I am used to state machine thinking).
Here is my simplistic machine sequence:
Hi Scott.
To stop an sfc in case of any gemma change state, I am using sfc_init variable to pass sfc to his init step.
I like a lot sfcs, but from my point of view is an old language which has not evolutioned to be oop.
If you look for grafcet or sfc examples you can see that in steps only siple booleans variables are setted or resetted.
From my point of view an step would have control his own transition. Now, in many cases, we need a global variable (global in sfc space) to set inside step to enable the step transition.
And I d like, to make the steps code reusable, that the method inside step knows which is the step which call him.
Imagine that you want to do an cnc iso translator. You could have an step with an fb_moveabsolute inside with his execute connected to one hipotetical steptimeqctive=0, and with his done connected to his hipotetical enable_transition.
In this case we only need transitions in case of alternative branching.
Someone could say why? For example: In one step you can enable a valb, and in the transition you can evaluate his limit switch. But using oop you can have an fb which controlls the cillinder using fb_moves (as an axe).
I am using sfcs in finals fbs, in which I dont use, normally, inouts, normally I give orders to others fb which controlls cillinders, axes...
Originally created by: scott_cunningham
I agree that SFC is not my first choice, but my customer is using ladder normally and the goal is they should be able to make some adjustments on the code after the first layout. For this, I think SFC is not too hard of a jump. ST and a state machine is way too far of a jump and I will get push back. I am breaking pieces up anyway - in my example the "Cut" state simply pulses a VAR_OUTPUT "TriggerCut" which will be linked to a different POU to handle the fine details of linking to real output, signal conditioning, etc.
For the ESTOP, I maybe have some luck - their ESTOP simply cuts power to the machine. So I get an automatic SFC restart anyway.
What concerns me some is I only find simple SFC examples, but in real life I am not sure SFC can really do a whole machine control when I think about ESTOP and even simple things like a momentary push of the STOP button should cancel the index, or the auto cycle... so now I have two jumps from every state. I guess I have to program this response whether it is in ST and a state machine, SFC or CFC....
If the customer is used to ladder, whey don't you just program in ladder? Then they are in the environment they are used to?
Originally created by: scott_cunningham
The customer wants to see what the other languages can offer them. They are used to ladder because their previous platform only offered ladder. Some parts of the project are in ST and will stay that way, some parts could be in ladder, but I was hoping to see SFC in real use...
You Should use SFCFlags
You have flag for more or less every kind of action (Stop, Reset, Init, ...)