# Using cPos from motion task in a semistatic task

**URL:** <https://tech-community.robotics.abb.com/t/using-cpos-from-motion-task-in-a-semistatic-task/11382>\
**Category:** IRC5\
**Tags:** irc5, robotstudio, rapid-code, abb\
**Created:** [March 28, 2024, 1:07pm UTC](https://tech-community.robotics.abb.com/t/using-cpos-from-motion-task-in-a-semistatic-task/11382 "2024-03-28T13:07:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samflower](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@samflower](https://tech-community.robotics.abb.com/u/samflower)\
**Post date:** [March 28, 2024, 1:07pm UTC](https://tech-community.robotics.abb.com/t/using-cpos-from-motion-task-in-a-semistatic-task/11382/1 "2024-03-28T13:07:32Z")

</div>

Hi all,

I’ve been trying to use cPos from a motion task in a semistatic task. Anytime I try it the semistatic task comes up with an argument error for the work object and took data. I am using this to try to measure the distance of weld paths. I am using RW 5.15.

PROC MAIN()

1!!!2 AWLC.

I Seam 45

P\_1:=Cpos (\Tool: =tR2\_A500\_45L|wobj: =wobjR2\_0p35\_2);

WaitTime 0.5;

P\_2:=Pos (\Tool:=tR2\_A500\_45L \wobj:=wobjR2\_0p35\_2) ;

W\_45:= Distance (P

\_1, PL

\_2) :

Add W45, L\_ W45;

This is just the basic bit of the program to see if it would actually work.

Thanks in advance

---

<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:** [March 28, 2024, 1:38pm UTC](https://tech-community.robotics.abb.com/t/using-cpos-from-motion-task-in-a-semistatic-task/11382/2 "2024-03-28T13:38:19Z")

</div>

If you want the tooldata and workobjectdata to be known to another task it must be declared in both (or more, if more tasks) and it must be declared as type PERS.

---

<div class="post-metadata">

**Author:** ![samflower](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@samflower](https://tech-community.robotics.abb.com/u/samflower)\
**Post date:** [April 3, 2024, 11:01pm UTC](https://tech-community.robotics.abb.com/t/using-cpos-from-motion-task-in-a-semistatic-task/11382/3 "2024-04-03T23:01:28Z")

</div>

Thank you, got this working now
