P2T (Function)


Transforms position type data to homogeneous transformation type data.


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


This function transforms position type of data in <position type> to homogeneous transform matrix. The obtained value reflects the currently specified tool or work coordinate system.
<P2T 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 P2T causes an internal error, buy assigns the error code into the specified variable.




DEFTRN lt1, lt2
DIM lp1 As position
Lt1 = P2T(lp1)
'Assigns lp1 data transformed to
'homogeneous transformation type data to lt1.
lt1 = P2T(lp1,li1)
'If execution of P2T fails, assign the error code into
'variable li1 and then go to the next step.

6-axis
lt2 = P2T((350, 0, 450, 0, 0, 180))
'Assigns the data of (350, 0, 450, 0, 0, 180)
'transformed to homogeneous transformation
'type data to lt2.

4-axis
lt2 = P2T((100, 100, 300, 45))
'Assigns the data of (100, 100, 300, 45)
'transformed to homogeneous transformation
'type data to lt2.


Top