Function Block FB_CylinderPLCopen motion iconPipe Network motion icon

Description

This function block can be used to control a cylinder and the Limit Switches.

There are two inputs InA and InB to set the direction of the movement and the belonging LimSwitches LsA and LsB.

If InA is set to TRUE the output DirA is set to TRUE and after a time value defined by CtrlTime the LsA has to become TRUE otherwise a fault FaultLsA appears. Just as in direction B.

If both LsA and LsB are TRUE then a Fault depending of the output is set. If both InA and InB are given (e.g. to stop the cylinder movement) no limit switch is controlled.

All faults can be reset by input iResetFault.

Arguments

Input

iInA

Description

Set direction A

 

Data type

BOOL

iInB

Description

Set direction B

 

Data type

BOOL

iLsA

Description

Limit Switch at End of direction A

 

Data type

BOOL

iLsB

Description

Limit Switch at End of direction B

 

Data type

BOOL

iCtrlTime

Description

Max Time till Lim.Sw. has to be reached

 

Data type

TIME

iResetFault

Description

Reset Fault (Is set to FALSE by UDFBClosed"User Defined Function Block" UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB!)

 

Data type

BOOL

Output

oDirA

Description

Direction A

 

Data type

BOOL

oDirB

Description

Direction B

 

Data type

BOOL

oFaultLsA

Description

Fault of Lim.Sw. at End direction A

 

Data type

BOOL

oFaultLsB

Description

Fault of Lim.Sw. at End direction B

 

Data type

BOOL

Usage

The signal flow is valid for both directions (A and B)

If oDirA AND oDirB are active there is no Fault Control.

The Fault can be reset by iRestFault = True.

 

Example

ST

//Electric Cylinder with limit switch controls
Inst_FB_Cylinder( dirA, dirB, LimitSwitchA, LimitSwitchB, CtrlTime, ResetFault );
A := Inst_FB_Cylinder.oDirA;
B := Inst_FB_Cylinder.oDirB;
FaultLimitSwitchA := Inst_FB_Cylinder.oFaultLsA;
FaultLimitSwitchB := Inst_FB_Cylinder.oFaultLsB;

Function Block Diagram

UDFB Cylinder: FBD example

FFLD

Go back to the top of the page [Top]