RobotStudio event

Get Rapid Data on own SmartComponent

Options
Hello,
I see that a new builtin SmartComponent was added in 6.06 that can read Rapid Data:
https://robotstudiotemp.blob.core.windows.net/installers/RobotStudio.6.06.News.RN.pdf

Is it possible to do the same in own SmartComponent with RobotStudioSDK?


Comments

  • It might be possible using PC SDK, but I'm not sure why you would want to.
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • DenisFR
    Options
    I want to make a SmartComponent to graphically represents some calculated data in RAPID.
    Can we use PC SDK in SmartComponent?
  • You can, but I would recommend leveraging the existing functionality.

    You can embed a base component in your smart component from xml like this:
    &nbsp;&nbsp;<SmartComponent name="SmartComponent1" icon="SmartComponent1.png"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;codeBehind="SmartComponent1.CodeBehind,SmartComponent1.dll"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;canBeSimulated="false"><br>&nbsp;&nbsp;&nbsp;<Properties><br>&nbsp;&nbsp;&nbsp;&nbsp;<DynamicProperty name="Controller" valueType="ABB.Robotics.RobotStudio.Stations.RsIrc5Controller" /><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <DynamicProperty name="RapidValue" valueType="System.Double"/><br>&nbsp;&nbsp;&nbsp;</Properties><br>&nbsp;&nbsp;&nbsp;<Bindings><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <PropertyBinding source="Controller" target="rapidVariable1.Controller"/><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <PropertyBinding source="rapidVariable1.Value" target="RapidValue"/><br>&nbsp;&nbsp;&nbsp;</Bindings><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <Connections><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <IOConnection source="GetValue" target="rapidVariable1.Get"/><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </Connections><br>&nbsp;&nbsp;&nbsp;<Signals><br>&nbsp;&nbsp;&nbsp;&nbsp;<IOSignal name="GetValue" signalType="DigitalInput" autoReset="true"/><br>&nbsp;&nbsp;&nbsp;</Signals><br>&nbsp;&nbsp;&nbsp;<GraphicComponents><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <EmbeddedLibrary name="rapidVariable1" source="%ABBLIBRARY%\Components\RapidVariable.rslib"></b><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <PropertyValue name="DataType" value="num"/></b><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <PropertyValue name="Task" value="T_ROB1"/></b><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <PropertyValue name="Module" value="Module1"/></b><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </EmbeddedLibrary></b><br>&nbsp;&nbsp;&nbsp;</GraphicComponents><br>&nbsp;&nbsp;&nbsp;<Assets><br>&nbsp;&nbsp;&nbsp;&nbsp;<Asset source="SmartComponent1.dll"/><br>&nbsp;&nbsp;&nbsp;</Assets><br>&nbsp;&nbsp;</SmartComponent><br>
    As you see you can also initialize property values and set up connections and bindings to the embedded component.

    If you need you can also access the embedded component from code behind:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public override void OnPropertyValueChanged(SmartComponent component, DynamicProperty changedProperty, Object oldValue)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SmartComponent rapidVariable = component.GraphicComponents["rapidVariable1"] as SmartComponent;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rapidVariable.Properties["..."].Value = ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>

    Johannes
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics