# Where the Variable values are stored?

**URL:** <https://tech-community.robotics.abb.com/t/where-the-variable-values-are-stored/10368>\
**Category:** RAPID Programming\
**Created:** [September 16, 2021, 6:33am UTC](https://tech-community.robotics.abb.com/t/where-the-variable-values-are-stored/10368 "2021-09-16T06:33:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald\_wang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/donald_wang/32/137_2.png) [@Donald\_wang](https://tech-community.robotics.abb.com/u/Donald_wang)\
**Post date:** [September 16, 2021, 6:33am UTC](https://tech-community.robotics.abb.com/t/where-the-variable-values-are-stored/10368/1 "2021-09-16T06:33:46Z")

</div>

Hi,

I would like to analyze some data from laser scanner, which is just 1D array as defined below:

PERS num n\_GI\_Left\_Array{n\_NUM\_SAMPLES\_BW}

FOR i FROM 1 TO n\_NUM\_SAMPLES DO  
n\_GI\_Left\_Array{i} := GInput(gi\_Sensor);  
…  
ENDFOR

I wonder if someone could tell me how I could find, save or retrieve the values in the array for analysis.

Much appreciated in advance!

Donald

---

<div class="post-metadata">

**Author:** ![Micky](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Micky](https://tech-community.robotics.abb.com/u/Micky)\
**Post date:** [October 25, 2021, 10:40am UTC](https://tech-community.robotics.abb.com/t/where-the-variable-values-are-stored/10368/2 "2021-10-25T10:40:00Z")

</div>

Hello Donald,

Persistent can be defined with and without initial value.

If the initial values are not used, as in your case, the current values are only stored within the robot memory but not written back to the program.

For persistent with an initial value, the current values are stored in the robot program and can be reused.

The initial values must be assigned to the data declaration and the number of data must correspond to the data field size “n\_NUM\_SAMPLES\_BW”.

PERS num n\_GI\_Left\_Array{n\_NUM\_SAMPLES\_BW}:=[0,0,0,0,0,0,0,…,0,0];

---

<div class="post-metadata">

**Author:** ![Elderwild](https://avatars.discourse-cdn.com/v4/letter/e/c57346/32.png) [@Elderwild](https://tech-community.robotics.abb.com/u/Elderwild)\
**Post date:** [November 4, 2021, 7:01pm UTC](https://tech-community.robotics.abb.com/t/where-the-variable-values-are-stored/10368/3 "2021-11-04T19:01:38Z")

</div>

Donald,

I don’t know what system you are using or how it is set up, but in the old days, you could hook up a printer to print out this kind of thing using the serial port. Serial ports are becoming harder to find now days with networks so readily available. So, if you are on a network, you should be able to do the same thing digitally. If you are stand alone, then you will need to write some Rapid to tell the controller to save the data to a file by part, hour, shift, job, day. etc… I would think this could be done using the service port, but if not, then the Lan port would be an option. Either way you will need to collect the data often and store in a different local or you will fill up your memory with clutter.

---

<div class="post-metadata">

**Author:** ![Donald\_wang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/donald_wang/32/137_2.png) [@Donald\_wang](https://tech-community.robotics.abb.com/u/Donald_wang)\
**Post date:** [November 8, 2021, 9:02pm UTC](https://tech-community.robotics.abb.com/t/where-the-variable-values-are-stored/10368/4 "2021-11-08T21:02:14Z")

</div>

Hi Micky and Elderwild , Thank you very much for your answers.

My problem was solved by defining them as System Global PERS to get around with the initial values sytex errors.

According to technical reference manual : "Since PERS can be declared in 3 different types: System Global, Task Global, and Local. The first one can be initialized with Omitted values, but not the later two. "

To used them after declaration, simply follow the arrayName{#} format.
