Search Results for

    Show / Hide Table of Contents

    Setting/Resetting Virtual Signals

    This example provides information on setting and resetting digital Virtual Signals and how to set the value of an analog Virtual Signal.

    Use this procedure to set and reset Virtual Signals:

    1. Create a digital signal.

    2. Set the signal to 1.

    3. Reset the signal to 0.

    4. Create an analog signal.

    5. Set the signal to 156.

    Solution

    1. Create a digital signal.

      // Create a digital signal.
      station.IOSignals.Add(new IOSignal("MySignal", IOSignalType.DigitalInput));
      
    2. Set the signal to 1.

      // Set the signal to 1.
      station.IOSignals["MySignal"].Value = 1;
      
    3. Reset the signal to 0.

      // Reset the signal to 0.
      station.IOSignals["MySignal"].Value = 0;
      
    4. Create an analog signal.

      // Create an analog signal.
      station.IOSignals.Add(new IOSignal("AnalogSignal", IOSignalType.AnalogInput));
      
    5. Set the signal to 156.

      // Set the signal to 156.
      // NOTE: You need to use two decimals, since it only accept a double as a value.
      station.IOSignals["AnalogSignal"].Value = (double)156;
      

    Example

    This example provides information on setting and resetting digital Virtual Signals.

    private static void VirtualSignals()
    {
        Project.UndoContext.BeginUndoStep("VirtualSignals");
        try
        {
            Station station = Project.ActiveProject as Station;
    
            // Create a digital signal.
            station.IOSignals.Add(new IOSignal("MySignal", IOSignalType.DigitalInput));
    
            // Set the signal to 1.
            station.IOSignals["MySignal"].Value = 1;
    
            // Reset the signal to 0.
            station.IOSignals["MySignal"].Value = 0;
    
            // Create an analog signal.
            station.IOSignals.Add(new IOSignal("AnalogSignal", IOSignalType.AnalogInput));
    
            // Set the signal to 156.
            // NOTE: You need to use two decimals, since it only accept a double as a value.
            station.IOSignals["AnalogSignal"].Value = (double)156;
    
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }
    }
    

    Required Namespaces

    ABB.Robotics.RobotStudio.Environment

    ABB.Robotics.RobotStudio.Stations

    See Also

    • Creating New Station
    • Detecting Collisions
    In this article
    Back to top Copyright © 2026 ABB Robotics