# User Defined Records in RAPID

**URL:** <https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899>\
**Category:** Robot Controller\
**Created:** [June 25, 2009, 9:49am UTC](https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899 "2009-06-25T09:49:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neohcs](https://avatars.discourse-cdn.com/v4/letter/n/e47c2d/32.png) [@Neohcs](https://tech-community.robotics.abb.com/u/Neohcs)\
**Post date:** [June 25, 2009, 9:49am UTC](https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899/1 "2009-06-25T09:49:43Z")

</div>

Hi,

I am trying to build a user defined record (data object) in RAPID however, I cannot find any form of information regarding to the syntax in the ABB RAPID manuals.

Is there someone who has an example of a record for me?

---

<div class="post-metadata">

**Author:** ![dhyan](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/dhyan/32/2452_2.png) [@dhyan](https://tech-community.robotics.abb.com/u/dhyan)\
**Post date:** [June 25, 2009, 10:24am UTC](https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899/2 "2009-06-25T10:24:54Z")

</div>

Hello Neohcs.😉

A? A? If I’m not wrong to interprete your question, I have an example like this:

VAR pos home;

VAR pos pos1;

VAR num yvalue;

…

yvalue := home.y; A? A?!the axis-y component only

pos1 := home; A? A? A? A? !the whole position

A? A? A variable, persistent or constant declared as a record can be referenced to the whole record or a single component. A record component is referenced using the component name.

A? A? I hope this will help.

Best Regard

Dhyan

Indonesia

---

<div class="post-metadata">

**Author:** ![Neohcs](https://avatars.discourse-cdn.com/v4/letter/n/e47c2d/32.png) [@Neohcs](https://tech-community.robotics.abb.com/u/Neohcs)\
**Post date:** [June 25, 2009, 10:39am UTC](https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899/3 "2009-06-25T10:39:54Z")

</div>

Hello Dhyan,

Thanks for the fast answer, but it is not what I was looking for. (I found it just a minute ago in the RAPID kernel manual 3HAC16585-1\_revF\_en.pdf)

I have to store information about different products, (size, location, ect ect)

I can save them using a Record.

RECORD Product

pos size;  
pos location;  
pos target;  
num weight;  
num productID;  
ENDRECORD

if i need the pick the product i can use this statement.

VAR Product ProductA;  
VAR robtarget pos10;  
…  
…  
..  
..

pos10.trans := ProductA.location;  
pos10.trans.z := pos10.trans.z + ProductA.Size.z;  
MOVEL pos10 …

---

<div class="post-metadata">

**Author:** ![Wolf\_Tech](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@Wolf\_Tech](https://tech-community.robotics.abb.com/u/Wolf_Tech)\
**Post date:** [June 25, 2009, 1:50pm UTC](https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899/4 "2009-06-25T13:50:42Z")

</div>

Neochs,

I believe you may be wanting to do Rapid Developer Functions to create your own data types, this is a separate software option from ABB. I’m sure someone familiar with this can better explain it.

In the mean time, I can offer another solution. I would create a routine that you can pass parameters in and out of to assign the product information. This routine could then be used as an instruction, allowing you to input the information from the teach pendant through Proc Call. This can make for a very clean program if done right. Here is a crude example of what I mean:

PROC **AssignProduct** (pos **size** ,pos location, pos target, num weight, num productID;)  
_!Assign your values here_  
ENDPROC

This can be taken to a higher level with IN/OUT, optional arguments, and switches.

Best Regards,

Shane

---

<div class="post-metadata">

**Author:** ![j\_proulx](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@j\_proulx](https://tech-community.robotics.abb.com/u/j_proulx)\
**Post date:** [June 26, 2009, 2:42pm UTC](https://tech-community.robotics.abb.com/t/user-defined-records-in-rapid/2899/5 "2009-06-26T14:42:41Z")

</div>

Hello,  
Attached is the Rapid Overview manual and the Rapid Kernal Manual. These have information on Record syntax.

Br  
Jim Proulx

[webwiz/222/Rapid\_Documents.zip](http://forums.robotstudio.com/webwiz/222/Rapid_Documents.zip)
