P2J (Function)


Transforms position type data to joint type data.


P2J(<position type>[ ,<P2J option>])


This function transforms position type of data in <position type> to joint type. The obtained value reflects the currently specified tool or work coordinate system.
If the FIG value in the position type of data is -1 (undetermined), the data is transformed with the current figure. The obtained value reflects the currently specified tool or work coordinate system.
<P2J option> is an omissible Result storage variable that should be an integer variable (Ver. 3.0 or later). Specifying this option does not stop programs even if execution of the P2J causes an internal error, but assigns the error code into the specified variable.



DEFJNT lj1, lj2
DIM lp1 As position
lj1 = P2J(lp1)
'Assigns lp1 data transformed to joint
'type data using the current figure to lj1.
lj1 = P2J(lp1,li1)
'If execution of P2J fails, assign the error code into
'variable li1 and then go to the next step.

6-axis
lj2 = P2J((0, 0, 90, 0, 0, 180))
'Assigns the data of (0, 0, 90, 0, 0, 180)
'transformed to joint type data using the
'current type to lj2.

4-axis
lj2 = P2J((100, 100, 300, 45))
'Assigns the data of (100, 100, 300, 45)
'transformed to joint type data using the
'current type to lj2.


Top