> 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/advanced-scripting/background-task/setup.md).

# Setup

This section describes the steps required to create a new Background Task and install it on the robot controller.

{% tabs %}
{% tab title="Universal Robots" %}
{% stepper %}
{% step %}

### New Backgroud Task

Open Robpod Stduio.&#x20;

Right click on project folder and select **New → Background Task File**.&#x20;

Choose a name for the task.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FMys687cUREsN39b5OdDT%2Fimmagine.png?alt=media&amp;token=7d8a6bd9-61c2-4f0f-a5ff-d8be5adaadce" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Code the task

A new background file will be created.

At the top of the file the [background library](broken://pages/VH5HCFGH3O7UkjGzNQLV) will be automatically imported.

You can now code the background task as a standard python program. Check the [Learn by Examples](/advanced-scripting/background-task/learn-by-examples.md) section to see how to use the python background library.&#x20;

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2F17wVXDDCxoLB1wLsjrxV%2Fimmagine.png?alt=media&amp;token=7a716a7e-ab63-4879-adac-1b3bd6aca022" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Always keep **from robpod.background import \*** at the begining of the file, otherwise the program will not be recognized as a background task by the robot controller.
{% endhint %}
{% endstep %}

{% step %}

### Test Locally

Before installing the background task on the robot controller, you can test the program locally on your PC.

[Connect](/robot/robot-toolbar/connect-the-robot.md) Robpod Studio to the robot.

Right click on the code editor and select ![](https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FvummLUQhJDEFNqhSlGHf%2Fimmagine.png?alt=media\&token=d3fe63cb-8e04-45ec-998a-491c21c0b048)**Test Background Task**.

The task will be executed inside Robpod Studio.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FX0PrbEdJA3ZhMYMjWONh%2Fimmagine.png?alt=media&amp;token=0b25d244-f2c9-4152-98f9-2a816618f6ed" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Synchronize the Task

To transfer the background task to the robot controller click on the  ![](https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2F4eP35WIUFMN2yvUGcaH7%2Fsynchronize.png?alt=media\&token=762a6f7a-935e-4c02-b7c8-d9d9f194bf21) Synchronize button.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2F7n1rsUv7h5KSE6G9172A%2Fimmagine.png?alt=media&amp;token=cba97e18-4246-42af-ae21-698e9d6bfb3b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Setup the task on PolyScope

On the robot teach pendant go to **Installation → URCaps → Background.**

Select the background task you want to execute.

Click on **Start Background Task**.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FrjnopIq7UcyC8RQBp5yj%2Fimmagine.png?alt=media&amp;token=305d1a60-e992-47e8-9c95-6d9a29d191fd" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Check the task Status

If the background task is running correctly, <img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FnhMmmo7mZq8eC4PmeF2l%2Fimmagine.png?alt=media&amp;token=cd988dab-b6e1-4fae-852c-73ec3cbbcb30" alt="" data-size="line">  will be displayed.

Click on **View Log** to get more details about the running task.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FDc8R7rvEh2chQ1mgMqbJ%2Fimmagine.png?alt=media&amp;token=4c5153af-8817-46b0-b29b-84ec740ab09c" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Doosan Robotics" %}
{% stepper %}
{% step %}

### New Backgroud Task

Open Robpod Stduio.&#x20;

Right click on project folder and select **New → Background Task File**.&#x20;

Choose a name for the task.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FMys687cUREsN39b5OdDT%2Fimmagine.png?alt=media&amp;token=7d8a6bd9-61c2-4f0f-a5ff-d8be5adaadce" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Code the task

A new background file will be created.

At the top of the file the [background library](broken://pages/VH5HCFGH3O7UkjGzNQLV) will be automatically imported.

You can now code the background task as a standard python program. Check the [Learn by Examples](/advanced-scripting/background-task/learn-by-examples.md) section to see how to use the python background library.&#x20;

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FwzbUMhI990vcYSNM1mSo%2Fimmagine.png?alt=media&amp;token=d11be37c-87f7-4181-aa8f-f06e1f788a6c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Always keep **from robpod.background import \*** at the begining of the file, otherwise the program will not be recognized as a background task by the robot controller.
{% endhint %}
{% endstep %}

{% step %}

### Test Locally

Before installing the background task on the robot controller, you can test the program locally on your PC.

[Connect](/robot/robot-toolbar/connect-the-robot.md) Robpod Studio to the robot.

Right click on the code editor and select ![](https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FvummLUQhJDEFNqhSlGHf%2Fimmagine.png?alt=media\&token=d3fe63cb-8e04-45ec-998a-491c21c0b048)**Test Background Task**.

The task will be executed inside Robpod Studio.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FpQf1JMdRzEt5K4wEAB6g%2Fimmagine.png?alt=media&amp;token=43b13455-918c-4ac9-bafe-4b9ccc3407f5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Synchronize the Task

To transfer the background task to the robot controller click on the  ![](https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2F4eP35WIUFMN2yvUGcaH7%2Fsynchronize.png?alt=media\&token=762a6f7a-935e-4c02-b7c8-d9d9f194bf21) Synchronize button.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FayQqBYPJFfiOq1OZq166%2Fimmagine.png?alt=media&amp;token=f8c94608-f7db-4fbd-b529-ee00b9b5c7c1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Setup the task on DART Platform

On the robot teach pendant open Robpod Ap&#x70;**.**

Inside the Background Task card, click on **SETUP**.

Select the background task you want to execute.

Click on **PLAY**.

<figure><img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FHQafNxxkJuWAw0nV5ZzD%2Fimmagine.png?alt=media&amp;token=2eebff47-f93d-41c1-ba5c-e76f8fd589b3" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Enable the Auto Start Option option to run the Background Task automnatically when Robpod App is open. Inside robot Settings in can configure Robpos App a a startuo module, in this way the Background Task will be started automatically at robot startup.&#x20;
{% endhint %}
{% endstep %}

{% step %}

### Check the task Status

If the background task is running correctly, <img src="https://175138337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvxlh3prlGsBGF30oqbYW%2Fuploads%2FuyXrCZ6O5QSJUfoDZEMR%2Fimmagine.png?alt=media&amp;token=511bb439-bd8d-46d8-93f2-de543560c0fc" alt="" data-size="line"> will be displayed.

Click on **SHOW LOGS** to get more details about the running task.
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}
