Attatching WorkObject to Smart Component
Hi,
I am creating a smart component[SC] using code behind. I create a work object of type RsWorkObject and use the SC's 'Attach' property to attach the workobject to the SC. After the SC is added to the station, and when I move it from its initial position to another position, I see that the SC moves, but the workobject doesn't.
How to ensure that the WObj is attached to the SC using code behind ?
My SC contains a mechanism, signals and properties.
Sample Code Snippet (as I am currently doing):
_workObject = new RsWorkObject();
_workObject.Name = "wobjName";
_workObject.RobotHold = false;
_workObject.Synchronize = true;
_workObject.StorageType = RapidStorageType.TaskPersistent;
//WorkObjectModel gives the position of the workobject
_workObject.UserFrame.X = mt_station.specificMachine.MachineGM.WorkObjectModel.X;
_workObject.UserFrame.Y = mt_station.specificMachine.MachineGM.WorkObjectModel.Y;
_workObject.UserFrame.Z = mt_station.specificMachine.MachineGM.WorkObjectModel.Z;
_workObject.UserFrame.RX = mt_station.specificMachine.MachineGM.WorkObjectModel.RX;// *System.Math.PI / 180;
_workObject.UserFrame.RY = mt_station.specificMachine.MachineGM.WorkObjectModel.RY;// *System.Math.PI / 180;
_workObject.UserFrame.RZ = mt_station.specificMachine.MachineGM.WorkObjectModel.RZ;// *System.Math.PI / 180;
Helper.ActiveTask.DataDeclarations.Add(_workObject);
// and attach the workobject to the smart component
SC.Attach(_workObject, false, Matrix4.Identity);
0
Categories
- All Categories
- 5.5K RobotStudio
- 395 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)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings