# Touch Example DR

### HMI Panel File

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FF3vIwyOJDHlRx6NEeTJj%2Fimmagine.png?alt=media&#x26;token=e6b6ee6c-bddf-4866-9eec-de8864f87ac0" alt=""><figcaption></figcaption></figure>

{% file src="<https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FUlcLAlWtjezCSMGHJlQs%2Ftouch_hmi.hmi?alt=media&token=2d093de3-8d1c-4de3-ae82-715bfb299143>" %}

### Script File

```python
from DRCF import *

# HMI variables
task_running = False
display_status = ""

# HMI functions
def start_task():
    global task_running, display_status
    task_running = True

    while task_running:
        movel(posx(40.1, -294.5, 400, 0, 178.1, 0), v=200, a=200)
        display_status = ""
        amovel(posx(40.1, -294.5, 100, 0, 178.1, 0), v=200, a=200)
        while check_motion() != DR_STATE_IDLE:
            if abs(get_tool_force()[DR_AXIS_Z]) > 8:
                stop(DR_QSTOP)
                display_status = "TOUCH DETECTED!"
                break
            wait(0.1)

    display_status = ""
    movel(posx(40.1, -294.5, 400, 0, 178.1, 0), v=200, a=200)

```
