DenisFR
1
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?
It might be possible using PC SDK, but I’m not sure why you would want to.
DenisFR
3
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:
<SmartComponent name="SmartComponent1" icon="SmartComponent1.png"
codeBehind="SmartComponent1.CodeBehind,SmartComponent1.dll"
canBeSimulated="false">
<Properties>
<DynamicProperty name="Controller" valueType="ABB.Robotics.RobotStudio.Stations.RsIrc5Controller" />
<DynamicProperty name="RapidValue" valueType="System.Double"/>
</Properties>
<Bindings>
<PropertyBinding source="Controller" target="rapidVariable1.Controller"/>
<PropertyBinding source="rapidVariable1.Value" target="RapidValue"/>
</Bindings>
<Connections>
<IOConnection source="GetValue" target="rapidVariable1.Get"/>
</Connections>
<Signals>
<IOSignal name="GetValue" signalType="DigitalInput" autoReset="true"/>
</Signals>
<GraphicComponents>
** <EmbeddedLibrary name="rapidVariable1" source="%ABBLIBRARY%\Components\RapidVariable.rslib">**
** <PropertyValue name="DataType" value="num"/>**
** <PropertyValue name="Task" value="T_ROB1"/>**
** <PropertyValue name="Module" value="Module1"/>**
** </EmbeddedLibrary>**
</GraphicComponents>
<Assets>
<Asset source="SmartComponent1.dll"/>
</Assets>
</SmartComponent>
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:
public override void OnPropertyValueChanged(SmartComponent component, DynamicProperty changedProperty, Object oldValue)
{
SmartComponent rapidVariable = component.GraphicComponents["rapidVariable1"] as SmartComponent;
rapidVariable.Properties["..."].Value = ...
}
Johannes