Passing a mecunit as a parameter to a PROC
I have a few robots with external servos on the gripper and I want to write a PROC that all the robots can use, so I'm trying to pass a Mecunit as a parameter into a routine. I'm presented with a fault saying that a mecunit is not a value. Is there a clean way of passing a mecunit?
0
Comments
-
How about using a switch, then use function Present?Lee Justice0
-
I thought about that but I some robots have one external axis and some have 4 so I want to write a routine that I just feed the parameters and no matter how many axis it will be the same code.0
-
The switch is optional, you a.) don't pass any at all, b.) pass one or more or, c.) use them all if appropriate.Lee Justice0
-
IF Present(swMecUnit1) THEN
ActUnit MecUnit1;
Do whatever;
either another IF or ELSEIF
blah blah
ENDIFLee Justice0 -
Is there a way to read which mechanical unit is configured on the robot?0
-
Maybe, but I am almost done here for today. I can look tomorrow if you have not found out.Lee Justice0
-
I think I got it. I had to put a VAR in front of the data type
PROC EOATServo(var mecunit Servo,robtarget pTarget,num Speed)
0 -
Yup that's what it was0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings