Procedure to Create a Project

In Epson RC+ 8.0 or later, a CODESYS Function Blocks library is installed in the following folder:

\EpsonRC80\Fieldbus\FunctionBlockLibraries\CODESYS

In this section, we will show how to create a simple example program to turn robot motors on and off.

  1. First, create a new project.

    1. Start the CODESYS, then click [New Project].

    2. Select [Projects]-[Standard project]. Enter a project name and save location, then click [OK].

    3. Select the appropriate device and [Ladder Logic Diagram] and click [OK].

    4. You have just created a new empty project.

  2. Now you need to import a CODESYS Function Blocks library in the new project.

    1. Double click [Library Manager].

      Then, click [Library Repository].

    2. Click [Install].

    3. Select the “SPEL_Library.compiled-library” file provided by Epson and click [Open].

      The file is in \EpsonRC80\Fieldbus\FunctionBlockLibraries\CODESYS folder.

    4. Make sure that there is “SPEL Library” in [Miscellaneous].

    5. Click [Add Library] in [Library Manager].

    6. Select [SPEL Library], then click [OK].

    7. Function Blocks are installed.

  3. Then, create a program.

    1. Double click [PLC_PRG] to display the program screen.

      Then, drag and drop three [Box] to the program screen.

    2. Click [???] in Box.

      Then, click [...] next to [???].

    3. Select [SPEL_Init] from the list of the Function Blocks, then click [OK].

    4. The name of the Function Block is displayed.

      Press the [Enter] key.

    5. The inputs/outputs of the Function Block are displayed.

      Press the [Enter] key.

    6. Auto declare screen is displayed.

      Click [OK].

    7. A variable is added automatically.

    8. Click [???] of the a contact (blue frame in the figure above) connected to Start.

      Then, enter a name of this contact. In this case we will use, “Start_Init_0”.

      Then, press [Enter] key.

    9. Auto declare screen is displayed. Click [OK].

    10. A variable is added automatically.

    11. Follow the same procedure to change all [???] as follows.

  4. Then, prepare to connect with a robot.

    1. Right click [Device], then click [Add Device].

    2. Select [EtherCAT Master], then click [Add Device].

    3. “EtherCAT_Master” is added.

      Select [Tools], then click [Device Repository].

    4. Click [Install].

    5. Select the configuration file according to the robot to be used.

      The configuration file is in the following folder:

      \EpsonRC80\Fieldbus\EtherCAT

      In this case we will select “EPSN_TSERIES_ECT_V2.3_for_OMRON_rev2.xml”, then click [Open].

    6. The configuration file has been read and “TSERIES EtherCAT Slave” is displayed.

    7. Right click [EtherCAT Master], then click [Add Device].

    8. Change “Vendor” to [SEIKO EPSON Corporation].

      Select [TSERIES EtherCAT Slave], then click [Add Device].

    9. Double click [TSERIES_Slave], then click [Process Data].

    10. Have the check boxes the same as the image below.

      Use “32byte” to communicate with controllers.

      (Before using, match the number of inputs/outputs bytes of the Fieldbus slave with setting values.)

  5. Execute Function Blocks.

    1. Right click the PLC on the PC task bar or system tray, then click [Start PLC].

      Check that the PLC display has changed.

    2. Double click [Device], then click [Communication Settings] - [Scan Network].

    3. Select the displayed device, then click [OK].

    4. Check that the color of device has changed to green.

    5. Double click [EtherCAT_Master], then click [General] - [Browse].

      Select a network adapter to be used, then click [OK].

    6. Select [Build], then click [Build].

      Check to make sure that there are no errors.

    7. Right-click [Application], then click [Add Object] - [Global Variable List…].

    8. Click the [Add] button.

    9. A global variable list is added.

      Change “VAR_GLOBAL” to “VAR_CONFIG”.

    10. Select [Declarations], then click [Add All Instance Paths].

    11. Change the currently set address to the address to be used.

      An example for changing is the image below, refer to “4.2.2 Address to Use” and enter a proper address after “AT.

    12. Select [Online], then click [Login].

    13. Select [Debug], then click [Start].

    14. Check that the green cycle is displayed on the left of “TSERIES_Slave”.

      Double-click the a contact of SPEL_Init, then “[TRUE]” is displayed.

      Then, right-click anywhere and click [Write All Values of ‘Device.Application’] to write values.

    15. When the Function Block execution is finished, Done changes to TRUE.

      Follow the same procedure to execute SPEL_MotorOn and SPEL_MotorOff.