# Robot world TCP position (X, Y, Z, W, P, R) - System variable

• Good morning,

I am using the \$ SCR_GRP [ 1 ] . \$ MCH_POS_(X/Y/Z/W/P/R) to tell my PLC the robot positions in the world.

However, these numbers don’t update while you’re jogging, and won’t update until the robot starts a move in a program. One little trick is to do a move to the current position at the start of your program:

PR[100:SCRATCH]=LPOS
J PR[100:SCRATCH] 10% FINE

There is another variable that give me directly the value ?
I am using r2000ib - 125 l robot and r30 ia controller.

I don't have \$DIAG_GRP[1] in system variables.

Edited once, last by Drafpin ().

• Set \$SCR_GRP[1]\$M_POS_ENB to true and use the variable:
\$SCR_GRP[1]\$MCH_ANG[1] replace the 1 with what ever axis you want to monitor.

• If you dont want the joint angles and want Cartesian you can use IRmath to convert to Cartesian. At least I think you can I have used Cartesian to Joint conversion so I would think it can be done.,

• Below is from the IRMATH manual. This will convert joint to cart.

4.10. JOINT or MATRIX to Cartesian (fcCartesian=10) irXYZWPR.tp

SYNTAX:
Call iRMath (10,0,0,1) ! call iRMath directly
Call irXYZWPR (1) ! TP method
iR Cartesian (1) ! macro

Pass the position in a PR. The PR is updated to a Cartesian format. If the position register is stored in JOINT representation it is converted to Cartesian representation. The current \$MnuToolNum and \$MnuUframeNum are used for the conversion. In other words, the joint values are converted to its world frame coordinates, the user tool is added to the base plate, and then it is converted to the user frame coordinates.

EXAMPLE
PR[1] = P[1]
IR Cartesian (1) ! format of PR[1] changed to Cartesian