> For the complete documentation index, see [llms.txt](https://docs.robpod.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.robpod.cloud/hmi-designer/working-examples/doosan-robotics/box-weight-example-dr.md).

# Box Weight Example DR

### HMI Panel File

<figure><img src="/files/x3Fe7z2KnuHhq8s7PgSD" alt=""><figcaption></figcaption></figure>

{% file src="/files/TMHQwPIrHtA4zkAHtjLD" %}

### Script File

```python
from DRCF import *

box_weight = 0
box_height = 0

set_external_force_reset()


def pick():
    global box_weight, box_height

    pose, _ = get_current_posx()
    pose[2] = 0
    
    task_compliance_ctrl()
    amovel(pose, v=50)
    while get_tool_force()[2] < 10 and get_current_posx()[0][2] > 10:
        wait(0.1)
    stop(DR_QSTOP)
    release_compliance_ctrl()

    box_height = get_current_posx()[0][2]
    set_digital_outputs([1, -2])
    wait(0.5)

    movel(posx(0, 0, -50, 0, 0, 0), ref=DR_TOOL)
    wait(1)
    box_weight = get_workpiece_weight()


def release():
    pose, _ = get_current_posx()
    pose[2] = box_height
    movel(pose, v=50)

    set_digital_outputs([-1, 2])
    wait(0.5)
    movel(posx(0, 0, -150, 0, 0, 0), v=100, ref=DR_TOOL)

```
