4-295
Detailed explanation of Robot Status Variable
4MELFA-BASIC IV
M_Tool
[Function]
In addition to using the tool data (MEXTL1 to 4) of the specified number as the current tool data, it is also set
in the MEXTL parameter.
The current tool number can also be read.
[Format]
[Terminology]
<Numeric Variable>
Specifies the numerical variable to assign.
<Mechanism Number>
Enter the mechanism number to 3 from 1.
If the argument is omitted, 1 is set as the default value.
<Equation>
Enter the tool number to 4 from 1.
[Reference Program]
Setting Tool Data
1 Tool (0,0,100,0,0,0)
' Specify tool data (0,0,100,0,0,0), and write it into MEXTL.
2 Mov P1
3 M_Tool=2
' Change the tool data to the value of tool number 2 (MEXTL2).
4 Mov P2
Referencing the Tool Number
1 If M_In(900)=1 Then
' Change the tool data by a hand input signal.
2 M_Tool=1
' Set tool 1 in tool data.
3 Else
4 M_Tool=2
' Set tool 2 in tool data.
5 EndIf
6 Mov P1
[Explanation]
(1) The values set in the MEXTL1, MEXTL2, MEXTL3 and MEXTL4 tool parameters are reflected in the tool
data. It is also written into the MEXTL parameter.
(2) Tool numbers 1 to 4 correspond to MEXTL1 to 4.
(3) While referencing, the currently set tool number is read.
(4) If the reading value is 0, it indicates that tool data other than MEXTL1 to 4 is set as the current tool data.
(5) The same setting can be performed on the Tool Setup screen of the teaching pendant. For more infor-
mation, see
[Reference]
, MEXTL, MEXTL1, MEXTL2, MEXTL3, MEXTL4
Example)<Numeric Variable>=M_Tool [(<Mechanism Number>)]'Referencing the Current Tool Number
Example)M_Tool [(<Mechanism Number>)] = [(<Equation>)]
'Set a tool number.