24.01.2015 Views

PLC Programming

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Languages...<br />

is stored in the branch on the outer right. No further timeout will be registered if a timeout occurs and<br />

the variable SFCError is not reset again.<br />

SFCErrorAnalyzationTable: This variable of type ARRAY [0..n] OF ExpressionResult provides the<br />

result of an analyzation of a transition expression. For each component of the expression, which is<br />

contributing to a FALSE of the transition and thereby to a timeout of the preceeding step, the following<br />

information is written to the structure ExpressionResult: name, address, comment, current value.<br />

This is possible for maximum 16 components (variables), thus the array range is max. 0..15).<br />

The structure ExpressionResult as well as the implicitely used analyzation modules are provided with<br />

the library AnalyzationNew.lib. The analyzation modules also can be used explicitely in other POUs,<br />

which are not programmed in SFC.<br />

It is a pre-condition for the analyzation of a transition expression, that a timeout is registered in the<br />

preceeding step. So a time monitoring must be implemented there and also the variable SFCError<br />

(see above) must be defined in the declaration window.<br />

SFCTip, SFCTipMode: This variables of type BOOL allow inching mode of the SFC. When this is<br />

switched on by SFCTipMode=TRUE, it is only possible to skip to the next step if SFCTip is set to<br />

TRUE. As long as SFCTipMode is set to FALSE, it is possible to skip even over transitions.<br />

Alternative branch<br />

Parallel branch<br />

Jump<br />

Two or more branches in SFC can be defined as alternative branches. Each alternative branch must<br />

begin and end with a transition. Alternative branches can contain parallel branches and other<br />

alternative branches. An alternative branch begins at a horizontal line (alternative beginning) and ends<br />

at a horizontal line (alternative end) or with a jump.<br />

If the step which precedes the alternative beginning line is active, then the first transition of each<br />

alternative branch is evaluated from left to right. The first transition from the left whose transition<br />

condition has the value TRUE is opened and the following steps are activated (see active step).<br />

Two or more branches in SFC can be defined as parallel branches. Each parallel branch must begin<br />

and end with a step. Parallel branches can contain alternative branches or other parallel branches. A<br />

parallel branch begins with a double line (parallel beginning) and ends with a double line (parallel end)<br />

or with a jump. It can be provided with a jump label.<br />

If the parallel beginning line of the previous step is active and the transition condition after this step<br />

has the value TRUE, then the first steps of all parallel branches become active (see active step).<br />

These branches are now processed parallel to one another. The step after the parallel end line<br />

becomes active when all previous steps are active and the transition condition before this step<br />

produces the value TRUE.<br />

A jump is a connection to the step whose name is indicated under the jump symbol. Jumps are<br />

required because it is not allowed to create connections which lead upward or cross each other.<br />

2.2.4 Function Block Diagram (FBD)...<br />

The Function Block Diagram is a graphically oriented programming language. It works with a list of<br />

networks whereby each network contains a structure which represents either a logical or arithmetic<br />

expression, the call of a function block, a jump, or a return instruction.<br />

2-20 CoDeSys V2.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!