# variable robtarget name

**URL:** <https://tech-community.robotics.abb.com/t/variable-robtarget-name/4063>\
**Category:** Robot Controller\
**Created:** [February 28, 2011, 5:28pm UTC](https://tech-community.robotics.abb.com/t/variable-robtarget-name/4063 "2011-02-28T17:28:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdillinger](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kdillinger](https://tech-community.robotics.abb.com/u/kdillinger)\
**Post date:** [February 28, 2011, 5:28pm UTC](https://tech-community.robotics.abb.com/t/variable-robtarget-name/4063/1 "2011-02-28T17:28:35Z")

</div>

Does anyone know how to specify the name of a robtarget that was constructed from adding strings and numbers together? For example, I have a robtarget that changes based on the job number that we are running, the job number is a variable number, x. I would like to build the robtarget name using the “x” variable such as:

MoveJ “Rob\_Move”+NumToStr(x,0),v2500,z100,tool01;

If I am running job number 4, then the point is Rob\_Move4. Of course this will change depending on the job that we are running. The NumToStr converts the x variable to a string and adds it to the end of Rob\_Move. However, in this example, the name is read as a string and not as a robtarget. Does anyone know how I can construct the robtarget name with the variable and then use it in a move instruction?

---

<div class="post-metadata">

**Author:** ![mattdavis](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mattdavis](https://tech-community.robotics.abb.com/u/mattdavis)\
**Post date:** [March 1, 2011, 1:00am UTC](https://tech-community.robotics.abb.com/t/variable-robtarget-name/4063/2 "2011-03-01T01:00:46Z")

</div>

have done this before (years ago and cant remeber exactly the process)

I think I used GetDataVal

something like this;

GetDataVal “target”+ ValToStr(num), temprobtarget  
MoveL temprobtarget
