Install MATLAB URCap for External Control
MathWorks® provides a URCap file named
                matlab_externalcontrol-1.0.0.urcap, which allows external control
            for the Universal Robots UR Series cobots. The source files are located at the
                GitHub® location MATLAB-URCap-for-External-Control.
- Download - matlab_externalcontrol-1.0.0.urcapfrom here, corresponding to your MATLAB® release to your local computer. After downloading, copy the file to a USB flash drive. 
- Remove the USB flash drive from the host computer and insert it to USB port of the Teach Pendant.  
- In the graphical interface of Teach Pendant, click the toggle menu at the top right corner, select Settings, and then select System > URCaps.  
- Click the plus sign at the bottom of the interface to open the file selector.  
- In the file selector, select the - matlab_externalcontrol-1.0.0.urcapfile from the USB flash drive, and click Open. The URCaps view is updated to display MATLAB URCap for External Control in the list of Active URCaps. 
- A notification to restart the robot appears. Reboot the robot now. 
- After the reboot, select the program menu and select Installation tab. The MATLAB URCap for External Control configuration appears on the screen.  
- Enter the IP address of the external PC which will be running the ROS driver ( - 192.168.1.100, as per one of the previous steps). The robot and the external PC must be in the same network. You can leave the custom port at its default value.
- To use the new URCaps, create a new program and insert the MATLAB URCap for External Control program node into the program tree.  
- If you click on the command tab again, you can see the settings entered inside the Installation screen. Verify that they are correct, then save the program. 