Show / Hide Table of Contents

Declaring IO Signals

IO signals are an important element that SmartComponents use to communicate with the rest of the Station. In this topic, the developer will learn how to declare them by modifying the SmartComponent's XML file.

The IOSignal class contains the necessary elements for declaring inputs and outputs of several types. These types are enumerated in the IOSignalType member and can take any of the following values:

  • DigitalInput

  • DigitalOutput

  • AnalogInput

  • AnalogOutput

  • DigitalGroupInput

  • DigitalGroupOutput

The steps that we will perform in this topic are the following:

  1. Create a signal of each type.

  2. Set the value property to define the initial value of a signal.

  3. Define the value range of an analog signal.

  4. Hide a signal from the user interface.

  5. Make a signal read-only.

  6. Set the Auto-reset signal.

Note

The code in this topic can be tested using the default RobotStudio Smart Component template.

Signals and their arguments

  1. The following snippet from the SmartComponent's XML file shows how to declare a signal of each of the types listed above:

    <Signals>
        <IOSignal name="DigitalIn"      signalType="DigitalInput" />
        <IOSignal name="DigitalOut"     signalType="DigitalOutput" />
        <IOSignal name="AnalogIn"       signalType="AnalogInput" />
        <IOSignal name="AnalogOut"      signalType="AnalogOutput" />
        <IOSignal name="DigitalInBus"   signalType="DigitalGroupInput" />
        <IOSignal name="DigitalOutBus"  signalType="DigitalGroupOutput" />
    </Signals>
    
  2. Use the Value property to set an initial value for the signal. Use 0 for digital signals and 0.0 for analog ones.

    <IOSignal name="InitOutput" signalType="DigitalOutput" value="1" />
    
  3. Define the value range for non-digital signals with the MinValue and MaxValue arguments.

    <IOSignal name="Analog0to10" signalType="AnalogInput" minValue="0" maxValue="10" />
    
  4. Signals can be hidden from the user interface with the UIVisible property.

    <IOSignal name="HiddenSignal" signalType="DigitalInput" uiVisible="false" />
    
  5. The ReadOnly property renders the user unable to set the value of a signal from the user interface.

    <IOSignal name="ReadOnlyIn" signalType="DigitalInput" readOnly="true" />
    
  6. The AutoReset property automatically returns the signal to its default state once it is activated.

    <IOSignal name="SinglePulse" signalType="DigitalOutput" autoReset="true" />
    

Example

The following XML file showcases a SmartComponent that has the declared signals.

<?xml version="1.0" encoding="utf-8" ?>
<lc:LibraryCompiler xmlns:lc="urn:abb-robotics-robotstudio-librarycompiler"
        xmlns="urn:abb-robotics-robotstudio-graphiccomponent"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:abb-robotics-robotstudio-librarycompiler file:///C:\Program%20Files%20(x86)\ABB\SDK\RobotStudio%202024%20SDK\LibraryCompilerSchema.xsd
        urn:abb-robotics-robotstudio-graphiccomponent file:///C:\Program%20Files%20(x86)\ABB\SDK\RobotStudio%202024%20SDK\GraphicComponentSchema.xsd">
    <lc:Library fileName="SmartComponent.rslib">
        <lc:DocumentProperties>
            <lc:Author>USER_NAME</lc:Author>
            <lc:Image source="SmartComponent.png"/>
        </lc:DocumentProperties>
        <SmartComponent name="SmartComponent" icon="SmartComponent.png"
                codeBehind="SmartComponent.CodeBehind,SmartComponent.dll"
                canBeSimulated="false">
            <Properties>
                <DynamicProperty name="SampleProperty" valueType="System.Double" value="10">
                    <Attribute key="MinValue" value="0"/>
                    <Attribute key="Quantity" value="Length"/>
                </DynamicProperty>
            </Properties>
            <Bindings>
            </Bindings>
            <Signals>
                <IOSignal name="DigitalIn"      signalType="DigitalInput" />
                <IOSignal name="DigitalOut"     signalType="DigitalOutput"/>
                <IOSignal name="AnalogIn"       signalType="AnalogInput" />
                <IOSignal name="AnalogOut"      signalType="AnalogOutput" />
                <IOSignal name="DigitalInBus"   signalType="DigitalGroupInput" />
                <IOSignal name="DigitalOutBus"  signalType="DigitalGroupOutput" />
                <IOSignal name="InitOutput"     signalType="DigitalOutput" value="1" />
                <IOSignal name="Analog0to10"    signalType="AnalogInput" minValue="0" maxValue="10" />
                <IOSignal name="HiddenSignal"   signalType="DigitalInput" uiVisible="false" />
                <IOSignal name="ReadOnlyIn"     signalType="DigitalInput" readOnly="true" />
                <IOSignal name="SinglePulse"    signalType="DigitalOutput" autoReset="true" />
            </Signals>
            <GraphicComponents>
            </GraphicComponents>
            <Assets>
                <Asset source="SmartComponent.dll"/>
            </Assets>
        </SmartComponent>
    </lc:Library>
</lc:LibraryCompiler>

See Also

  • SmartComponent Introduction
  • Creating a SmartComponent
  • Overriding OnIOSignalValueChanged
  • Overriding CustomValidation
In this article
Back to top Copyright © 2025 ABB