4MELFA-BASIC IV
Detailed explanation of Robot Status Variable
4-276
M_ColSts
[Function]
Return the impact detection status..
1: Detecting an impact
0: No impact has been detected
The impact detection function can only be used in certain models (Refer to "[Available robot type]".).
[Format]
[Terminology]
<Mechanism Number>
Specify the mechanism number 1 to 3. The default value is 1.
[Reference Program]
1 Def Act 1,M_ColSts(1)=1 GoTo *HOME,S
'Define the processing to be executed when an impact is
detected using an interrupt.
2 Act 1=1
3 ColChk ON,NOERR
'Enable the impact detection function in the error non-occurrence mode.
4 Mov P1
5 Mov P2
'If an impact is detected while executing lines 40 through 70, it jumps to
interrupt processing.
6 Mov P3
7 Mov P4
8 Act 1=0
:
:
100 *HOME
'Interrupt processing during impact detection.
101 ColChk Off
'Disable the impact detection function.
102 Servo On
'Turn the servo on.
103 PESC=P_ColDir(1)*(-2)
'Create the amount of movement for escape operation
104 PDst=P_Fbc(1)+PESC
'Create the escape position.
105 Mvs PDst
'Move to the escape position.
106 Error 9100
'Stop operation by generating a user-defined L level error.
[Explanation]
(1) When an impact is detected, it is set to 1. When the servo is turned off and the impact state is canceled,
it is set to 0.
(2) It is used as an interrupt condition in the Def Act instruction when used in the NOERR mode.
(3) This variable only reads the data.
[Available robot type]
Example) Def Act 1, M_ColSts [(<Mechanism Number>)]=1 GoTo *LCOL,S
RV-6SD/6SDL/12SD/12SDL series