Universal Robots Forum

Sample: Script Wrapper URCap

Script Wapper URCap

Description of functionality:
This URCap wraps the contents of a selected script file into a program node in PolyScope.
The user can select which script file to wrap, and select a decent image to show instead.

User must place a script file (.script) and optionally image (.jpg, .jpeg, .png .bmp) in the /programs/ folder on a real robot, or /home/ur/ursim-current/programs/ in a URSim. The URCap checks the robots serial number, to decide what folder to look in.

The sample demonstrates how to wrap pre-written URScript into a URCap. How to read the serial number and find files on the file system. It also implements images and dropdowns.

It is suggested, that product that generate URScript code into a file, e.g. CAD/CAM software uses an approach like this, to wrap different modules of the script code into self-explanatory functional blocks for easier readability.

What topics are covered:
appendRaw, script file, image, select, dropdown, manage files, read script

URCaps SDK 1.1+

Hello Jacob,

Would it be possible to share this Script Wrapper URCap in the Swing user interface (your example is HTML).

Also, after I load the .script file, I plan to read through the script file, locate each movej command in the .script file, and place all the joint locations (following each movej command) into a dynamic array. Also, it would be great if you would provide a sample to do this. I do not need any of the image loading that you have in your Script Wrapper.