Mitsubishi Electric CR800 Series Instruction Manual page 134

For industrial robot
Hide thumbs Also See for CR800 Series:
Table of Contents

Advertisement

15 Maintenance of robot program
TrRd (reading tracking data)
[Function]
Read position data for tracking operation, encoder data and so on from the data buffer.
[Format]
TrRd  <Position data> [ , [<Encoder data>] [ , [<Model number>] [ , [<Buffer number>] [ , [<Encoder number>] [ ,
[Pixel data] ] ] ] ] ]
[Terminology]
<Position data [Position]> (cannot be omitted):
Specify a variable that contains workpiece positions read from the buffer.
<Encoder data [double-precision real number]> (can be omitted):
Specify a variable that contains encoder values read from the buffer.
<Model number [integer]> (can be omitted):
Specify a variable that contains model numbers read from the buffer.
<Buffer number [integer]> (can be omitted):
Specify a number of a buffer from which data is read.
1 is set if the argument is omitted.
Setting range: 1 to 4(The first argument of parameter [TRBUF])
<Encoder number [integer]> (can be omitted):
Specify a variable that contains values of external encoder numbers read from the buffer.
<Pixel data [position]> (can be omitted):
Specify a variable that contains workpiece pixel positions read from the buffer.
[Reference program]
(1) Tracking operation program
1 TrBase P0
2 TrRd P1, M1, MK, 1, ME, P3 ' Read the workpiece position data from the data buffer.
3 Trk On,P1,M1
4 Mvs P2
5 HClose 1
6 Trk Off
(2) Sensor data reception program
1 *LOOP
2 If M_In(8)=0 Then GoTo *LOOP
3 M1#=M_Enc(1)
4 TrWrt P1, M1#,MK
(3) Vision data reception program
1 NVClose
2 NVOpen "COM2:" As #1
3 Wait M_NvOpen(1) = 1
4 NVLoad #1, "test"
5 NVTrg #1, 5, MTR1"
6 EBRead #1,"",MNUM,PVS1,PVS2,PVS3,PVS4 ' Acquire data of one recognized workpiece
7 MVsX = PV1.X
8 MVsY = PVS1.Y
9 MVsC = Deg(PVS1.C)
10 PosVS = PVSCal(1, MVsX, MVsY, MVsC)
11 TrWrt PosVS, MTR1#, 1, 1, 1, PVS1
15-122 MELFA-BASIC V or MELFA-BASIC VI instruction
' Specify the workpiece coordinate origin at the teaching position.
' Start tracking of a workpiece whose measured position is P1 and encoder
value at the time of measurement is M1.
' Setting the current position of P1 as P1c, make the robot operate while
following workpieces with the target position of Inv(P0) * P2.Add that to the
target location.And tracking.
' Close hand 1.
' End the tracking operation.
' Jump to *LOOP if input signal No. 8, to which a photoelectronic
sensor is connected, is OFF.
' Acquire data of encoder number 1 at the time when input signal
No. 8 is turned on and store it in M1#.
' Write workpiece position data P1, encoder value M1# at the time
an image is acquired and model number MK in the buffer.
' Close communication line
' Open communication line and log on
' Wait to log on to the vision sensor
' Load the vision program
' Imaging request + encoder value acquisition
' Acquire X data
' Acquire Y data
' Acquire the C data converted to the degree unit
' Acquire the position data changed from a pixel to a robot
coordinate
' Write data in the buffer

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr800-rCr800-qCr800-d

Table of Contents