# HMI and Doosan Robotics

There are several ways to structure an [HMI program](https://docs.robpod.cloud/hmi-designer) with Doosan Task 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 functions
* Interaction based on variables

### **Interaction based on functions**

In this scenario motion actions are defined inside functions (Sub) linked to HMI buttons.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FEqInNwwth2SGUqFMa29R%2Fdr-hmi-functions.png?alt=media&#x26;token=9a97f90e-440b-48ff-acf8-27263447c46a" alt=""><figcaption></figcaption></figure>

### **Interaction based on variables**

In this scenario motion actions are defined inside the Main program. HMI buttons are linked with variables, used to control the main program flow.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FjxD5HzMjfvO84167Gh7u%2Fdr-hmi-variables.png?alt=media&#x26;token=658567e2-0035-400d-96e9-8134a36a3ed6" alt=""><figcaption></figcaption></figure>
