# HMI and UR Polyscope

There are several ways to structure an [HMI program](/hmi-designer/introduction.md) within the UR polyscope program editor, and typically each developer has his own preferred way. Below you can find the two most used ways to structure a program with HMI (a mix of the two is also possible):

* Interaction based on variables
* Interaction based on functions

### **Interaction based on variables**

In this scenario, to triger a robot action, HMI Buttons are linked to program (or installation) variables . Robot task is defined inside the Main Program, which can loop continuously.&#x20;

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

### **Interaction based on functions**

In this scenario, to triger a robot action, HMI Buttons are linked to program functions (called Sub Program inside Polyscope). Robot tasks are defined inside Sub Programs, which are automatically called by HMI components. As robot tasks are executed inside Sub Programs, Main Program can be stopped as it is not required to loop continuously.

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.robpod.cloud/hmi-designer/hmi-and-ur-polyscope.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
