Properties and Signals
RobotStudio's SmartComponents interact with other elements in its simulated environment by sending and receiving signals of different types. Internally, a SmartComponent is contains properties that interact with each other and with the signals in order to create an intelligent behavior. The user can directly interact with the Signals and the Properties since RobotStudio automatically creates a Graphical User Interface from where the they are accessible.
Signals
Signals are the inputs and outputs that the SmartComponent uses to communicate with other elements of the station. Therefore, the signals of a SmartComponent are very well defined and they can be of one of the following types:
- DigitalInput
- DigitalOutput
- DigitalGroupInput
- DigitalGroupOutput
- AnalogInput
- AnalogOutput
When declaring a signal, the following parameters may be specified in the statement:
- name [Required]: The name of the given signal or group of signals.
- signalType [Required]: The type of the declared signal or signals (see above).
- autoReset: Makes the signal return to its default value once its value is changed.
- maxValue: The biggest value (inclusive) that a numerical signal can have.
- minValue: The smallest value (inclusive) that a numerical signal can have.
- readOnly: Specifies whether or not a signal can be modified by the smart component.
- uiVisible: Specifies whether or not the signal appears in the SmartComponents GUI.
- value: The initial and default value of the signal.
Properties
A property is an internal value that the SmartComponent uses to perform its designated action. In RobotStudio, a property that dynamically reacts and changes depending on the program flow or the user input is called a Dynamic Property. This type of properties may be of one of the following types:
- System.Double
- System.Int32
- System.String
- System.Boolean
- System.Drawing.Color
- ABB.Robotics.Math.Vector3
- ABB.Robotics.RobotStudio.ProjectObject
- ABB.Robotics.RobotStudio.Stations.GraphicComponent
- ABB.Robotics.RobotStudio.Stations.SmartComponent
When declaring a dynamic property, the following arguments may be specified in the statement:
- name required: The name of the Dynamic property.
- valueType required: The type of value that the Dynamic property will hold (see above). Both C# and ABB types are allowed.
- value: The initial and default value of the signal.
- readOnly. Specifies whether or not the signal can be modified by the program or the user.
- uiVisible: Specified whether or not the signal is visible in the SmartComponents GUI.
Available Attributes for Dynamic Properties
Additionally, when declaring a Dynamic Property, the developer may specify attributes that modify the behaviour of the SmartComponent. The available attributes are:
- MinValue - Indicates the maximum value for a numeric property. Value must be a member.
- MaxValue - Indicates the minimum value for a numeric property. Value must be a member.
- AllowedValues - Indicates the allowed values for a numeric or string property. Value must be delimited by semicolons.
- MinLength - Indicates the minimum length of a string property. Value must be an integer.
- MaxLength - Indicates the maximum length of a string property. Value must be an integer.
- AllowedCharacters - Indicates the allowed characters in a string property. Value must be delimited by semicolons.
- ValueFilter - Specifies a regular expression used to verify the property value (converted to string).
- Quantity - Indicates the quantity that a numeric property represents. Value must be a member of the BuiltInQuantity enumeration.
- AutoApply - Indicates that the property value should be applied immediately when it is changed, rather than when the user clicks "Apply" or equivalent.
- Slider - Indicates that a numeric property should be displayed as a slider. Requires that MinValue and MaxValue are also set.
- CustomValidation - Indicates that the QueryPropertyValueValid() should be called to validate the value.
- AllowedTypes - Allows additional type checking. Values must be names full names of allowed types delimited by semicolons.
- AllowParent - Indicates that the component that owns the property is a valid value (by default, it is not).
- AddToDisplayName - Adds the property's value to the SmartComponent's name
- DisplayValues - Shows special property magnitudes indicated in Value.
- VectorUsage - Indicates that the property stores a Vector3 data type.
- Multiline - Allows string properties with values of one or more lines.