# Update robtarget in a record

**URL:** <https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783>\
**Category:** RAPID Programming\
**Tags:** r, record\
**Created:** [February 10, 2025, 1:42pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783 "2025-02-10T13:42:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@Burro](https://tech-community.robotics.abb.com/u/Burro)\
**Post date:** [February 10, 2025, 1:42pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/1 "2025-02-10T13:42:01Z")

</div>

Hello,

Is it possible to update a position from the flexpendant that exist in a record?

---

<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, 2025, 2:56pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/2 "2025-02-10T14:56:41Z")

</div>

This is from the technical reference manual - Rapid overview:  
A specific component of a record data can be accessed by using the name  
of that component, for example pos1.x := 300; assignment of the x-component of pos1.  
Now if you mean by modposing the position with the pendant, I don’t know.

---

<div class="post-metadata">

**Author:** ![Burro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@Burro](https://tech-community.robotics.abb.com/u/Burro)\
**Post date:** [February 10, 2025, 3:21pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/3 "2025-02-10T15:21:27Z")

</div>

> [@lemster68](#):
>
> This is from the technical reference manual - Rapid overview:  
> A specific component of a record data can be accessed by using the name of that component, for example pos1.x := 300; assignment of the x-component of pos1.  
> Now if you mean by modposing the position with the pendant, I don’t know.

I mean modposing the position. When I try to do it in the virtual flexpendant, an error pops up and says “The given source position is illegal for the operation”. I’m also using correct wobj and tool when attempting this.

I feel like this should work because you can modpos a robtarget in an array atleast.

---

<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, 2025, 3:27pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/4 "2025-02-10T15:27:52Z")

</div>

Is the robtarget in question constant?

---

<div class="post-metadata">

**Author:** ![Burro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@Burro](https://tech-community.robotics.abb.com/u/Burro)\
**Post date:** [February 10, 2025, 3:41pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/5 "2025-02-10T15:41:59Z")

</div>

> [@lemster68](#):
>
> Is the robtarget in question constant?

I have tried both constant and persistent

---

<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 11, 2025, 1:33pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/6 "2025-02-11T13:33:49Z")

</div>

How about in a routine as an INOUT parameter?

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [February 11, 2025, 6:40pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/7 "2025-02-11T18:40:15Z")

</div>

Hey …  
I believe that what you are trying to do is something similar to wanting to modify a position obtained through an Offs(pp,0,0,0) routine. This is not possible.  
The flexpendant ‘modpos’ function expects to receive a robtarget and not ‘RECORD.robtarget’ or ‘Offs(robtarget, x,y,z)’.  
Good job.

---

<div class="post-metadata">

**Author:** ![Burro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@Burro](https://tech-community.robotics.abb.com/u/Burro)\
**Post date:** [February 12, 2025, 10:17am UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/8 "2025-02-12T10:17:03Z")

</div>

> [@lemster68](#):
>
> How about in a routine as an INOUT parameter?

I have tried it aswell

---

<div class="post-metadata">

**Author:** ![Burro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@Burro](https://tech-community.robotics.abb.com/u/Burro)\
**Post date:** [February 12, 2025, 10:40am UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/9 "2025-02-12T10:40:04Z")

</div>

> [@mandolas](#):
>
> Hey …  
> I believe that what you are trying to do is something similar to wanting to modify a position obtained through an Offs(pp,0,0,0) routine. This is not possible.  
> The flexpendant ‘modpos’ function expects to receive a robtarget and not ‘RECORD.robtarget’ or ‘Offs(robtarget, x,y,z)’.  
> Good job.

That may be the case but the “Update Position” button should not light up when you highlight the robtarget, it does not light up when you mark a offs/reltool.

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [February 12, 2025, 12:59pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/10 "2025-02-12T12:59:23Z")

</div>

@Burro I agree with your statement, however, as far as I can remember, it has always been this way.

@lemster68’s idea can partially solve your problem…

Some time ago, I wanted the user to be able to modify positions without interacting with or changing the code. So I ‘removed’ the user’s permissions to edit RAPID.  
In a procedure, I passed a robtarget array (INOUT) and, at each iteration, asked the user if they wanted to save the position. This way, they could move the robot (using the joystick) to the desired position and respond YES to save it.

In this routine, I used CRobT() to get the current position. Of course, there are some limitations, such as the Tool and Work Object used to store this position.

Good work.

---

<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 12, 2025, 2:51pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/11 "2025-02-12T14:51:41Z")

</div>

For sure it would have to be persistent or VAR, constant would not work at all.

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [February 12, 2025, 4:14pm UTC](https://tech-community.robotics.abb.com/t/update-robtarget-in-a-record/11783/12 "2025-02-12T16:14:43Z")

</div>

> [@lemster68](#):
>
> For sure it would have to be persistent or VAR, constant would not work at all.

Exactly. In my case PERS
