18. Custom protocol slave commands

18.1. Overview

18.2. Industrial Bus Protocol Integration for Robot Motion Control

To facilitate PLC-based robot motion control through various industrial bus protocols (CC-Link IEF Basic, Profinet, Ethernet/IP, and EtherCAT), the integrated mini control cabinet has been equipped with FRH-PCIeN-EC/EIP/CC/PN-RJ-V10 cards, FRJ-PCIeN-EIP/CC/PN-RJ-V10 cards, and FRJ-PCIeN-EC-RJ-V10 cards.

18.3. Environment Configuration

The required card models and software versions are as follows:

Protocol Type

Board Model

Robot Software Version

CC-Link IEF Basic

FRJ-PCIeN-EIP/CC/PN-RJ-V10 Board

V3.8.4 and above

CC-Link IEF Basic

FRJ-PCIeN-EC-RJ-V10 Board

V3.9.5 and above

Profinet

FRJ-PCIeN-EIP/CC/PN-RJ-V10 Board

V3.8.4 and above

Profinet

FRJ-PCIeN-EC-RJ-V10 Board

V3.9.5 and above

Ethernet/IP

FRJ-PCIeN-EIP/CC/PN-RJ-V10 Board

V3.8.4 and above

Ethernet/IP

FRJ-PCIeN-EC-RJ-V10 Board

V3.9.5 and above

EtherCAT

FRJ-PCIeN-EC-RJ-V10 Board

V3.9.5 and above

18.3.1. FRH-PCIeN-EC/EIP/CC/PN-RJ-V10 board hardware environment setup

  1. Install the FRH-PCIeN-EC/EIP/CC/PN-RJ-V10 board into the integrated mini control box as shown.

../_images/0015.png

Figure 17.2-1 FRH-PCIeN-EC/EIP/CC/PN-RJ-V10 board installation

../_images/0025.png

Figure 17.2-2 FRH-PCIeN-EC/EIP/CC/PN-RJ-V10 board network port

  1. The robot control box and PLC wiring is shown below.

../_images/0035.png

Figure 17.2-3 Control Box & Mitsubishi PLC Wiring Diagrams

../_images/0045.png

Figure 17.2-4 Control Box & Siemens PLC Wiring Diagrams

../_images/0055.png

Figure 17.2-5 Control Box & Omron PLC Wiring Diagrams

../_images/0065.png

Figure 17.2-6 Control Box & Omron PLC Wiring Diagrams

Note

1: Robot control box (board input network port); 2: Switch; 3: PC; 4: Mitsubishi PLC (CC-Link IEF Basic network port); 5: Siemens PLC (Profinet network port); 6: Omron PLC (Ethernet/IP network port); 7: Omron PLC (EtherCAT network port);

Important

When the protocol is switched to EtherCAT bus, the board’s network port needs to be distinguished as EtherCAT_IN and EtherCAT_OUT. At this time, the PLC’s EtherCAT network port is directly connected to the board’s EtherCAT_IN through a network cable.

18.3.2. FRJ-PCIeN Board Hardware Setup

  1. Install the board into the integrated mini control box as shown.

../_images/0443.png

Figure 17.2-7 FRJ-PCIeN Board Ethernet Port

  1. Wiring between robot control box and PLC is shown below.

../_images/0035.png

Figure 17.2-8 Control Box & Mitsubishi PLC Wiring Diagram

../_images/0045.png

Figure 17.2-9 Control Box & Siemens PLC Wiring Diagram

../_images/0055.png

Figure 17.2-10 Control Box & Inovance PLC Wiring Diagram

Note

1: Robot control box (board Ethernet port); 2: Switch; 3: Laptop PC; 4: Mitsubishi PLC (CC-Link IEF Basic port); 5: Siemens PLC (Profinet port); 6: Inovance PLC (Ethernet/IP port);

18.3.2.1. FRJ-PCIeN-EIP/CC/PN-RJ-V10 Board Firmware Upgrade

When switching protocols on the board, a firmware upgrade is required. During the firmware upgrade, the IP address of the board and the IP address of the laptop PC must be configured on the same network segment. Then, open the “Gateway Tool Set” software -> select the PC network card device to be connected -> click the “Start” button in the lower right corner -> click the “Search” button in the upper right corner to search for the board device.

../_images/0453.png

Figure 17.2-11 Connecting Board Device

Click “Upgrade” (bottom left)
  • Select board device

  • Click “…” (top right) to choose protocol firmware

  • Click “Upgrade” and wait for completion

../_images/0463.png

Figure 17.2-12 Board Protocol Switching

Note

IP address changes after protocol switching as shown below.

Table 17.2-1 Board IP Addresses

Protocol

IP Address

CC-Link IEF Basic

192.168.0.113

Ethernet/IP

192.168.0.112

Profinet

192.168.0.2

When configured for CC-Link IEF Basic, controller changes board IP to “192.168.0.113”.

When configured for Ethernet/IP, controller changes board IP to “192.168.0.112”.

When switching to Profinet, if slave device name matches master, master will automatically configure slave IP.

18.3.2.2. FRJ-PCIeN-EC-RJ-V10 Board Firmware Upgrade

Enter the robot interface via the URL 192.169.58.2, then click “Initial Settings” -> “Peripherals” -> “Board Communication” to obtain the firmware version number of the FRJ-PCIeN-EC-RJ-V10 board. Select the bin file to be upgraded, click Upload, wait for the firmware upgrade to complete, and then restart the control box.

../_images/0643.png

Figure 17.2-13 Board Firmware Upgrade

Note

To upgrade the firmware of the FRJ-PCIeN-EC-RJ-V10 board, the running open protocol must be unloaded first.

18.3.3. Software environment setup

  1. Browser IP input 192.168.58.2, account for admin, password for 123, click ‘Login’, enter the robot control box Web interface.

../_images/001.png

Figure 17.2-14 Web Login Interface

  1. Click System Settings -> About Interface, click the Software Upgrade button, select the software.tar.gz file, and upload the upgrade package.

../_images/0083.png

Figure 17.2-15 Upgrade software

Note

QX control box web version needs 3.8.0 and above, LA control box web version needs 3.8.0 and above.

  1. Click the extension button in the upper right corner and switch from ‘Local Mode’ to ‘Remote Mode’.

../_images/0103.png

Figure 17.2-16 Switch remote mode

  1. Select the controller slave protocol and whether the auto-start function is required, then click the “Set” button. Note: To switch between different protocols, you need to click the “Uninstall” button first before configuring other protocols.

../_images/0113.png

Figure 17.2-17 Configure the communication protocol

Note

Switching different protocols requires restarting the control box before configuring the protocols.

18.3.4. PLC Environment construction

The test environment built to implement the slave commands for each protocol is shown in the table below, which includes the PLC model, firmware version and test software used in each protocol.

Protocol

Brand

Type

Firmware

Software

Profinet

Siemens

CPU 1515-2 PN

6ES75152AM020AB0

TIA Portal V17

CC-Link IEF Basic

Mitsubishi

FX5S-30TR/DS

30MR/ES V1.3

GX Works3 V1.097B

Ethernet/IP

Omron

MX102-1100

V1.3

Sysmac Studio V1.50

EtherCAT

Omron

MX102-1100

V1.3

Sysmac Studio V1.50

18.3.4.1. Siemens Profinet

  1. GSD file (XML file) importing

Open Siemens programming software TIA Portal V17, create a new PLC project, select ‘Devices and Networks’, and select ‘Hardware Catalogue’ on the right side to add PLC module by double clicking 6ES7 515-2AM02-0AB0 to add PLC module.

../_images/0123.png

In the TIA PORTAL software, select Options-> Manage Generic Station Description File (GSD) in the menu bar to install or remove a GSD file that has already been installed.

../_images/0133.png

As an example, to install the Herschel GSD file, select ‘Manage Generic Station Description File (GSD)’ as above, and the ‘Manage Generic Station Description File’ window will appear.

Select the folder where you want to install the GSD file from the ‘Source Path’, select one or more files to install from the list of displayed GSD files, and click the ‘Install’ button. Click the Install button as shown in the following figure.

../_images/0143.png

After successful installation, you can find the device with the installed GSD file in the hardware catalogue, other field devices, as shown in the figure below.

../_images/0153.png
  1. Executable programme

Open the project ‘QNXtest’.

../_images/0164.png

Compiler: Double-click on the left side of the project tree to enter ‘Devices and Networks’, right-click on the ‘PLC_1’ module, select Compile from the drop-down menu, and then select ‘Hardware and Software (Changes Only)’ from the stand-alone menu. Hardware and Software (Changes Only)’. After the compilation is completed, it will prompt ‘Compilation complete’ at the bottom of the software view.

../_images/0174.png ../_images/0184.png

Download the programme to the device: Double click on the left side of the project tree to enter the ‘Device and Network’, right click on the ‘PLC_1’ module, and select ‘Download to Device’ from the drop-down menu. ‘Download to Device’, “Hardware and Software (change only)”.

../_images/0193.png

Search and download devices: After the pop-up window, configure the PG/PC interface type as shown in the following figure, click Start Search, select the device that needs to download the programme, and click Download.

../_images/0203.png ../_images/0213.png

18.3.4.3. Inovance EtherCAT Configuration

  1. XML File Import

Open Inovance AutoShop programming software and create a new PLC project. Select “EtherCAT Devices” from the right toolbox:

../_images/0521.png

Right-click after selecting “EtherCAT Devices” to open the “Import Device XML” dialog. Locate the folder containing the card’s XML file. After successful import, the card name will appear under “EtherCAT Devices”. Close and reopen the project to complete the import process.

../_images/0531.png
  1. Variable Mapping

Double-click the variable table in the left toolbar. Create: - 256-byte input array (Soft element address: D0) - 256-byte output array (Soft element address: D200)

../_images/0541.png

Under “EtherCAT” in the left toolbar, double-click “Xone-PCIe-ECATs”. In the dialog, click “I/O Mapping”, then bind variable addresses by selecting from the variable table. Repeat sequentially for other addresses.

../_images/0552.png
  1. Program Download

Open the test program and change PLC IP from default “192.168.1.88” to “192.168.0.88”:

../_images/0562.png

Click “Modify IP/Device Name” and update both IP and gateway to “192.168.0.88”:

../_images/0572.png

Confirm modification by clicking “Yes” in the popup dialog when clicking “Modify IP”.

../_images/0582.png

After successful communication, download the PLC program.

../_images/0592.png

18.3.6. HMI setting (Profinet emulation)

  1. After opening the programme, click on ‘HMI_1[ktp700 Basic PN]’ in the project tree, and then click on ‘Online’→‘Simulation’→‘Start’ in the menu bar. Click ‘Online’→‘Simulation’→‘Start’ in the menu bar. Wait for the software to compile and simulate.

  2. The function after emulation is the same as the content of the Velcro screen (CC-Link IEF Basic). You can refer to the above content to set up.

../_images/0422.png ../_images/0433.png

18.4. Robot Slave Mode Operation Manual

18.4.1. Loading Slave Mode

Step 1: Open the WebApp, navigate to Initial Setup -> Peripherals -> Board Communication -> Manual Configuration.

../_images/0472.png

Figure 17.3-1 Board Communication Manual Configuration

First, configure the IP address of the FRJ-PCIeN board. If left blank, the board will use the default IP: 192.168.0.100 for startup configuration. Currently, IP configuration only applies to EIP and CC-Link IEF Basic protocols. For PN protocol, the IP is assigned by the PLC master station scanning slave devices.

Note

After changing the IP address on the page, you need to load the slave mode for the changes to take effect.

Select the required mapping functions for DI, DO, and AO (see Appendix 1). The parameters are defined as follows:

  • DI (Robot Control): The robot slave accepts external input signals and executes the mapped functions.

  • DO (Robot Status Output): The robot slave feeds back status signals to the master station.

  • AO (Robot Status Feedback): The robot slave feeds back status data to the master station. AO0~AO15 are signed integers (int16), and AO16~AO31 are single-precision floating-point numbers (float).

Step 2: Click the “Configure” button to generate the open protocol Lua file.

../_images/0482.png

Figure 17.3-2 Device Operation and Status

Note

The open protocol Lua file supports download and can be imported in the auto-configuration interface.

Example generated program:

 1local id = 3
 2local ctrlDI = {0, 0, 0, 0, 0, 0}
 3local funcDI = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 4local DOState = {0, 0, 0, 0, 0, 0, 0, 0}
 5local AOState = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 6-- Launch the board communication process
 7LoadFieldBusSlave()
 8sleep_ms(8000)
 9while(1) do
10   -- Set the DO status
11   CtrlBoxDO, CtrlBoxCO, CtrlBoxDI, CtrlBoxCI, errState, motionState, moveToOriginState, robotStartDoneState, modeChangeState, programStartStopState, emergencyState, reduceState, collision, enablestate, safetyStop0, safetyStop1, pauseState, interfereState = GetRobotFuncDOState()
12   DOState[1] = CtrlBoxDO
13   DOState[2] = CtrlBoxCO
14   DOState[3] = CtrlBoxDI
15   DOState[4] = CtrlBoxCI
16   local ctrlWord0 = 0
17   ctrlWord0 = SetBitWithIndex(ctrlWord0, 0, errState)
18   ctrlWord0 = SetBitWithIndex(ctrlWord0, 1, motionState)
19   ctrlWord0 = SetBitWithIndex(ctrlWord0, 2, moveToOriginState)
20   ctrlWord0 = SetBitWithIndex(ctrlWord0, 3, robotStartDoneState)
21   ctrlWord0 = SetBitWithIndex(ctrlWord0, 4, modeChangeState)
22   ctrlWord0 = SetBitWithIndex(ctrlWord0, 5, programStartStopState)
23   ctrlWord0 = SetBitWithIndex(ctrlWord0, 6, emergencyState)
24   ctrlWord0 = SetBitWithIndex(ctrlWord0, 7, reduceState)
25   DOState[5] = ctrlWord0
26   local ctrlWord1 = 0
27   ctrlWord1 = SetBitWithIndex(ctrlWord1, 0, collision)
28   ctrlWord1 = SetBitWithIndex(ctrlWord1, 1, enablestate)
29   ctrlWord1 = SetBitWithIndex(ctrlWord1, 2, safetyStop0)
30   ctrlWord1 = SetBitWithIndex(ctrlWord1, 3, safetyStop1)
31   ctrlWord1 = SetBitWithIndex(ctrlWord1, 4, pauseState)
32   ctrlWord1 = SetBitWithIndex(ctrlWord1, 5, interfereState)
33   DOState[6] = ctrlWord1
34   SetFieldBusDOState(DOState)
35
36   -- Set the AO status
37   mainErrCode, subErrCode, TCPSpeed, axisPos1, axisPos2, axisPos3, axisPos4, axisPos5, axisPos6, jointVelFeedback1, jointVelFeedback2, jointVelFeedback3, jointVelFeedback4, jointVelFeedback5, jointVelFeedback6, jointCurFeedback1, jointCurFeedback2, jointCurFeedback3,jointCurFeedback4,jointCurFeedback5,jointCurFeedback6, jointTorqueFeedback1, jointTorqueFeedback2,jointTorqueFeedback3,jointTorqueFeedback4, jointTorqueFeedback5, jointTorqueFeedback6, cartPosx, cartPosy, cartPosz, cartPosrx, cartPosry, cartPosrz = GetRobotFuncAOState()
38   AOState[1] = mainErrCode
39   AOState[2] = subErrCode
40   AOState[17] = axisPos1
41   AOState[18] = axisPos2
42   AOState[19] = axisPos3
43   AOState[20] = axisPos4
44   AOState[21] = axisPos5
45   AOState[22] = axisPos6
46   AOState[23] = cartPosx
47   AOState[24] = cartPosy
48   AOState[25] = cartPosz
49   AOState[26] = cartPosrx
50   AOState[27] = cartPosry
51   AOState[28] = cartPosrz
52   SetFieldBusAOState(AOState)
53   sleep_ms(10)
54
55   -- Set the DI status
56   -- Configure the DI function and update it in real-time
57   ctrlDI[1],ctrlDI[2],ctrlDI[3],ctrlDI[4],ctrlDI[5],ctrlDI[6] = GetFieldBusDIState()
58   funcDI[1] = ctrlDI[1]
59   funcDI[2] = ctrlDI[2]
60   funcDI[3] = GetBitWithIndex(ctrlDI[3], 0)
61   funcDI[4] = GetBitWithIndex(ctrlDI[3], 1)
62   funcDI[5] = GetBitWithIndex(ctrlDI[3], 2)
63   funcDI[6] = GetBitWithIndex(ctrlDI[3], 3)
64   funcDI[7] = GetBitWithIndex(ctrlDI[3], 4)
65   funcDI[8] = GetBitWithIndex(ctrlDI[3], 5)
66   funcDI[9] = GetBitWithIndex(ctrlDI[3], 6)
67   funcDI[10] = GetBitWithIndex(ctrlDI[3], 7)
68   funcDI[11] = GetBitWithIndex(ctrlDI[4], 0)
69   funcDI[12] = GetBitWithIndex(ctrlDI[4], 1)
70   funcDI[13] = GetBitWithIndex(ctrlDI[4], 2)
71   funcDI[14] = GetBitWithIndex(ctrlDI[4], 3)
72   funcDI[15] = GetBitWithIndex(ctrlDI[4], 4)
73   funcDI[16] = GetBitWithIndex(ctrlDI[4], 5)
74   SetRobotFuncDIState(funcDI)
75   local stopFlag = GetOpenLUAStopFlag(id)
76   if(stopFlag ~= 0) then
77      UnloadFieldBusSlave()
78      break
79   end
80   sleep_ms(10)
81end

