Denso RC5 Dokumentacja Strona 71

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 692
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 70
Chapter 2 Program Flow
2-9
2.4.4 Sample Application
In this section, a practical program sample is illustrated as a simple application
that uses serial communication. Refer to this sample for practical application.
In this sample application the robot controller counts the number of motions
and transmits the data for these motions at fixed intervals. On the personal
computer side, the data for the number of motions sent from the robot
controller is received. The program in the robot controller is described using
the PAC language. Visual Basic is used for an example of the personal
computer.
If the programs shown in “2.4.4.1 Robot Controller Program” and “2.4.4.2
Personal Computer Program” are prepared in the robot controller and in the
personal computer respectively and then run, the number of robot motions will
be transmitted through the RS232C circuit and received by the personal
computer.
2.4.4.1 Robot Controller Program
Figs. 2-7 and 2-8 show examples of programs in the robot controller. These
two programs execute multitasking operation.
The program “PRO1” first initializes the counter and the coordinates and then
concurrently runs the “PRO2”. In the “PRO1” the robot executes the reciprocal
motion between “P2” and “P1.” During this operation the “PRO2” sends the
number of robot motions stored in variable I[1] every 2 seconds (2000
milliseconds) through the RS232C port (ch2).
'!TITLE ”Robot motion”
PROGRAM PRO1
I1=0 ' Clears the count.
P1=(370,400,750,-90,90,0,5) ' Sets the coordinate.
P2=(510,400,750,-90,90,0,5) ' Sets the coordinate.
RUN PRO2 ' Concurrently runs task.
TAKEARM ' Obtains robot control
' priority.
DO
MOVE P,P2 ' Moves to point P2.
DELAY 1000 ' Waits 1 second.
MOVE P, P1 ' Moves to point P1.
I1=I1+1 ' Counts the number
' of movements.
LOOP ' Executes loop.
END
Fig. 2-7 Program “PRO1” “Robot Motion” of the Robot Controller
Przeglądanie stron 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 691 692

Komentarze do niniejszej Instrukcji

Brak uwag