Connecting to a Fanuc robot controller
1. About the plugin
The Fanuc Robot plugin allows you to connect to a Fanuc robot controller during simulation and exchange data. For example, a program running in a virtual or physical Fanuc controller can drive the joints of a Fanuc robot in a simulation, read data from sensors, and set outputs for picking and placing products.
The plugin is associated with the Connectivity feature of Visual Components Premium 4.9, and it can connect to one or more Fanuc robot controllers. The simplified workflow is the following:
- Add server
- Connect to the server
- Map variables
- Run the simulation
2. Read and Write Support
Read and Write table
Type | Read | Write | Notes |
Robot controller digital and analog inputs and outputs |
Yes |
Yes | |
Robot arm digital inputs and outputs | No | No | |
System variables of basic types (boolean, integer, real, string) |
Yes |
Yes |
The value range is constrained. Aso, the string length is constrained by the max length of a system variable |
Current joint values from any motion group |
Yes |
No |
Paired variables in Simulation to Server direction:
When digital or analog inputs and outputs (IOs) are paired, those paired IOs are automatically set to simulated mode on the robot controller.
- The values written through the API are now applied and visible to the robot programs
- Event-based update mode is recommended
- The IOs are not automatically reset to the initial state before simulation runs, and user needs to do that from the teach pendant
- Roboguide has a user interface for viewing and setting IO values. This doesn't work with IOs in simulated mode, but the teach pendant can show and set the state of simulated IOs.
Paired variables in Server to Simulation direction:
Only cyclic updates are supported. If the server to simulation transmit direction is set to Event-based mode, you will receive the connectivity error message in the Output panel.
The cyclic reading and writing are optimized by using the Scattered Access feature of the FANUC API/PC DK.
- Automatically reads and writes as many variables as possible while using a single request
The plugin uses one communication thread per variable group for lower latency. Note that if the same variable is paired to more than one variable, the variable might change multiple times or be lost. This is because the updates might overlap or undo the change done by another update.
The communication speed with a local virtual robot controller (the Fanuc robot server) is rather efficient. However, the speed might vary based on the simulation load and the robot controller.
3. Requirements
The connection requires Visual Components Premium and Fanuc Robot Server software to be installed on the same machine. See the following options:
Option 1 - Visual Components Premium 4.9 Premium + Fanuc PC DK:
- PC DK option #A08B-9410-J535 (Fanuc Robot PC Developer’s Kit)
- PC DK includes Fanuc Robot Server
Option 2 - Visual Components Premium 4.9 Premium + Fanuc Robot Server:
- Robot Server option # A08B-9410-J536 (Fanuc Robot PC Developer’s Kit Runtime Library)
Option 3 - Visual Components Premium 4.9 Premium + Fanuc :
- Roboguide (A08B-9410-J688)
- PC DK option # A08B-9410-J535 (Fanuc Robot PC Developer's Kit) / Robot Server option # A08B-9410-J536
Note that the Fanuc robot controller requires a PC interface option to support the connection with the plugin.
4. Setup
- Check that your host machine meets the requirements.
- Access the Fanuc controller.
The plugin connects to the robot controller, so the virtual or physical robot controller should be accessible via a direct network connection (IP address) or robot neighborhood. For example, it is enough to have a project open in Fanuc RoboGuide and the virtual robot controller running. - In Visual Components Premium 4.9, add a new server with the plugin and connect to the controller.
Tip: If you are using a virtual robot controller running in RoboGuide, by default, it will have the IP address of the host machine of RoboGuide. - Map the variables.
For example, map the VALUE property of each degree of freedom (DOF)/Joint of the robot component to a joint of the controller. This way, the controller drives the robot in the 3D world.
For simulating actions such as grasp/release, map the outputs of the robot component for those actions to the IO of the controller you will use for those actions. - Run the simulation.
Simulate to start the exchange of data. Note that in the Connected Variables panel, the Prepared Values column can be used to set values for testing.
5. Error Handling
- If the connection to the controller is lost, the exchange of data will stop. The plugin expects an event to be received from the controller in such cases.
- Any exceptions thrown during the browsing of the connected controller’s variables (Digital Input, Digital Output, etc.) will be caught, logged to an error log file, and handled by returning an empty set of tree nodes instead. These exceptions will result in no variables of the robot controller being displayed in the Create Variable Pairs editor.
- If the connection to the controller is lost, reconnect to the controller.
- If the server structure of the connected controller is empty or not showing up-to-date data in the Create Variable Pairs editor, try reconnecting to the controller and reload the server structure. If this does not work, disable/re-enable the variable group.
- The system variables are loaded level-by-level based on demand from the controller.
- Browsing the whole system variables structure may take up to 5-10 minutes. Note that there are thousands of system variables. If the connection is lost while actively browsing, the browsing for each level will fail separately whenever Visual Components Premium 4.9 tries to access the child nodes. When you try to access unseen children of each already discovered node, each will produce an exception logged to the error log file. This can lead to, for example, 100 logged exceptions.
- You do not get a separate error message when browsing has encountered an error. The tree might be incomplete, and the error log file will have some logged exceptions. Note that connection loss produces error messages to the output window, and other errors are not expected.