Programming in IEC61131-3

T

Thread Starter

Tony

I am very new to using IEC61131 and I wish to control a process which has 4 distinct states. The transitions between states are complex mathmatically but clearly defined and so an SFC approach seems most appropriate.

My problem is that I want to be able to stop the process at any time either by a PLC input or when an abnormal condition ocurrs and it isnt immediately obvious to a newbie how best to do this.

As a side issue, does the PLC run the code for all the transitions all the time. Mine involve a lot of maths and could place an unnecessary burden on the system.

TIA
Tony
 
Would it be possible to see a little more information on your application and your how a fault impacts the system? The PLC that you are using or plan to use etc.

my email is [email protected]
 
J

Jeremy Pollard

Hey Tony - create a separate task that runs simultaneously with the SFC chart. This is what you should do for alarms and asynchronous interfacing anyway.

Once conditions arise, you can stop the execution of the chart totally. Be sure to not use retentive outputs.

In an SFC only the current step and transition are being executed. Like a subroutine the other steps will only execute when called in the sequence.

Cheers from: Jeremy Pollard, CET The Caring Canuckian! www[.]tsuonline.com

Control Design www[.]controldesignmag.com
Manufacturing Automation www[.]automationmag.com

3 Red Pine Court, RR# 2 Shanty Bay, Ontario L0L 2L0
705.739.7155 Cell # 705.725.3579
 
M

Michael Griffin

You can design the program on paper using SFC or state diagrams and program it in some other language (e.g. ladder logic). This is not an unusual practice (at least for people that actually design their programs rather than just poke away at them randomly).

As for being able to stop the process, if the process is at all stoppable then I don't see why this presents a problem. Either the 4 states you define include this "stopped" state, or there are some states and transitions you haven't accounted for. To put it a bit differently, the SFC or state diagram should account for *all* the possible states, including shut down, start up, stand by, running, manual, etc. When viewed that way, monitoring a PLC input or meeting certain other conditions are just more transition definitions.

As for the system load on the PLC, you only need to perform the calculations which are relevant to the transitions which are legal for the current state or step. Transitions which are not possible for that state or step or which cannot otherwise be performed do not have to be calculated.

If you use programming software which allows you to draw a diagram and which then writes the PLC code for you (possibly in IL), then you might not have much control over when the calculations are performed (and so may cause the system load problem you are concerned with). If you draw the SFC or state diagram on paper and transform them to ladder (or IL) manually, then you have complete control over what calculations are performed when.

As an additional point, I am not familiar with your process but it is possible a state diagram would give you a better representation of your process than an SFC chart. An SFC is better for single and parallel sequences with very little branching; in other words the diagram is fairly long and narrow with the transitions being mainly in one direction. A state diagram is better for applications which may branch out in many alternate directions; in other words the diagram is as wide as it is long with the transitions branching out in all directions.
 
Top