elllo
Hi,
 
I am trying to build a PLC program using SFC structure. I was wondering what is the difference between the types Inline, Variable and Action ? And how do I create an Action ?
 
I understand that the modbus coil or register attached to a state will be sent only when the corresponding state is reached. For example, if I want to set a modbus coil to 1 when I reach a particular state (say the state "GoRight" and the modbus coil variable name is "M_right"), then I do how the screenshot below. Is my implementation right ? and could it be a more efficient way of doing this ? For the moment, I use the variable type (is Action or Inline better ?) but I would also like to switch the "M_right" variable to 1 when I reach the state "GoRight" and turn it to 0 when I leave the state. (See 2 different implementations below, the second does not compile tho)
 
Also does the modbus send these variables periodically or does it wait for the program to reach the state ? I assume it does not wait but not sure.
 
[203128%2F9037192%2Fmceclip0]
 
Reply 0 0
thiagoralves
This video is a great introduction about IEC 61131-3 and SFC programming in general: https://www.youtube.com/watch?v=xCONAyL4Oow
 
In essence, you can do the output activation and logic for the state using actions as action block, inline code, or just plain variable assignment with the correct qualifier. Action blocks and inline code allows you to create more logic than simply turning outputs on and off. But for the most cases, simply turning outputs on and off is what you need, so you can simply use just variables in the state action and you will be fine. For the modifiers that can go on a variable, this is an interesting resource to learn more: https://www.fernhillsoftware.com/help/iec-61131/sequential-function-chart/sfc-step.html
Reply 0 0
Reply