.jpg?sfvrsn=3ad09b0a_1)
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
- 10.4K All Categories
- 5.3K RobotStudio
- 346 UpFeed
- 15 Tutorials
- 8 RobotApps
- 281 PowerPacs
- 404 RobotStudio S4
- 1.7K Developer Tools
- 238 ScreenMaker
- 2.6K Robot Controller
- 246 IRC5
- 36 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 691 RAPID Programming
- 14 Wizard Easy Programming
- 101 Collaborative Robots
- 3 Job listings