The initial self – check program for Fanuc robots is crucial for ensuring stable operation. To write it, first define the scope of self – check, including mechanical parts like axes and joints, and electrical components such as sensors. Use Fanuc’s programming language, KAREL or TP, to write logical statements for each item. For example, check the position accuracy of axes and the functionality of sensors.
In setting, input the expected values and tolerance ranges. The robot will compare real – time data with these values during self – check. Set appropriate warning and error levels to handle abnormal situations. Regularly update and optimize these programs to adapt to different production requirements, ensuring high – efficiency and reliable operation of Fanuc robots.
1 Overview
In the actual use of Fanuc robots, reference positions, anti-interference areas, background programs may be set, or some IO signals may be simulated to test the running program during initial debugging. Therefore, at the beginning of the running program, we need to write a subroutine to detect whether the reference position, anti-interference area, background program, etc. are turned on, and whether the IO signal simulation is released to avoid program running errors and abnormalities.
This article does not explain the specific settings of reference position, anti-interference area, signal simulation, background program, etc. This article will explain the variables or logic for detecting reference position, anti-interference area, signal simulation, background program, etc., and give program writing and examples for reference.
2 Function settings
2.1 Reference position
Take reference position 1 as an example. When setting the enable and disable status of the reference position page, its associated variable is $REFPOS1[1].$ENABLED($REFPOSE1 [30] of REFPOS11_T->1[1] REFPOS11_T->$ENABLED TRUE/FALSE).
2.2 Anti-interference area
Take anti-interference area 1 as an example. When setting the enable and disable status of the anti-interference area page, its associated variable is $RSPACE1[1].$ENABLED($RAPACE1[10] of RSPACE_T->1[1] RSPACE_T->$ENABLED TRUE/FALSE).
2.3 Background program
Take background program 1 as an example. When setting the running and stopping status of the background program page, the associated variable is $MIX_BG[1].$STATUS($MIX_BG [8] of MIX_BG_T->1[1] MIX_BG_T->$STATUS 1/2).
2.4 Signal simulation
Menu->System->Configuration, set the associated DO in “Output signal when there is simulation input” and “Output signal when there is simulation output”. The selected signal must be assigned and not used in other settings, otherwise there will be detection abnormalities. This setting needs to be restarted to take effect.
3 Program writing and examples
Program examples, such as, the variables in the program need to be manually entered.
Reference position $REFPOS1[1].$ENABLED
Anti-interference area $RSPACE1[1].$ENABLED
Background program $MIX_BG[1].$STATUS
1 Status self-check
2:
3:! Check if the reference position is on
4: LBL[1]
5: IF ($REFPOS1[1].$ENABLED=0) THEN
6: JMP LBL[999]
7: ENDIF
8:
9: ! Check if the anti-interference area is on
10: LBL[2]
11: IF ($RSPACE1[1].$ENABLED=0) THEN
12: JMP LBL[998]
13: ENDIF
14:
15: ! Check if the background program is on
16: LBL[3]
17: IF ($MIX_BG[1].$STATUS<>2) THEN
18: JMP LBL[997]
19: ENDIF
20:
21: ! Check if there is a simulation signal
22: LBL[4]
23: IF (D0[15] OR D0[16]) THEN
24: JMP LBL[996]
25: ENDIF
26:
27: END
28:
29: ! Alarm segment
30: LBL[999]
31: Message[Please enable reference position]
32: UALM[1]
33: JMP LBL[1]
34:
35: LBL[998]
36: Message[Please enable anti-interference area]
37: UALM[1]
38: JMP LBL[2]
39:
40: LBL[997]
41: Message[Please run background program]
42: UALM[1]
43: JMP LBL[3]
44:
45: LBL[996]
46: Message[Please cancel signal simulation]
47: UALM[1]
48: JMP LBL[4]
49: [End]
