RapidData / RobTarget exception when reading
Laro88
✭
I keep getting an exception that causes a crash in my app. Here is the exception:
ABB.Robotics.GenericControllerException: Invalid client id.
ved Adapters.Data.Get()
ved ABB.Robotics.Controllers.RapidDomain.RapidData.get_Value()
Here is the code ( compacted a bit )
RapidData rd;
RobTarget rt;
rd = theController.Rapid.GetRapidData("TaskSystem","SysMain","robtargetCurrentPos");
rd.ValueChanged+=new EventHandler<DataValueChangedEventArgs>(rd_ValueChanged);
rt = (RobTarget)rd.Value;
log.Debug("initialization rtCurrent was:"+rt.ToString()); //CRASH HERE
Basically I wish to read a robtarget from a task that updates the robtarget variable.... So this should not require mastership...
Laro882010-02-10 17:07:33
0
Comments
-
It appears that the read code somehow violates the Mastership requirement, don't know why though.
Here is some code that actually works without requiring mastership. Basically it only finds the RapidData and hooks up to its changed event.
Hookup snippet:
rd = theController.Rapid.GetRapidData("TaskX","ModuleY","robtargetZ");
rd.ValueChanged+=new EventHandler<DataValueChangedEventArgs>(rd_ValueChanged);
//Note that RapidData rd is declared in class scope to avoid destruction by mem cleanup.
Event reception snippet:
void rd_ValueChanged(object sender, DataValueChangedEventArgs e)
{
RobTarget rtChanged = (RobTarget)rd.Value;
Position p = new Position(rtChanged.Trans.X,
rtChanged.Trans.Y, ...........
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings