• No results found

Creating a Function Blocks sequence

In document EasyPLC User Manual.pdf (Page 45-51)

Next an example about how to create a Function Blocks sequence is showed.

Create a new Main Function Block sequence (view page 18).

First make click in the tool bar Condition Block, then the mouse cursor will change to a cross shape, then make click in the F.B. programming area where you want to place the block. One placed, the F.B. wizard window will show in order to choose the variable associated with this block, make double click in the variable name you want to use.

Now, create other condition block and select a numeric type variable (DelayTime in the example is float type), then automatically the condition operation is filled.

As you can see by default the condition is that DelayTime will be equal to zero, if you want to change the condition, click in the block and make mouse right click, a contextual menu will appear, then click Set Operation in order to change the condition operation.

Next, add a AND Block, selecting it form the tool bar.

The following operations will be to wire the two condition Blocks with the AND Block.

To do it click on the first created Block, and make mouse right click, select Connect Out form the contextual menu, then the mouse cursor will change indicating that we are in edition connection mode.

If the connection to the element on which the cursor is located is not possible, the cursor will have an icon shaped like a prohibition, if the connection is allowed, the icon will have a hand. If you click on the F.B empty area the block will exit from the connection edition mode and will not be connected.

Following the example, click on the AND Block, then the NewInput condition block will be connected with one input of the AND Block.

Repeat the same process for DelayTime condition Block.

Now we are going to add an Action Block, to do it make click in the tool bar action block and place it in the programming area.

Then select a Boolean variable (for example a digital output).

Then make mouse right click and select from the contextual menu, Connect In, then click the AND Block.

We have written your first Function Blocks sequence!.

This program will work in the following way: if the digital input associated to the variable name NewInput is true, and the variable DelayTime is greater than ten, the digital input associated with the variable MotorOn will be activated, else will be deactivated.

Clicking in the Assign Variable contextual menu Blocks is possible to change the associated variable. Clicking in the Set Operation is possible to change the condition operation (for Condition Blocks) or the action operation (for Action Blocks).

For Boolean variables there’s no possibility to change the operation because for condition blocks always will be checked the true condition and for Action Blocks the action to make will be to assign true or false state, in function if is activated or not.

Pay attention at the Activate by trigger / Activate by Level contextual menu items of Action Blocks.

If Level mode is selected, the Action Block will be executing the action each scan loop of the PLC, while their input is true.

If Trigger mode is selected, the Action Block executes the action once (the first time their input is true).

Probably for the next example, you wish the auto increment of the variable Value, will be done once, then you must to select Trigger mode for the Action Block.

The Set/Reset Action Blocks are more flexible because allow to set/reset boolean variables and take out the result in their output.

In the following example, if variable NewInput is true, MotorOn variable will be set to true, also variable Data5 will be matched to three. If variable T2 is equal to zero, MotorOn variable will be set to false.

Condition and Action Blocks allows to use internal PLC functions and Plugins, in order to select it, click on the wizard window help button, here you can see help syntax examples, access to variables, functions and plugins. Make double click on the desired name to be automatically added.

In order to delete connections between blocks make click in the wire you want to delete, then will be marked in yellow color. Now press Delete Block/Connection tool bar button.

2.4.4 Grafcet

The GRAFCET (Graph of Control of Steps of Transitions) it is a normalized functional diagram that allows to make a model of the process to automate, contemplating inputs, actions to carry out, and the intermediate processes that cause these actions. It is not a language, is a design type to elaborate the pattern thinking of the direct execution of the automatism.

The Grafcet Level is compound of Steps and Transitions, the steps and transitions can be programmed in Ladder, Script or Function Blocks languages.

The Grafcet Levels are compound by the following elements:

• Initial Step: is activated when the level starts by first time, at least one initial step must be present.

• Step: is a subprogram that is executed continuously while their associated transition is false.

• Transition: is the condition that must be true to allow the pass to the next connected step.

• Structural Parallelism: allows to execute simultaneously all the connected steps to their output. For the Parallelism actives their outputs its necessary that all theirs inputs conditions must be true, this is, all the process that the Parallelism has been launched, must been ended to allow their finalization.

• In a Grafcet level can exist all diagrams you need.

Rules that a Grafcet Level must perform:

• At least an initial step should exist, (can be more than one).

• In a step output (normal or initial) a transition should always be connected.

• It is not possible to connect two transitions together or two stages together.

Available tools in Grafcet programming:

• Add Initial Step: adds an initial step.

• Add Step: adds a new step.

• Add Transition: adds a new transition.

• Add Parallelism: add a new structural parallelism.

• Add Label: add a label for documentation porpoises.

• Zoom in.

In document EasyPLC User Manual.pdf (Page 45-51)

Related documents