I have an application where a UR is in a manufacturing cell. The cell produces many (>1000) variants of parts as part of a production order and as defined by the production order.
In the general case the robot behaviour can be controlled by sending information (dimensions) about the current part from the cell control PLC via Modbus. However there are a subset of programs (cannot quantify how many at this stage) that require more unique behaviour and will have their own sub-program defined in the robot.
So how I would like to handle this is as follows:
Cell controller sends part number “partno” as string over Modbus2
UR program checks if there is a program in the UR controller with the program “partno”.urp
If the program exists then run the sub-program “partno”.urp
Otherwise run the general case sub-program
I cannot find anything that would allow me to search for the existence or absence of a program?
Even more concerning, it seems from other topics I have found, that calling sub-programs with the program name stored in a string variable rather than a hard-coded value is not possible? Hopefully these are old topics and it is now possible?
The Dashboard server is the only way I’m aware of to remotely load programs from an external controller. It’s done over socket, which isn’t always the easiest thing to setup on the PLC, so good luck. Dashboard Server
It’s lousy enough that others have made URCaps specifically to make this process easier: Products-Connect | Robot27 I’m not affiliated with this, and have never personally used it, I’ve just seen it pop up from time to time. Maybe it would work for you.
I have actually implemented a dashboard server in the HMI but thats not really what I was hoping to do in this instance.
My plan was to have a top level program that monitors Modbus registers from the PLC, one of the data fields received would be a string containing the part number. The top-level program would then need to check if a program exists with this name and if so run it as a sub-program, if it doesn’t exist it would run the generic routine based on other modbus values.
Plan B will have to be a long IF statement checking if the string containing the part number equals a specific value and then call the sub-programs from there. But this would be potentially very long and painful for the end user.
I can’t believe there is no way to call a program from a string variable in this day and age - traditional industrial robots have had this capability for decades!
A workaround is to have a program running constantly with a Switch node, which contains cases for each of the part numbers. Then, when a part program is called, the node can call/run the .urp program through the Call function.
This also allows you to make a Default case, which runs if the called program number case does not exist in the Switch node.
It has some other limitations such as you’re not allowed to use subprograms in the programs you’re calling from your main program, though (without some other workarounds at least).