FANUC Inline Measurement Program
Program Introduction
Description |
You trigger Mech-Metrics from the robot side to perform measurement using Mech-MSR and return the measurement results to Mech-Metrics. |
File path |
You can navigate to the installation directory of Mech-MSR and Mech-Metrics find the file by using the |
Resource requirements |
Mech-MSR solution and Mech-Metrics project |
Prerequisites |
|
| This example program is provided for reference only. Before using the program, please modify the program according to the actual scenario. |
Program Description
The following is the code of the MSR_Metrics_Sample1 example program and the related explanation.
1: !-------------------------------- ;
2: !FUNCTION: MSR_Metrics_Sample1 ;
3: !Mech-Mind, 2024-05-27 ;
4: !-------------------------------- ;
5: ;
6: !set current uframe NO. to 0 ;
7: UFRAME_NUM=0 ;
8: !set current tool NO. to 1 ;
9: UTOOL_NUM=1 ;
10: !move to robot home position ;
11: J P[4] 100% FINE ;
12: !Init Socket!Modify IP Address ;
13: CALL MSR_INIT_SKT('8','192.168.1.20',50000,5) ;
14: !Set Custom Values ;
15: CALL MSR_MEAS_PARM(10,20,30,40,50,60,70,80) ;
16: !SR:String Register; R:Register ;
17: !Set Robot_Id,SR No.1, ;
18: !SR No.2,Qc_Mode,R NO. ;
19: !SR No.1:Piece_Name ;
20: !SR No.2:Piece_Sn ;
21: !R No.:Continuous Mode ;
22: CALL MSR_ST_MEAS(1,1,2,1,10) ;
23: !Set Robot_Id,SR No.2 ;
24: !SR No.2:Piece_Sn ;
25: CALL MSR_SET_WP(1,2) ;
26: !move to 1st image-capturing ;
27: !position ;
28: J P[1] 100% FINE ;
29: !Set Robot_Id,Index ;
30: CALL MSR_MEAS_FEAT(1,3) ;
31: !move to 2ed image-capturing ;
32: !position ;
33: J P[2] 100% FINE ;
34: !Set Robot_Id,Index ;
35: CALL MSR_MEAS_FEAT(1,3) ;
36: !move to 3rd image-capturing ;
37: !position ;
38: J P[3] 100% FINE ;
39: !Set Robot_Id,Index ;
40: CALL MSR_MEAS_FEAT(1,3) ;
41: !Set Robot_Id,R No. ;
42: !R No.1:Measure Result ;
43: !R No.2:Alarm Count1 ;
44: !R No.3:Alarm Count2 ;
45: !R No.4:Alarm Count3 ;
46: CALL MSR_END_MEAS(1,11,12,13,14) ;
47: !Set Robot_Id,SR No.2 ;
48: !SR No.2:Piece_Sn ;
49: CALL MSR_VIEW_WP(1,2) ;
50: WAIT 1.00(sec) ;
51: PAUSE ;
The table below explains the above example program. In the above code, the comment-out content starts with !. The following table does not explain the comment-out content.
| Workflow | Code and description | ||||
|---|---|---|---|---|---|
Set the reference frame |
|
||||
Move to a specified position |
|
||||
Initialize the communication |
|
||||
Set custom parameters |
|
||||
Start measurement task |
|
||||
Input part to Mech-Metrics |
|
||||
Move the robot to a specified position and perform feature measurement |
|
||||
Stop Measurement Task |
|
||||
Query history data |
|