J2P
(Function)
Transforms joint type data to position type data.
J2P (<joint type>[ ,<J2P option>])
This function transforms joint type of data in <joint type> to position type. The obtained value reflects the currently specified tool or work coordinate system.
<J2P 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 J2P causes an internal error, but assigns the error code into the specified variable.
DEFPOS lp1, lp2
|
|
DIM lj1 As Joint
|
|
lp1 = J2P(lj1)
|
'Assigns lj1 data transformed to position type data to lp1.
|
lp1 = J2P(lj1,li1)
|
'If execution of J2P fails, assign the error code into
'variable li1 and then go to the next step.
|
6-axis
lp2 = J2P((0, 0, 90, 0, 0, 0))
|
'Assigns the data of (0, 0, 90, 0, 0, 0)
'transformed to position type data to lp2.
|
4-axis
lp2 = J2P((0, 0, 300, 0))
|
'Assigns the data of (0, 0, 300, 0)
'transformed to position type data to lp2.
|