MLFB_HomeFindHomeFastInputModulo

Pipe Network motion icon

 Function Block - Fast homing to a home switch: Modulo mode.

  • Performs a single-axis home to a limit switch connected to a High Speed Input.
  • This function is used when the axis is set-up in Modulo mode.
  • The motor starts to move according to the direction setting.
    • The home position has been found as soon as the fast input selected is triggered on the edge selected.
  • An absolute move is made to the triggered position and the position value is set.
    • The hardware limit switches are monitored during the homing procedure.
  • The drive behaves this way in case a hardware limit switch is active before the home-switch has been activated:
    The motor changes the direction until the home switch is crossed.

Usage

  • This procedure performs a homing function searching for a sensor using only High Speed Input Switches.
    • A High Speed Limit Switch has 1 Off (or On) area.
  • Home is commanded by the user in the designated homing direction at the selected or programmed Velocity.
  • If LimitSwitch is found On with a rising Execute, the process is started in the opposite direction as specified.
  • If LimitSwitch is found Off Edge (released), the process is restarted again in original direction.
    This can be On, depending on LimitSwitchMode setting.
    • This ensures the end conditions are always the same.
  • The Timeout can cause an error if exceeded.

Figure 1: MLFB_HomeFindHomeFastInputModulo Usage 1

Figure 2: MLFB_HomeFindHomeFastInputModulo Usage 2

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

ibExecute

BOOL

0 to 1

N/A

No default

Request the homing step procedure at the rising edge.

iAxisID

AXIS_REF

1 to 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

See AXIS_REF Structure.

iPosition

LREAL

No range

User units

No default

Offset position applied after home switch is found.

ibDirection

BOOL

0 to 1

N/A

No default

Defines the axis homing direction.

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

iVelocity

LREAL

No range

User units / sec

No default

Commanded velocity for the homing move.

iAcceleration

LREAL

No range

User units / sec2

No default

Commanded acceleration for the homing move.

iDeceleration

LREAL

No range

User units / sec2

No default

Commanded deceleration for the homing move.

ibLimitSwitchMode

BOOL

0 to 1

N/A

No default

Limit switch state to complete homing.

  • 0 (zero) = Rising edge of switch.
  • 1 = Falling edge of switch.

ibPosLimitSwitch

BOOL

0 to 1

N/A

No default

The positive direction limit switch input I/O point.

ibNegLimitSwitch

BOOL

0 to 1

N/A

No default

The negative direction limit switch input I/O point.

iTimeout

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.

ibFastInputNumber

BOOL

0 to 1

N/A

No default

Limit switch state to complete homing.

  • 0 (zero) = Fast Input Number 1.
  • 1 = Fast Input Number 2.

iCycleTime

LREAL

No range

Microseconds

No default

EtherCAT cycle time.

Either 250, 500, or 1000.

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

obDone

BOOL

FALSE, TRUE

N/A

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

obActive

BOOL

FALSE, TRUE

N/A

Indicates this move is the Active move.

obError

BOOL

FALSE, TRUE

N/A

Indicates either:

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

oErrorID

DINT

 

 

N/A

Indicates the error if Error output is TRUE.

Error identifier:

ErrorID

Description

1

Axis in error.

2

Axis is not enabled.

3

Timeout exceeded or expired.

4

SDO read / write error.

5

Input parameter out of range.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

Direction:= 0;
Position:=1000;
Velocity:=1000;
Acceleration:=10000;
Deceleration:=10000;
SwitchMode:=0;
Timeout:=T#100;
FastInputNumber:=0;
CycleTime:=1000;

inst_fbHomeFindHomeFastInputModulo(True, Axis1, Position, Direction, Velocity, Acceleration, Deceleration, PosLimitSwitch, NegLimitSwitch, Timeout, FastInputNumber, CycleTime);

HomeComplete :=inst_fbHomeFindHomeFastInputModulo.Done;
HomeActive :=inst_fbHomeFindHomeFastInputModulo.Active;
HomeError :=inst_fbHomeFindHomeFastInputModulo.Error;
HomeErrorID :=inst_fbHomeFindHomeFastInputModulo.ErrorID;

(* PosLimitSwitch and NegLimitSwtch are declared I/O points *)

See Also