SmartComponent - Identify embedded SmartComponent
Henry123
✭
Hi there,
I am using a SmartComponent "A" including an embedded SmartComponent "B" from ABB Library.
I want to change the property binding between "A" and "B". To do that, I need to identify the embedded SmartComponent "B".
Unfortunately, the following code does not work since "targetObjectName" seems to be wrong defined. Can anyone give me a push into the right direction?
I am using a SmartComponent "A" including an embedded SmartComponent "B" from ABB Library.
I want to change the property binding between "A" and "B". To do that, I need to identify the embedded SmartComponent "B".
Unfortunately, the following code does not work since "targetObjectName" seems to be wrong defined. Can anyone give me a push into the right direction?
if (changedSignal.Name == "Active" && changedSignal.Value.ToString() == "0")
{
string sourceObjectName = component.Name;
string targetObjectName = "GraphicSwitch";
Station station = (Station)component.ContainingProject;
ProjectObject sourceObject = null;
sourceObject = station.FindObjects(obj => obj.Name == sourceObjectName, obj => true)?.FirstOrDefault();
ProjectObject targetObject = null;
targetObject = station.FindObjects(obj => obj.Name == targetObjectName, obj => true)?.FirstOrDefault();
PropertyBinding propBindHigh = new PropertyBinding(sourceObject, "PartHigh", targetObject, "PartHigh");
PropertyBinding propBindLow = new PropertyBinding(sourceObject, "PartLow", targetObject, "PartLow");
station.Bindings.Remove(propBindHigh);
station.Bindings.Remove(propBindLow);
}
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