MC_TouchProbe
Description
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:
-
-
The accuracy of captured position data depends on the travel velocity. Please see the article MC_TouchProbe and Time-Based Capture on KDN for more information and how to correct for timing.
-
- This function block starts a motion-related action and therefore stores data for calculations and error checking. Please see Calling Function Blocks Multiple Times in the Same Cycle if you are using a dual-core controller.
-
- There are some differences in how MC_TouchProbe interacts with AKD and AKD2G drives. Please refer to the following topics for some drive-specific information.
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 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
|
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
See Also
- Fast Inputs with Pipe Network Motion
- Fast Inputs with PLCOpen
- Fast Homing Example with the Pipe Network Motion Engine Axis Pipe Block
- Fast Homing Example with the PLCopen Motion Engine
- Pipe Network Registration and Fast Homing
- Registration Position Capture Example with Pipe Network Trigger Block
Example
Structured Text
(* MC_TouchProbe ST example *) |
Ladder Diagram