4MELFA-BASIC IV
Detailed Explanation of Functions
4-328
PosMid
[Function]
Obtain the middle position data when a linear interpolation is performed between two given points.
[Format]
[Reference Program]
1 P1=PosMid(P2,P3,0,0)
' The position data (including posture) of the middle point between P2
and P3 will be assigned to P1.
[Explanation]
(1) Obtain the position data of the middle point when a linear interpolation is performed between two posi-
tion data.
(2) The first argument gives the starting point of the linear interpolation, while the second argument gives
the endpoint of the linear interpolation.
(3) The third and fourth arguments correspond to the two TYPE arguments of the Mvs command.
(4) The arguments for the starting and end points must be positions that allow linear interpolation with the
specified interpolation type. For instance, an error will be generated if the structure flags of the starting
and end points are different.
(5) It is not possible to describe a function that contains an argument in <Position Variables 1>, <Position
Variables 2>,<Equation 1> and <Equation 2>. If such a function is described, an error will be generated
during execution.
PtoJ
[Function]
Converts the given position data into a joint data.
[Format]
[Reference Program]
1 J1=PtoJ(P1)
' J1 will contain the value of P1 (XYZ position variable) that has been converted
into joint data type.
[Explanation]
(1) Converts the position data into the joint data.
(2) Joint variables(J variable) cannot be used as the argument. When a joint variable is used, an error will be
generated.
(3) Since the return value is a joint data, an error will be generated if a position variable is used in the left-
hand side.
[Reference]
<Position Variables>=PosMid(<Position Variables 1>, <Position Variables 2>,<Equation 1>,
<Equation 2>)
<Joint Variable>=PtoJ(<Position Variables>)