MCFB_StepAbsSwitchFastInput

PLCopen motion icon

 Function Block - Fast homing to a home switch.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

Request the homing step procedure at the rising edge.

Outputs are reset when execute input is FALSE.

AxisID

AXIS_REF

1 to 256

N/A

No default

Structure for specified Axis designated to home.

See AXIS_REF Structure.

Direction

BOOL

FALSE, TRUE

N/A

No default

Defines the axis homing direction.

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

SwitchMode

DINT

0 to 3

N/A

No default

Switch state to complete homing.

  • 0 (zero) = Rising edge of sensor.
  • 1 = Falling edge of sensor.
  • 2 = Rising edge when traveling in positive direction but falling edge in negative direction.
  • 3 = Falling edge when traveling in negative direction but rising edge in positive direction.

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.

Jerk

LREAL

No range

User unit/sec3

No default

Commanded jerk for the homing move.

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

TorqueLimit

LREAL

No range

User units

No default

Maximum torque 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.

FastInputNum

BOOL

FALSE, TRUE

N/A

No default

  • 0 (zero) = first fast input (X7 pin 10).
  • 1 = second fast input (X7 pin 9).

PosLimitSwitch

BOOL

FALSE, TRUE

N/A

No default

The positive direction limit switch input I/O point.

NegLimitSwitch

BOOL

FALSE, TRUE

N/A

No default

The negative direction limit switch input I/O point.

BufferMode

SINT

0 to 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.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

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

Busy

BOOL

FALSE, TRUE

N/A

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

Active

BOOL

FALSE, TRUE

N/A

Set when the function block is active.

CommandAborted

BOOL

FALSE, TRUE

N/A

Indicates the move was aborted.

Error

BOOL

FALSE, TRUE

N/A

Signals an error has occurred within the function block.

ErrorID

INT

Enumerated

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.

TriggerPosition

LREAL

No range

User units

 

Remarks

  • Performs a homing function by searching for an absolute positioned external physical switch.
    • The switch must be connected to one of the two fast inputs on the Axis' AKD drive.
  • An Absolute Switch has two Off (or On) areas.

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

Figure 1: MCFB_StepAbsSwitchFastInput

Usage

  • The homing is commanded in the most likely direction where the sensor can be found.
  • If any LimitSwitch is found during Homing (any of them), a special process is started in the opposite direction.
    • The AbsSwitch is searched to switch Off (or On, depending on SwitchMode setting).
  • The Edge (passed by) and homing process is restarted in the original direction and with the same conditions.
    • This ensures the end conditions are always the same.

Figure 2: MCFB_StepAbsSwitchFastInput Usage 1

Figure 3: MCFB_StepAbsSwitchFastInput Usage 2

FBD Language Example

FFLD Language Example

PosLimitSwitch, NegLimitSwitch are declared I/O points.

IL Language Example

Not available.

ST Language Example

Execute_1 :=1;
(*Positive_Switch and Negitive_Switch are physical hardware in Dictionary. *)

Inst_MC_StepAbsSwitchFastInput( Execute_1, Axis1, 0, 0, 10000.0,Acceleration:=10000.0, 10000.0, 0, 0, 0, 0, 0, Positive_Switch , Negitive_Switch , 0)

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

See Also

MCFB_StepLimitSwitchFastInput