Show / Hide Table of Contents

Class SmartComponentCodeBehind

Base class for code-behind that implements behavior of a SmartComponent.

Inheritance
object
SmartComponentCodeBehind
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public abstract class SmartComponentCodeBehind
Remarks

If the derived class implements IDisposable, Dispose() will be called when the object is no longer needed. If PerInstanceCodeBehind is true, this is when the corresponding Smart Component is deleted. Otherwise it is called when all Smart Components that use this code-behind class have been deleted.

Constructors

View Source

SmartComponentCodeBehind()

Declaration
protected SmartComponentCodeBehind()

Methods

View Source

OnIOSignalValueChanged(SmartComponent, IOSignal)

Called when the value of an I/O signal changes.

Declaration
public virtual void OnIOSignalValueChanged(SmartComponent component, IOSignal changedSignal)
Parameters
Type Name Description
SmartComponent component

Component that owns the changed signal.

IOSignal changedSignal

Changed signal.

View Source

OnInitialize(SmartComponent)

Called from InitializeCodeBehind().

Declaration
public virtual void OnInitialize(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Smart Component

View Source

OnLibraryReplaced(SmartComponent)

Called if the library containing the SmartComponent has been replaced

Declaration
public virtual void OnLibraryReplaced(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Smart Component

View Source

OnLoad(SmartComponent)

Called when the library or station containing the SmartComponent has been loaded

Declaration
public virtual void OnLoad(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Smart Component

View Source

OnPropertyValueChanged(SmartComponent, DynamicProperty, object)

Called when the value of a dynamic property changes.

Declaration
public virtual void OnPropertyValueChanged(SmartComponent component, DynamicProperty changedProperty, object oldValue)
Parameters
Type Name Description
SmartComponent component

Component that owns the changed property.

DynamicProperty changedProperty

Changed property.

object oldValue

Previous value of the changed property.

View Source

OnSimulationStart(SmartComponent)

Called when simulation is started.

Declaration
public virtual void OnSimulationStart(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Simulated component.

View Source

OnSimulationStep(SmartComponent, double, double)

Called when simulation steps to a new time.

Declaration
public virtual void OnSimulationStep(SmartComponent component, double simulationTime, double previousTime)
Parameters
Type Name Description
SmartComponent component

Simulated component.

double simulationTime

Time (in ms) for the current simulation step.

double previousTime

Time (in ms) for the previous simulation step.

Remarks

This method is called before the Virtual Controller time step and before robots are moved.

View Source

OnSimulationStepEndAsync(SmartComponent, double)

Called after simulation steps to a new time.

Declaration
public virtual Task OnSimulationStepEndAsync(SmartComponent component, double simulationTime)
Parameters
Type Name Description
SmartComponent component

Simulated component.

double simulationTime

Time (in ms) for the current simulation step.

Returns
Type Description
Task
Remarks

This method is called after the Virtual Controller time step and after robots are moved. It is allowed to return null if the method executes synchronously.

View Source

OnSimulationStop(SmartComponent)

Called when simulation is stopped.

Declaration
public virtual void OnSimulationStop(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Simulated component.

View Source

QueryCollection(SmartComponent)

Called to determine the objects contained by a SmartComponent that represents a collection.

Declaration
public virtual IEnumerable<ProjectObject> QueryCollection(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Component

Returns
Type Description
IEnumerable<ProjectObject>

Objects in the collection, or the component itself if it is not a collection.

View Source

QueryInternalConnections(SmartComponent, IOSignal)

Called to determine the output signals affected by an input signal.

Declaration
public virtual IEnumerable<IOSignal> QueryInternalConnections(SmartComponent component, IOSignal input)
Parameters
Type Name Description
SmartComponent component

Component

IOSignal input

Input signal

Returns
Type Description
IEnumerable<IOSignal>

Returns the output signals that are directly affected by the value of the input signal.

Remarks

This method is used to determine if an I/O connection can cause illegal cyclic behavior.

View Source

QueryPropertyAttributeValue(SmartComponent, DynamicProperty, string)

Called to retrieve the actual value of a property attribute with the dummy value '?'.

Declaration
public virtual string QueryPropertyAttributeValue(SmartComponent component, DynamicProperty owningProperty, string attributeName)
Parameters
Type Name Description
SmartComponent component

Component that owns the property.

DynamicProperty owningProperty

Property that owns the attribute.

string attributeName

Name of the attribute to query.

Returns
Type Description
string

Value of the attribute.

View Source

QueryPropertyValueValid(SmartComponent, DynamicProperty, object)

Called to validate the value of a dynamic property with the CustomValidation attribute.

Declaration
public virtual ValueValidationInfo QueryPropertyValueValid(SmartComponent component, DynamicProperty owningProperty, object newValue)
Parameters
Type Name Description
SmartComponent component

Component that owns the changed property.

DynamicProperty owningProperty

Property that owns the value to be validated.

object newValue

Value to validate.

Returns
Type Description
ValueValidationInfo

Result of the validation.

View Source

QuerySimulationState(SmartComponent)

Called to determine the state of a simulated component.

Declaration
public virtual SimulationActorState QuerySimulationState(SmartComponent component)
Parameters
Type Name Description
SmartComponent component

Simulated component.

Returns
Type Description
SimulationActorState

Simulation state of the component.

View Source

QuerySimulationStep(SmartComponent, double)

Called to determine the duration of the next time step during simulation.

Declaration
public virtual double QuerySimulationStep(SmartComponent component, double previousTime)
Parameters
Type Name Description
SmartComponent component

Simulated component.

double previousTime

Simulation time (in ms) for the previous step.

Returns
Type Description
double

Returns the desired duration (in ms) of the next step, or 0 to use the default duration.

  • View Source
In this article
Back to top Copyright © 2025 ABB