Writing Your First Program
After installing the Controller and robot, and installing the Epson RC+ software on the PC, follow the procedure below to create a simple application program so that you will become more familiar with the Epson RC+ development environment.
Start Epson RC+.
Double click the <Epson RC+> icon on the Desktop. You can also select from the Windows menu.Create a new project.
From the Epson RC+ menu, select [Project] - [New]. The [New Project] dialog box is displayed.
Type a project name in the [New Project Name] box. (e.g. FirstApp)
Click the [OK] button to create the new project.
When the new project is created, a program called Main.prg is also created.
A window titled Main.prg is displayed with a cursor flashing in the upper left corner. Now you are ready to start entering your first program.
Edit the program.
Type the following program lines in the Main.prg edit window.Function main Print "This is my first program" Fend
Run the program.
Press F5 to display the Run window. (F5 is the shortcut key for selecting [Run] - [Run Window] in the Epson RC+ menu.) At the bottom of the main window, the Status window appears indicating the build operation status.
During the project building process, your program is loaded into the memory and compiled. Then, the program and project files are sent to the Controller. If there are no errors during the building process, the Run window appears.
Click the [Start] button in the Run window to run the program.
Messages like the following are displayed in the Status window.
Task main started
All tasks stopped
The Run window shows the statement output.
Now let's teach some robot points to create a program that moves the robot.
KEY POINTS
Teaching of this procedure should be done outside the safeguard.
Teach robot points.
Confirm whether safe robot operation is possible. Click the [Robot Manager] button on the toolbar.
Turn on the motors.
2. Make sure that [Robot Manager] is displayed.Click the [Motor: Off] button.
You are prompted to confirm the operation.
Click the [Yes] button.
Click the [Jog & Teach] tab.
Teach point P0. Click the [Teach] button in the lower right corner of the screen. You are prompted for a point label and description.
Click the [+Y] jog button to jog the robot in the +Y direction. Hold the button down to keep jogging. Move the robot until it reaches around the middle of the work envelope.
Click the [-Z] button to lower the Z-axis of the robot.
Select "P1" in the [Point:] dropdown list, which is next to the [Teach] button. The current point is set to P1.
Click the [Teach] button. A confirmation message for teaching the point appears.
Click the [Yes] button.
Click the [+X] button to jog the robot in the +X direction.
Select "P2" in the [Point:] dropdown list, which is next to the [Teach] button. The current point is set to P2.
Click the [Teach] button. A confirmation message for teaching the point appears.
Click the [Yes] button.
Click the [Save Project] button on the toolbar to save the changes.
Modify the program to include robot motion commands.
Insert Go statements into the Main.prg program.
Function main Print "This is my first program." Go P1 Go P2 Go P0 Fend
Press F5 to display the Run window.
Click the [Start] button to execute the program.
The robot will move to the points that were taught.
Modify the program to change the speed of the robot motion commands.
Insert the Power, Speed, and Accel commands as shown in the program below.
Function main Print "This is my first program." Power High Speed 20 Accel 20, 20 Go P1 Go P2 Go P0 Fend
Press F5 to display the Run window.
Click the [Start] button to execute the program.
The robot will move to each of the points that were taught at 20% acceleration, and deceleration. The Power High statement executes the program to operate the robot with increased speed and acceleration/deceleration.
Back up the project and system settings.
Back up the project and the Controller settings of the created program. Backups can be made easily using Epson RC+. It is important to make and store regular backups of your applications onto external media such as a USB memory device.
Backup procedure for project and system settings:- From the Epson RC+ menu, select [Project] - [Copy].
- In the [Copy Project] dialog box, change the [Destination Drive] box to the desired drive.
- Click the [OK] button. The project is copied to the external media.
- From the Epson RC+ menu, select [Tools] - [Controller].
- Click the [Backup Controller] button.
- In the [Drive] box, select the desired drive.
- Click the [OK] button. The system settings are backed up to the external media.