Reading the script manual for the set_tcp command, looks like you would need to spell out the TCP info and not just call the saved TCP
Example command: set_tcp(p[0.,.2,.3,0.,3.14,0.])
• Example Parameters:
• – pose = p[0.,.2,.3,0.,3.14,0.] → tool center point is set to x=0mm, y=200mm,
z=300mm, rotation vector is rx=0 deg, ry=180 deg, rz=0 deg. In tool coordinates
That part I understand, yet what we need is an option to pull these values from the installation TCP node.
For example : if I have manually taught 3x TCP’s - TCP1, TCP2, TCP3
And I set TCP1 as default TCP.
I would like to be able to either set different default TCP in program (like set TCP2 as default)
or
pull the values of TCP2 or TCP3, assign them to a variable or array and then use them with set_tcp() command.
Use case has 20x different TCP’s that need to be calibrated.
karlis,
It may be possible to access the TCP data with a URCap.
and pass it into an array or variables.
but I’m not an expert. @eric.feldmann
wrote a great TCP Selector URCap.
He might be able to point you in the right direction.
Your second approach is likely what you’ll have to do, minus the “pull the values” part. You’ll have to manually enter the data into the variables and assign them at the top of the function, for example. I’m not exactly sure on your use-case for needing it in URScript only (maybe you’re talking over Python or something), but you should be able to use a CAP to write the variables into your runtime script first thing, then anywhere else you use the set_tcp() command would be fine.
For example:
URCap creates an array in script that is size 20. It iterates through each TCP that it has access to the Installation Contribution and populates the URScript array. It writes this array immediately before program execution because URCap Installation Node contributions contribute their script before any program node. Now the array is accessible for the rest of the program execution.