Function BlockMC_TouchProbePLCopen motion icon

Description

This function block arms a Fast InputClosedThe inputs are taken into account at each cycle depending on the system periodicity (for example each millisecond). Under certain circumstances this can be insufficient when more accuracy is needed, or if a quick response is required from the system. To fill the gap, a drive may have some Fast Input connections (generally one or two). When an event happens that triggers a Fast Input (e.g. when a sensor sends a rising edge), the detection of a signal occurs faster (which can be 1000 times more accurate than the system periodicity). Then the timestamp associated with this input can be provided to the IPC to take corrective action and returns the latched position when the Fast Input event occurs. This function block causes no motion.

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.

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

FastInputPosition ≥ FirstPosition AND FastInputPosition ≤ LastPosition.

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

FastInputPosition >= FirstPosition OR FastInputPosition <= LastPosition.

The following figure shows the ladder diagram view of the MC_TouchProbe function block:

MC_TouchProbe

Figure 7-129: MC_TouchProbe

Arguments

For more detail on how inputs and outputs work, refer to PLCopen Function Blocks - General Rules

Input

Execute Description Enables execution
  Data type BOOL
  Range 0, 1
  Unit N/A
  Default
Axis Description Selects the axis for which the position is latched
  Data type AXIS_REF
  Range [1,256]
  Unit N/A
  Default
TriggerInput Description

Sets up the mechanism on the controller for the capture input signal.

  Data type TRIGGER_REF - an instance of the TRIGGER_REF reference function must first be setup in the Project Dictionary, as seen here.
  Elements

Capture Engine (drive capture engine to be used)

INT TriggerInput.InputID

0 = Touch Probe 1 / Capture Engine 0

1 = Touch Probe 2 / Capture Engine 1

Range is [0,1]

 

Trigger Direction (input signal’s edge to capture)

INT TriggerInput.Direction

1 = rising edgeClosedA rising edge is the transition of a digital signal from low to high. It is also called positive edge

2 = falling edge

Range is [1,2]

Axis Number (where input comes from)

INT TriggerInput.TrigID

0 = trigger axis is to be the same as Axis.AXIS_NUM.

Range is [0,256]

 

Trigger Mode (capture method)

INT TriggerInput.TrigMode

0 = time based capture

1 = position based capture. For position based capture the TrigID must be the same as the Axis_Ref.

Range is [0,1]

  Unit N/A
  Default
WindowOnly Description 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
  Data type BOOL
  Range
  Unit N/A
  Default
FirstPosition Description See the function block Description above for an explanation of 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
  Data type LREAL
  Range
  Unit User unit
  Default
LastPosition Description See the function block Description above for an explanation of 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
  Data type LREAL
  Range
  Unit User unit
  Default

Output

Done Description Function block has completed and the RecordedPosition output is valid
  Data type BOOL
Busy Description Indicates that the specified input is arming or is armed, and waiting for the trigger and recording of the position to occur
  Data type BOOL
CommandAborted Description A TriggerAbort function block has executed and canceled this function
  Data type BOOL
Error Description

The function block has not completed successfully due to an error. The ErrorID output indicates the type of error

See table in PLCopen Function Block ErrorID Output

  Data type BOOL
ErrorID Description When the Error output is high, this output indicates the type of error. When the Error output is low, this output is undefined
  Data type INT
RecordedPosition Description When the Done output goes high, this output returns the latched position. When the Done output is low, this output is undefined
  Data type LREAL
  Unit User unit

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.

Related Functions

MC_AbortTrigger

See Also

Example

Structured Text

(* 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

Ladder Diagram

MC_TouchProbe: LD Example

Go back to the top of the page [Top]