-

MC_StepLimitSwitch

Image
This function Block performs a homing function and sets the position by searching for a limit switch. Logic is built-in to account for cases in which the limit is already hit.

Parameters

* Parameter Data Type Description Default
VAR_IN_OUT
B Axis AXIS_REF Logical axis reference. This value can be located on the Configuration tab in the Hardware Configuration (logical axis number).
VAR_INPUT
B Execute BOOL Upon the rising edge, all other function block inputs are read and the function is initiated. To modify an input, change the value and re-trigger the execute input. FALSE
E Direction MC_Direction Specifies the direction of the motion and corresponding limit switch to search for :
• PositiveDirection = Positive direction searching for the positive limit switch (P-OT signal) • NegativeDirection = Negative direction searching for the negative limit switch (N-OT signal)
‘Direction’ is automatically reversed from limit switch initial state.

MC_Direction#PositiveDirection
E LimitSwitchMode MC_SwitchMode Sensor condition to finalize MC_StepLimitSwitch. Only MC_SwitchMode#EdgeOn is supported. MC_SwitchMode#EdgeOn
E Velocity LREAL Absolute value of the velocity in user units/second. LREAL#0.0
E
SetPosition
LREAL After performing the limit switch search, this is the position to set the Axis to. A positive or negative value within the coordinate system in user units.
Not Used
E
SetPositionMode
BOOL ABSOLUTE = False (Default), RELATIVE =True. This refers to the coordinate system, not the motor type.
FALSE
E TorqueLimit LREAL Maximum torque or force [in % of rated torque].The amplifier's Torque Limits (Pn402 and Pn403) will override the torque limit set by this value if they are lower than the TorqueLimit setting. LREAL#100.0 (100% of rated torque)
E TimeLimit LREAL Time limit for homing to complete (in seconds). Value of LREAL#0.0 sets no time limit. LREAL#0.0
E DistanceLimit LREAL Maximum distance the axis can travel in search of home sensor. Value of LREAL#0.0 sets no distance limit. LREAL#0.0
E BufferMode MC_BufferMode Defines the behavior of the axis - allowable modes are Aborting, Buffered, BlendingLow, BlendingPrevious, BlendingNext, and BlendingHigh. MC_BufferMode#Aborting
VAR_OUTPUT
B Done BOOL The Done output is set to TRUE when the commanded action has completed successfully. If another function block takes control before the action is completed, the Done output will never become TRUE. This output is reset when Execute becomes FALSE.
E
Busy
BOOL Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error)
E
Active
BOOL For buffered modes, this output is set high at the moment the block takes control of the axis. For non buffered modes, the outputs Busy and Active have the same value.
E
CommandAborted
BOOL Set high if motion is aborted by another motion command or MC_Stop. This output is cleared with the same behavior as the Done output.
B
Error
BOOL Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low.
E
ErrorID UINT If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low.



Notes

Error Description

See the Function Block ErrorID List

Example 1

MC_StepLimitSwitch executed on Axis1.

Image

The Logic Analyzer trace for the above program is shown below:



 


This help information is valid for iCube Engineer Online Help 2025.6

Copyright © 2025 YASKAWA EUROPE GmbH and © 2025 YASKAWA America, Inc.