Create UserDefined without connecting to controller
Lets say I have a RECORD in my controller like:
RECORD MyRecord
num value1;
string value2;
ENDRECORD
Now I want to create a UserDefined that resembles this record in my C# code without connecting to the controller (I know what's inside it, so I don't need to grab it from the controller). I know how to do it when connecting to the controller:
But how can I create the same UserDefined in just my C# code without connecting to the controller. I started by trying to clone a UserDefined like this (to get a feeling on how to create it from a DataNode):
RECORD MyRecord
num value1;
string value2;
ENDRECORD
Now I want to create a UserDefined that resembles this record in my C# code without connecting to the controller (I know what's inside it, so I don't need to grab it from the controller). I know how to do it when connecting to the controller:
RapidData data = _controller.Rapid.GetRapidData("T_ROB1", "MyRecord");
UserDefined userdef = (UserDefined)data.Value;
But how can I create the same UserDefined in just my C# code without connecting to the controller. I started by trying to clone a UserDefined like this (to get a feeling on how to create it from a DataNode):
DataNode node = userdef.ToStructure();
UserDefined userdef2 = new UserDefined();
userdef2.Fill2(node);
But this results in exception: "ABB.Robotics.Controllers.RapidDomain.RapidDataFormatException: 'String was not recognized as a valid UserDefined'"
Anybody know how to do this?
But this results in exception: "ABB.Robotics.Controllers.RapidDomain.RapidDataFormatException: 'String was not recognized as a valid UserDefined'"
Anybody know how to do this?
0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 783 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings