3.2.2.4. Starting the sample program
The test program is an example for establishing a data link between the robot and personal computer. COM3 is used.
(1) Using the teaching pendant or personal computer support software, register the following robot program with an
appropriate program name.
<Robot program>
1) Example for MELFA-BASIC V
1 OPEN "COM3:" AS #1
2 PRINT #1,"START"
3 *LOOP:INPUT #1,DATA
4 IF DATA<0 THEN GOTO *LEND
5 PRINT #1,"DATA=";DATA
6 GOTO *LOOP
7 *LEND:PRINT #1,"END"
8 END
(2) Start the personal computer data link program
Refer to section "4.2.1 Sample program for data link function" and create the execution file. (The created execution file will
be sample.exe.)
Start Windows Explorer, and double-click on sample.exe.
Set the IP address and port No., click on the connection check box, and open the communication line with the controller.
If the Send button is not validated, check that the IP address matches NETIP set with the controller.
If the button is still not validated, refer to section "2.3 Checking the connection", and check the connection cable or restart
the controller and sample.exe.
(3) Start the robot program.
Press the START button on the robot controller's operating panel, and start the robot program.
' Open as communication line COM3
' Send START character string
' Wait for reception of value in DATA variable
' If DATA is negative, jump to line 7 and end
' Reply DATA = value
' Jump to line 3 and repeat
' Send END character string
' End
3 Description of functions
3-11