Mitsubishi CR750-Q Series Instruction Manual page 145

Tracking system and vision tracking system using mitsubishi robot
Hide thumbs Also See for CR750-Q Series:
Table of Contents

Advertisement

(3) C1.Prg
1 '### Ver.A3 #########################################
2 '# Network vision tracking, workpiece suction position registration program
3 '# Program type
4 '# Date of creation/version : 2012.07.31 A3
5 '# COPYRIGHT : MITSUBISHI ELECTRIC CORPORATION.
6 '####################################################
7 '(1) Store a model number in the X coordinate of the "PRM1" variable/
8 '(2) Store an encoder number in the Y coordinate of the "PRM1" variable/
9 '(3) Check live images and register the length in the movement direction to the X coordinate of the "PRM2"
variable/
10 '(4) Store the workpiece length in the Y coordinate of the "PRM2" variable/
11 '(5) Enter the COM port number to be opened for communication after "CCOM$=" in the following line/
12
CCOM$= "COM2:"
13 '(6) Enter the vision program name after "CPRG$=" in the following line/
14
CPRG$= "TRK.JOB"
15 '(7) Place workpieces to be tracked in locations recognizable by the vision sensor/
16 '(8) Place the vision sensor in the "online" status/
17 '(9) When the program stops, open program C1 with T/B/
18
MWKNO= PRM1.X
19
MENCNO= PRM1.Y
20 'Establish a communication line with the vision sensor via the opened port
21
NVClose
22
NVOpen CCOM$ As #1
23
Wait M_NvOpen(1)=1
24
EBRead #1,"",MNUM,PVS1,PVS2,PVS3,PVS4 'Acquire data of one recognized workpiece
25
P_101(MWKNO)=PVS1
26
ME1#= M_Enc(MENCNO)
27
NVClose #1
28 Hlt
29 '(10) Move a workpiece on the conveyer until it gets within the robot operation area/
30 '(11) Move the robot to the suction position/
31
ME2#= M_Enc(MENCNO)
32
P_100(MWKNO)= P_Fbc(1)
33 '(12) Perform step operation until END/
34
MED#=ME2#-ME1#
35
If MED# > 800000000.0# Then MED# = MED#-1000000000.0#
36
If MED# < -800000000.0# Then MED# = MED#+1000000000.0#
37
M_101#(MWKNO)=MED#
38
P_102(MWKNO)= PRM1
39
P_103(MWKNO)= PRM2
40
C_100$(MWKNO)= CCOM$
41
C_101$(MWKNO)= CPRG$
42 End
43 '
44 'This program is "the relation between the workpiece position recognized by the network vision sensor and
45 ' the position at which the robot suctions workpieces.
PRM1=(+1.00,+1.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00)(0,0)
PVS1=(+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00)(0,0)
PVS2=(+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00)(0,0)
PVS3=(+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00)(0,0)
PVS4=(+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00)(0,0)
PRM2=(+170.00,+30.00,+0.00,+0.00,+0.00,+0.00,+0.00,+0.00)(0,0)
: C1.prg
'Set the number of the port to be opened
'Set the vision program name
'Acquire the model number
'Acquire the encoder number
'Close communication line
'Open communication line and log on
'Wait to log on to the vision sensor
'Acquire data of the first recognized workpiece
'Acquire encoder data 1
'Acquire encoder data 2
'Acquire position 1
'Calculate the amount of encoder movement
'Amount of encoder movement
'Encoder number
'Image size and workpiece size
'COM port number
'Vision program name
21 Appendix
Sample Programs 21-135

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents