| Sensor Model | All |
| Firmware Version (GoPxL) | 1.x |
| SDK Version | 1.x |
Overview
This document outlines how to establish EtherNet/IP communication between a FANUC robot controller and a Gocator sensor. This integration works for GoPxL. The advantage of this integration is that it allows direct communication between the Fanuc controller and the sensor. This eliminates the need for a "middle man" such as a PLC.
Sensor Setup
Our sensor is set up in the following manner.
- Sensor IP: 127.0.0.1 (local host). This can be configured to whatever IP suits your network.
Fig 1. GoPxL manager instance IP settings.
- Protocol: EtherNet/IP
- Scan output configured with a stamp message before first measurements. The stamp can be removed if the stamp information is not useful for your integration.
For testing, it is nice to have a script tool present in your Gocator toolchain. This allows test measurement outputs to be sent to verify the EtherNet/IP connection is working properly.
Fig 2. Script tool simulating measurement output.
Fig 3. GoPxL EtherNet/IP sensor settings.
Fig 4. Ensure proper outputs are added in our GoPxL settings. Important to have Stamp first to follow this integration guide.
FANUC Settings Setup
To establish communication with the Gocator sensor, the proper settings need to be configured on the FANUC side. The first thing we will configure is the EtherNet/IP settings. The section below outlines the setting location and settings parameters that need to be configured.
Firstly, ensure that EtherNet/IP is enabled on your FANUC robot controller. On FANUC robot controllers (such as the R-30iB series), the primary system variable to enable EtherNet/IP (EIP) I/O functionality is $EIP_ENBL_IO, which should be set to 1. For CNC controls, specific parameters like parameter 970 handle option enablement. If you are unable to enable EtherNet/IP, this could be an option code problem on your robot. You may need to contact FANUC to purchase the EtherNet/IP package to use this protocol.
On your FANUC teach pendant, the EtherNet/IP settings can be found at MENU > I/O > NEXT > EtherNet/IP
From there, select one of the connections to use for this integration. I recommend renaming this connection, and you must set the type to SCN (scanner).
Fig 5. Slot 1 changed to type SCN and renamed for Gocator communication.
Fig 6 & 7. EtherNet/IP settings needed to establish connection with GoPxL. Advanced settings must be configured first.
Once you have the settings input on the FANUC side. Ensure EtherNet/IP is enabled within GoPxL. Also ensure it is enabled on the FANUC side. Then perform a cold start on the controller. After the cold start, the status should change to "<RUNNING>" if the EtherNet/IP connection succeeds. If the connection fails, there should be errors indicating why the connection failed on the teach pendant.
Fig 8 & 9: EtherNet/IP enabled on Gocator and FANUC devices.
Cold Start can be performed on the teach pendant at: FUNCTION > NEXT > START MODE > COLD. After the cold start, verify the connection is running and there are no errors related to EtherNet/IP.
Fig 10. Confirm EIP is running after cold start of controller.
Pulling a Measurement Value to a Data Register
To do this, setting up Digital Inputs and Group Outputs relative to the sensor information you want to pass to the robot controller is a must.
For Digital Inputs, set the first available Digital Inputs to have the following settings. Mine starts at DI[1]; however, your start index can be different depending on what is free on your robot controller.
Fig 11. Digital Input config to pull measurement from Gocator. Measurements start at bit 289 because of the stamp message.
After changing these settings, it will require an additional restart of the robot controller. The start index will be 289; this is where measurement values begin after our stamp message. Bits 1-288 are the stamp information from the Gocator.
Why does it start at 288? This is because the stamp block is 36 bytes long. 36 x 8 = 288 bits.
Fig 12. Stamp size from EIP documentation. LINK
From there, a good test is sending a 0.001 (1 in microns) in the script tool. Notice how my first bit then changes for Digital Input number 1. All measurements are sent in microns, which is the reason this number was chosen to be sent.
Fig 13 & 14: Sending a 0.001 from the script tool (1 micron). And receiving 1 on the FANUC side DI[1].
Next, manually send a 0.002 (2 in microns) in the script. Notice how the second bit then changes for Digital Inputs representing the number 2. Again, this can be different depending on your Digital Input block allocation.
Fig 15. Sending a 0.002 from the script tool (2 microns). And receiving 1 on the FANUC side DI[2].
If you are unfamiliar with the concept being shown, it is binary math. LINK
So let's talk about how many Digital Inputs we have allocated for one measurement. As seen on the GoPxL EtherNet/IP output, we have a size of 4 bytes.
Fig 16. Measurement size shown in GoPxL EtherNet/IP Output.
Each byte represents 8 bits, meaning 4 x 8 = 32 bits. Meaning the max value we can send is a signed int, max and min of +/- 2,147,483,647 (2³¹ - 1)
Notice when I send this 2,147,483.647 the behavior in my Digital Inputs.
Fig 17. When sending 2,147,483.647 (2,147,483,647 microns), all but one Digital Input flips bit status.
Now that we understand how this works, four Group Inputs can be made. One Group Input represents a single measurement byte for one 32-bit measurement value. See screenshot below for my Group Input settings.
Fig 18. FANUC Group Input setting configuration.
This establishes each Group Input as one byte of input from the Digital Inputs. We can then use the newly made Group Inputs to pull a measurement value with a mixed logic teach pendant program. This program has to take into account 2's complement (for negative values) and overflow to do this robustly. This program uses four data registers to store data and perform math. In my case, registers 11-14. There are different ways to perform the same concept; however, this is purely for demonstration purposes.
Fig 19. Example Teach Pendant program for assembling a measurement value and converting from microns to millimeters.
This program will restore the original millimeter value in data register 14 after running it. Let's send some values over to show the functionality.
Fig 20. Value 500123.000 being sent from GoPxL Script tool over EtherNet/IP
Fig 21. After running the program, value 500123 received in FANUC data register 14
Fig 22. Value -500123.000 being sent from GoPxL Script tool over EtherNet/IP
Fig 23. After running the program, value -500123 received in FANUC data register 14
This section demonstrated how to pull a measurement value over to your FANUC controller from a Gocator sensor running GoPxL.
Starting a Sensor from a Robot TP Program
Please note this can be difficult to fully test with RoboGuide. RoboGuide can often be blocked by the firewall and needs specific IP configuration to work properly. Localhost cannot be used for validation of this.
To do this, we will need to configure our Digital Outputs and Group outputs in the FANUC teach pendant. Similar to before, the settings I used can be found below.
Fig 24. GoPxL command input data blocks. LINK
Fig 25. Digital Output setting configuration for FANUC. Each Digital output represents one section from the GoPxL command input.
Fig 26. Group Output setting configuration for FANUC. Group Input one represents the command sequence number. Group Input two represents the command identifier. Group Input three is an unused placeholder. All Group Inputs after represent the command arguments.
Based on the setup, we will want to use GO[1] for our command sequence identifier and GO[2] for the command identifier. The command identifier is how commands will be sent over to the sensor.
Fig 27. Renaming Group Outputs according to their use case.
Now that we have all of our Digital Outputs and Group Outputs properly configured, it is now possible to start sending commands over to the sensor. The snippet of the teach pendant program below shows how to start the sensor by sending over a "1" to the command identifier Group Output.
Fig 28. Snippet of teach pendant program showing how to start sensor scanning.
This section showed how to start sensor scanning from a teach pendant program using the EtherNet/IP protocol.
Comments
0 comments
Please sign in to leave a comment.