MCFB_StepLimitSwitch

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - HomingClosed The Homing procedure allows, based on a position measurement, to set a position offset to the motor in order to ensure it is physically at the home position to a limit switch.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

Request the homing step procedure at the rising edgeClosed A rising edge is the transition of a digital signal from low to high. It is also called positive edge.

Outputs are reset when execute input is FALSE.

AxisID

AXIS_REF

1, 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

See AXIS_REF Structure for more information.

Direction

BOOL

0, 1

N/A

No default

Defines the axis homing direction.

  • 0 (zero) = Clockwise rotation.
  • 1 = Counterclockwise rotation.

LimitSwitchMode

DINT

0, 3

N/A

No default

Limit switch state to complete homing.

  • 0 (zero) = Switch is on.
  • 1 = Switch is off.
  • 2 = Rising edge of switch.
  • 3 = Falling edge of switch.

Velocity

LREAL

No range

User unit/sec

No default

Commanded velocity for the homing move.

Acceleration

LREAL

No range

User unit/sec2

No default

Commanded acceleration for the homing move.

Deceleration

LREAL

No range

User unit/sec2

No default

Commanded deceleration for the homing move.

JerkClosed In physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time

LREAL

No range

User unit/sec3

No default

Commanded jerkClosed In physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time for the homing move.

If 0 (zero), trapezoidal acc/dec is used.

TorqueLimit

LREAL

No range

User units

No default

Maximum torqueClosed Torque is the tendency of a force to rotate an object about an axis. Just as a force is a push or a pull, a torque can be thought of as a twist applied for the homing move.

  • Entered in thousandths of maximum torque.
  • Example: 250 is 250/1000, or 25%.

TimeLimit

TIME

No range

Sec

No default

Maximum time for homing move to complete.

  • If exceeded, the homing procedure errors out.
  • 0 (zero) = no time limit.

DistanceLimit

LREAL

No range

User units

No default

Maximum distance for homing move to complete.

  • If exceeded, the homing procedure errors out.
  • 0 (zero) = no distance limit.

LimitSwitch

BOOL

0, 1

N/A

No default

The limit switch input I/O point.

BufferMode

SINT

0, 5

N/A

No default

Define the homing move start action.

  • 0 = Abort.
  • 1 = Buffer.
  • 2 = Blend to active.
  • 3 = Blend to next.
  • 4 = Blend to low velocity.
  • 5 = Blend to high velocity.
  • See Buffer Modes for more information.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

 

N/A

Indicates the move completed successfully.
The Command Position has reached the endpoint.

Busy

BOOL

 

N/A

High from the moment the Execute input goes high until the time the move is ended.

Active

BOOL

 

N/A

Indicates this move is the Active move.

CommandAborted

BOOL

 

N/A

Indicates the move was aborted.

Error

BOOL

 

N/A

Indicates either:

  • An invalid input was specified.
  • The move was terminated due to an error.

ErrorID

INT

 

N/A

Indicates the error if the Error output is set to TRUE.

Error identifier:

ErrorID

Description

1

TimeLimit exceeded.

2

DistanceLimit exceeded.

3

TorqueLimit exceeded.

4

Axis error stop state.

5

Axis not enabled.

6

Invalid inputs for Velocity-Acceleration-Deceleration.

Remarks

  • Performs a single-axis home to a limit switch.
  • The limit switches are used for homing procedure.
    • They are always active once moving part working area has been surpassed.

This image shows the function or function block I/O.

MCFB StepLimitSwitch

Figure 6-101: MCFB_StepLimitSwitch

Usage

FBD Language Example

UDFB StepLimitSwitch: FBD example

FFLD Language Example

UDFB StepLimitSwitch: LD example

IL Language Example

Not available.

ST Language Example

PositiveDirection :=0;
RisingEdge :=2;
Velocity :=10000.0;
TorqueLimit :=50.0;
TimeLimit :=T#10s;
DistanceLimit :=10000.0;

Inst_MCFB_StepLimitSwitch( True, Axis1, PositiveDirection, RisingEdge, Velocity, 1000, 1000, 0, TorqueLimit, TimeLimit, DistanceLimit, LimitSwitch, 0 );

HomeComplete :=Inst_MCFB_StepLimitSwitch.Done;
HomeBusy :=Inst_MCFB_StepLimitSwitch.Busy;
HomeActive :=Inst_MCFB_StepLimitSwitch.Active;
HomeAborted :=Inst_MCFB_StepLimitSwitch.CommandAborted;
HomeError :=Inst_MCFB_StepLimitSwitch.Error;
HomeErrorID :=Inst_MCFB_StepLimitSwitch.ErrorID;

(* LimitSwitch is a declared I/O point *)

See Also