ModPos on SDK
pandreuw
✭
Hi,
I am using the FP sdk 5.14, and I am starting doing my own tests using the C#.
I just want to know if there is a simple way to modify a robtarget.
I just want to know if there is a simple way to modify a robtarget.
I read the manual and we have two options: the Modify Position Method and another one that I found more ad hoc to my needs is using the "WriteItem" instruction.
The Modify Position Method looks very simple but it is not helpfull for me because this only works only on MoveL or MoveJ instructions and not on the Data declaration.
My robot solution consist in load a module that belongs to a product. When a new product has to run on the line, the robot has to load a new module with the new robtargets. This modules have all declaration of Robtargets.
So to solve this I used the writeitem instruction to write directly on the robtarget but this has to be an array, here it is the piece of code:
Task t;
RobTarget robP;
Controller c = new Controller();
RapidData rdRobtarget = c.Rapid.GetRapidData("T_ROB1", "gwMain", sRobTargetEnabled);
t = c.Rapid.GetTask("T_ROB1");
RobTarget robP;
Controller c = new Controller();
RapidData rdRobtarget = c.Rapid.GetRapidData("T_ROB1", "gwMain", sRobTargetEnabled);
t = c.Rapid.GetTask("T_ROB1");
try
{
{
MotionSystem ExAxPosition = c.MotionSystem;
MechanicalUnit mech = ExAxPosition.GetActiveMechanicalUnit();
robP = mech.GetPosition(CoordinateSystemType.Base);
robP.Extax.Eax_a = GetExternalAxis(t).Eax_a;
rdRobtarget.WriteItem(robP, 1);
UpdatePosLb(sRobTargetEnabled);
}
MechanicalUnit mech = ExAxPosition.GetActiveMechanicalUnit();
robP = mech.GetPosition(CoordinateSystemType.Base);
robP.Extax.Eax_a = GetExternalAxis(t).Eax_a;
rdRobtarget.WriteItem(robP, 1);
UpdatePosLb(sRobTargetEnabled);
}
On my rapid data I made a robtarget array to use the code above posted. It also made the modpos for an external axis.
Ok my question again is: Is there an easy way to modpos a robtarget?
Am I on the correct way?
Thanks in Advance!!!
just gelalo
0
Answers
-
I found a better way!just gelalo0
-
Hi Pandreuw,
What method did you use?
0
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)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings