MC_TouchProbe

PLCopen motion icon

 Function Block - Arms a Fast Input and returns the latched position when the Fast Input event occurs.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

On the rising edge, request to arm the input to return the latched position.

Axis

AXIS_REF

1 to 256

N/A

N/A

Selects the axis the position is latched to.

TriggerInput

TRIGGER_REF

See Description.

N/A

No default

  • Sets up the mechanism on the controller for the capture input signal.
  • An instance of the TRIGGER_REF function must first be setup in the Project Dictionary, as seen here:
  • See Elements regarding Ranges.

WindowOnly

BOOL

FALSE, TRUE

N/A

No default

Enables a position latching window.

  • When this input is set, a window is defined by the FirstPosition and LastPosition inputs.
  • Any Fast Input event that occurs outside the window is ignored.
  • The first Fast Input event that occurs within the window latches the axis position.

FirstPosition

LREAL

No range

User units

No default

See the WindowOnly Description about how this input and the LastPosition input define the window.

  • This input is only applicable when the WindowOnly input is high.
  • If the WindowOnly input is low, this input is ignored.

LastPosition

LREAL

No range

User units

No default

See the WindowOnly Description about how this input and the FirstPosition input define the window.

  • This input is only applicable when the WindowOnly input is high.
  • If the WindowOnly input is low, this input is ignored.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

  • Function block has completed.
  • The RecordedPosition output is valid.

Busy

BOOL

FALSE, TRUE

N/A

Indicates the specified input is:

  • Arming or is armed.
  • Waiting for the trigger and recording of the position to occur.

CommandAborted

BOOL

FALSE, TRUE

N/A

Indicates the move was aborted.

A TriggerAbort function block has executed and canceled this function.

Error

BOOL

FALSE, TRUE

N/A

The function block has not completed successfully due to an error.

The ErrorID output indicates the type of error.

See PLCopen Function Block ErrorIDs.

ErrorID

INT

 

 

  • When the Error output is high, this output indicates the type of error.
  • When the Error output is low, this output is undefined.

RecordedPosition

LREAL

 

User units

  • When the Done output goes high, this output returns the latched position.
  • When the Done output is low, this output is undefined.

Elements

Remarks

  • This function or function block does not generate any motion.
  • See Function Blocks - General Rules about how inputs and outputs work.
  • This function block captures an axis position
  • When the Execute input transitions from low to high, the control requests the drive to arm its Fast Input to latch the axis position when a Fast Input occurs.
  • The Axis input specifies which axis's position to latch and the TriggerInput input specifies which Fast Input to use and whether to trigger on the rising or falling edge of the Fast Input.
  • When the Fast Input event occurs, the drive latches the axis's position.
    • This function block then returns the latched position at the RecordedPosition output and set the Done output high.
    • This process can be canceled with the AbortTrigger function block.
  • If the WindowOnly input is high, the FirstPosition input and the LastPosition input define a window in which a Fast Input is accepted.
  • Any Fast Input events that occur outside the window is ignored.

Example 1

If First Position ≤ LastPosition, the window in which a Fast Input is accepted is:

FastInputPosition ≥ FirstPosition AND FastInputPosition ≤ LastPosition

Example 2

If First Position > LastPosition, the window in which a Fast Input is accepted is:

FastInputPosition ≥ FirstPosition OR FastInputPosition ≤ LastPosition

This image shows the ladder diagram view of the MC_TouchProbe function block:

Figure 1: MC_TouchProbe

Fast Homing - Inputs

See these topics for more information:

Usage

This function block can be used to:

  • Perform registration
  • Determine the position of a product
  • Measure product length

Limitations

  • Both high speed inputs cannot be used at the same time.
  • The TrigMode option is only used by MC_TouchProbe.

FBD Language Example

Not available.

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* MC_TouchProbe ST example *)
TriggerInputRef.InputID := 1; //configure InputID
TriggerInputRef.Direction := 1; //configure Direction
TriggerInputRef.TrigID := 0; //configure TrigID
TriggerInputRef.TrigMode := 0; //Capture trigger based on distributed clock time
Inst_MC_TouchProbe( ArmProbe, Axis1, TriggerInputRef, FALSE,0.0, 0.0 );
//Inst_MC_TouchProbe is an instance of MC_TouchProbe function block
ProbeIsDone := Inst_MC_TouchProbe.Done; //store Done output into a user defined variable
ProbeValue := Inst_MC_TouchProbe.RecordedPosition; //store RecordedPosition output into a user defined variable

See Also

MC_AbortTrigger