# Share variables between 3+ RAPID Tasks

**URL:** https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577
**Category:** RAPID Programming
**Created:** [February 10, 2022, 8:27pm UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577 "2022-02-10T20:27:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kappa95](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@Kappa95](https://tech-community.robotics.abb.com/u/Kappa95)
#### Post date: [February 10, 2022, 8:27pm UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577/1 "2022-02-10T20:27:17Z")

</div>

Hello community,

I am working with an IRB 2400/16 and I am developing an applications which uses 3 tasks: T\_PAR, T\_EXTRUDER, T\_ROB1.

T\_PAR is a tasks which communicates via socket for getting a data message and save the message in 8 variables: 6 for the pose and 2 for speed and extrusion parameter.

T\_EXTRUDER: takes the extrusion parameter from the reading in T\_PAR and makes a communication socket with another device.

T\_ROB1: Takes the pose data from T\_PAR and executes the motion.

Question: the variables are saved in SYSTEM module and shared installing the module in the autoloading. But they are only shared between T\_PAR and T\_EXTRUDER. Is it normal?

Thank you in advance

Fede

---

<div class="post-metadata">

### Author: ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)
#### Post date: [February 10, 2022, 8:41pm UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577/2 "2022-02-10T20:41:28Z")

</div>

The Data must be declared as PERS in all tasks which must share it.

---

<div class="post-metadata">

### Author: ![Kappa95](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@Kappa95](https://tech-community.robotics.abb.com/u/Kappa95)
#### Post date: [February 10, 2022, 9:12pm UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577/3 "2022-02-10T21:12:50Z")

</div>

But with PERS the data can be modified between all tasks?

---

<div class="post-metadata">

### Author: ![Newman](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/newman/32/2900_2.png) [@Newman](https://tech-community.robotics.abb.com/u/Newman)
#### Post date: [February 11, 2022, 9:15am UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577/4 "2022-02-11T09:15:29Z")

</div>

> [@Kappa95](#):
>
> But with PERS the data can be modified between all tasks?

Yes as long as you declare data as PERS and with same name you can read/write the data in all tasks.

I usually only to declare the “initial value”, the :=, in one of the task, e.g.  
T\_ROB1: bTest:=TRUE;  
T\_ROB2: bTest;  
T\_ROB3: bTest;

---

<div class="post-metadata">

### Author: ![Newman](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/newman/32/2900_2.png) [@Newman](https://tech-community.robotics.abb.com/u/Newman)
#### Post date: [March 2, 2022, 5:53pm UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577/5 "2022-03-02T17:53:23Z")

</div>

yes

---

<div class="post-metadata">

### Author: ![Markus\_Naslund](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Markus\_Naslund](https://tech-community.robotics.abb.com/u/Markus_Naslund)
#### Post date: [March 11, 2022, 9:56am UTC](https://tech-community.robotics.abb.com/t/share-variables-between-3-rapid-tasks/10577/6 "2022-03-11T09:56:57Z")

</div>

> [@lemster68](#):
>
> The Data must be declared as PERS in all tasks which must share it.

This is not the case when the module is installed shared, all data in an installed shared module are shared between tasks. Even data declared as VAR.
