Click or drag to resize

ControllerState Property

Gets the state of the controller.

Namespace:  ABB.Robotics.Controllers
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public ControllerState State { get; }

Return Value

Type: ControllerState
A ControllerState value representing the current state of the controller.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Remarks
A call to the controller is performed each time this property is called. Thus, if you want to repeatedly check the ControllerState in a conditional clause, you should get the controller state and save the value locally. See code example below.
Examples
This example gets the controller state and displays an associated text.
// c is a reference to a controller object
// Get the state of the controller and save it in order to 
// avoid unnecessary round trips to the controller 
ControllerState state = c.State;

// Display a text associated to the corresponding state
switch (state)
   {
       case ControllerState.EmergencyStop:
           label4.Text = "Controller is in emergency stop state";
           break;
       case ControllerState.EmergencyStopReset:
           label4.Text = "Controller is in emergency stop reset state";
           break;
       case ControllerState.GuardStop:
           label4.Text = "Controller is in guard stop state";
           break;
       case ControllerState.Init:
           label4.Text = "Controller is in initial state";
           break;
       case ControllerState.MotorsOff:
           label4.Text = "Controller is in motors off state";
           break;
       case ControllerState.MotorsOn:
           label4.Text = "Controller is in motors on state";
           break;
       case ControllerState.SystemFailure:
           label4.Text = "Controller is in system failure state";
           break;
       case ControllerState.Unknown:
           label4.Text = "Controller is in unknown state";
           break;
   }
See Also