Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Ld/ fb Elements

The following is an example of a ladder diagram. The example shows a single ladder rung containing contacts, variables boxes, a coil, power rail and comment. Using the LD/ FB editor a number of different elements can be freely connected to create powerful ladder diagrams.

The same functionality could be achieved by writing the following function block diagram in the LD/ FB editor.

The diagrams show that both LD and FB diagrams can be written in the LD/ FB editor. In a sense, FB diagrams are ladder diagrams which don't use ladder elements.

The following elements are available for use in LD diagrams:

In this example a contact is enabled by a left power rail. If the contact was unconnected on its left, the diagram would fail to compile.

This example shows how an unconditional jump can be performed by connecting a jump to a left power rail. The power rail always enables the jump.

Function Block Example

In this example a CTU function block is being used to count rising edges on bit 0 of a variable called Clock%.

In this example a LT (less than or <) operator block is being used to set Result% to 1 if Value% is less than 12.34 and 0 otherwise.

Jump Example

The following is an example of the use of jumps in an LD/ FB diagram.

If a% has a value less than 10000, B% is cleared to 0. If a% is not less than 1000, B% is set to 1.

Return Example

In this example, if a% has a value > 1000 it is not incremented.

Box Example

In this example the value 1.2 is assigned to the floating-point variables Float1, Float2, Float3 and Float4 and the value 1 is asigned to MyInteger% (1.2 is converted to the value 1 by the INT block).

Corner Example

In this example, a constant value is being assigned to a variable. By adding a corner, the value 12 can be assigned to 2 or more variables.

Vertical Connection Example

In this example, the values of 3 contacts are being ORed and the result is set in a coil.

Link Example

This example shows how a link between two variable boxes is used to assign the value of the first variable to the second.

In this example, the links are used to assign the values/ outputs of contacts and constants to function block inputs.

Link with Negation Example

This example shows how a negated link can be used to invert or negate a value before assigning it to another variable.

See Also

  • LD (Ladder) and FBD (Function Block Diagram) Reference

  • LD/ FB Coil Types

  • LD/ FB Contact Types

________________________________________________________________________________

Ld/ fb Coil Types

The following types of coils are available for use in LD/ FB diagrams:

See Also

  • LD (Ladder) and FBD (Function Block Diagram) Reference

  • LD/ FB Elements

  • LD/ FB Contact Types

________________________________________________________________________________

Ld/ fb Contact Types

The following types of contacts are available for use in LD/ FB diagrams:

See Also

  • LD (Ladder) and FBD (Function Block Diagram) Reference

  • LD/ FB Elements

  • LD/ FB Coil Types

Ld/ fb Order of Execution

LD/FBD diagrams are always executed from left to right and from top to bottom. This is demonstrated in the following example.

In this example, the diagram is executed in the following order:-

1. V4% is assigned the value 1.

2. V2% is assigned the value 100.

3. V4% is assigned the value of V2%.

4. V5% is assigned the value of V2%.

5. V2% is subtracted from V4% and the result placed in V6%.

Note:

The default order of execution of elements on a diagram can be changed using jumps and returns.

See also:

  • Jump Example

  • Return Example

  • LD (Ladder) and FBD (Function Block Diagram) Reference

  • LD/ FB Elements

________________________________________________________________________________