Step 3: Click the “Load” button to load the robot slave mode.

../_images/0492.png

Figure 17.3-3 Loading Slave Mode

Note

After successfully loading the robot slave mode, the auto-start function is supported. To use remote mode, unload the slave mode first.

Step 4: Click the status bar button on the right to monitor DI, DO, AI, and AO interaction information. The parameters are as follows:

  • CtrlDO: Input signal value from the master device controlling the robot control box DO.

  • DI: Input signal value from the external master control.

  • DO: Output signal value fed back by the robot slave.

  • AI: Input value from the external master. AI0~AI15 are int16 type, and AI16~AI31 are float type.

  • AO: Output value from the robot slave. AO0~AO15 are int16 type, and AO16~AO31 are float type.

../_images/0502.png

Figure 17.3-4 DI, DO, AI, AO Interaction Information

Step 5:After loading is complete, you can use the Teach Program -> Communication Command -> Board Card to generate Lua commands for the board. This allows you to:

  1. Set Slave DO (Digital Output) and AO (Analog Output).

  2. Read Slave DI (Digital Input) and AI (Analog Input).

  3. Wait for Slave DI and AI signals.

../_images/0512.png

Figure 17.3-5 Board Lua Commands

Appendix 1: Slave Mode Address Mapping Table

18.5. Board Communication Cycle Configuration

18.5.1. FRJ-PCIeN-EIP/CC/PN-RJ-V10 Board

The communication cycle of the board can be configured via the host computer. Currently, only PN protocol firmware is provided, with future compatibility for EIP, CC-Link IE Basic, and EtherCAT protocols.

  1. Directly connect the PC (Windows 11 system) network port to the board’s network port. Open Device Assistant v1.1.0, double-click “Ethernet,” and click the “Refresh” button in the upper left corner to scan for currently connected board devices.

../_images/0602.png ../_images/0612.png
  1. In the firmware update interface, upload the new version of PN firmware and click the “Update” button. A prompt reading “Upgrade Successful” will appear in the lower left corner when printed.

../_images/0622.png
  1. Enter the desired communication cycle (supports 1~100ms) and click the “Set” button. A prompt reading “Cycle Setting Successful” will appear in the lower left corner when printed.

../_images/0632.png

18.5.2. FRJ-PCIeN-EC-RJ-V10 Board

Enter the robot interface via the URL 192.169.58.2, then click “Initial Settings” -> “Peripherals” -> “Board Communication” to obtain the board communication cycle. Enter the required communication cycle (1~100 ms), click the “Configure” button, wait for the configuration to complete, and then restart the control box.

../_images/0643.png

Note

To configure the communication cycle of the FRJ-PCIeN-EC-RJ-V10 board, the running open protocol must be unloaded first.

18.6. Appendice

18.6.1. Instruction List

Command code

Command description

0x1000

Robot enablement

0x1001

Reset all error

0x1002

Robot stops moving

0x1003

Read actual position

0x1004

Set robot speed

0x1005

Resume robot motion

0x1006

Robot pauses motion

0x1007

Calculate the Cartesian position from the joint position

0x1008

Calculate joint position from Cartesian position

0x2000

Write tool information

0x2001

Read tool information

0x2002

Write workpiece information

0x2003

Read workpiece information

0x2004

Write load information

0x2005

Read load information

0x2006

Write reference dynamic information

0x2007

Read reference dynamic information

0x2008

Write default dynamic information

0x2009

Read default dynamic information

0x2010

Write soft limit information

0x2011

Read soft limit information

0x3000

MoveAxes (based on joint angle)

0x3001

MoveLinear

0x3002

MoveDirect (based on Cartesian coordinate system)

0x3003

jog motion

0x3004

jog stop