Class Controller
The main entry point for any operation against the controller.
Implements
Inherited Members
Namespace: ABB.Robotics.Controllers
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public sealed class Controller : SDKBase, IComparable, INamedObject, IController, IDisposable, IServiceProvider, IMastershipResourceController, IMastershipResource
Constructors
View SourceController()
Creates a controller from the defaultController id in the capi section of the App.config file.
Declaration
[Obsolete("Use Controller.Connect(Controller.DefaultSystemId,...)")]
public Controller()
Controller(ControllerInfo)
Creates a controller from a controller info object.
Declaration
[Obsolete("Use Controller.Connect()")]
public Controller(ControllerInfo controller)
Parameters
| Type | Name | Description |
|---|---|---|
| ControllerInfo | controller | Info object from NetworkScanner. |
Controller(ControllerInfo, bool)
Creates a controller from a controller info object.
Declaration
[Obsolete("Use Controller.Connect()")]
public Controller(ControllerInfo controller, bool validateServerCertificate)
Parameters
| Type | Name | Description |
|---|---|---|
| ControllerInfo | controller | Info object from NetworkScanner. |
| bool | validateServerCertificate | Validate the SSL certificate when connecting to a 7.x controller. |
Controller(Guid)
Creates a controller instance from a system id.
Declaration
[Obsolete("Use Controller.Connect()")]
public Controller(Guid systemId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | systemId | System id. |
Controller(Guid, bool)
Creates a controller instance from a system id.
Declaration
[Obsolete("Use Controller.Connect()")]
public Controller(Guid systemId, bool validateServerCertificate)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | systemId | System id. |
| bool | validateServerCertificate | Validate the SSL certificate when connecting to a 7.x controller. |
Controller(string)
Not for public use.
Declaration
[Obsolete("Use Controller.Connect()")]
public Controller(string controllerID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | controllerID | Not for public use. |
Controller(string, bool)
Not for public use.
Declaration
[Obsolete("Use Controller.Connect()")]
public Controller(string controllerID, bool validateServerCertificate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | controllerID | Not for public use. |
| bool | validateServerCertificate | Validate the SSL certificate when connecting to a 7.x controller. |
Properties
View SourceAuthenticationSystem
Gets the user authentication subsystem.
Declaration
public UserAuthorizationSystem AuthenticationSystem { get; }
Property Value
| Type | Description |
|---|---|
| UserAuthorizationSystem |
BackupInProgress
Gets a flag that indicates if a backup is in progress or not.
Declaration
public bool BackupInProgress { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Configuration
Gets the controller configuration.
Declaration
public ConfigurationDatabase Configuration { get; }
Property Value
| Type | Description |
|---|---|
| ConfigurationDatabase |
Connected
Indicates whether the controller is connected or not.
Declaration
public bool Connected { get; }
Property Value
| Type | Description |
|---|---|
| bool |
CurrentUser
Gets the currently logged on user.
Declaration
public UserInfo CurrentUser { get; }
Property Value
| Type | Description |
|---|---|
| UserInfo |
DateTime
Gets/Sets the time of the controller.
Declaration
public DateTime DateTime { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Remarks
Grant: UAS_CONTROLLER_PROPERTIES_WRITE, not supported by boot server or Virtual Controller.
The System.DateTimeKind used by this property is System.DateTimeKind.Utc (Coordinated Universal Time). To set current datetime use DateTime.UtcNow.
DateTimeKind UtcNowDefaultSystemId
Gets the configured default system id.
Declaration
public static Guid DefaultSystemId { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
EventLog
Gets the event log of the controller.
Declaration
public EventLog EventLog { get; }
Property Value
| Type | Description |
|---|---|
| EventLog |
FileSystem
Gets the controller file system.
Declaration
public FileSystem FileSystem { get; }
Property Value
| Type | Description |
|---|---|
| FileSystem |
HasUnicodeSupport
Gets if the controller supports Unicode in RAPID.
Declaration
public bool HasUnicodeSupport { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IOSystem
Gets the IOSystem of the controller.
Declaration
public IOSystem IOSystem { get; }
Property Value
| Type | Description |
|---|---|
| IOSystem |
IPAddress
Gets the IPAddress of the controller.
Declaration
public IPAddress IPAddress { get; }
Property Value
| Type | Description |
|---|---|
| IPAddress |
Remarks
For a virtual controller the value is the loopback address i.e. 127.0.0.1.
Ipc
Gets a reference to the Ipc class of the controller.
Declaration
public Ipc Ipc { get; }
Property Value
| Type | Description |
|---|---|
| Ipc | A Ipc reference that can be used to access the Ipc functionality of the controller. |
IsMaster
Gets the current mastership state.
Declaration
public bool IsMaster { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsVirtual
Gets a flag that indicates if the controller is virtual or not.
Declaration
public bool IsVirtual { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MacAddress
Gets the MAC address of the controller.
Declaration
public string MacAddress { get; }
Property Value
| Type | Description |
|---|---|
| string |
MainComputerServiceInfo
Gets service information for the main computer. This property is not valid for Virtual Controllers.
Declaration
public MainComputerServiceInfo MainComputerServiceInfo { get; }
Property Value
| Type | Description |
|---|---|
| MainComputerServiceInfo |
MastershipPolicy
Specifies how mastership should be handled by a GUI client
Declaration
public ControllerMastershipPolicy MastershipPolicy { get; set; }
Property Value
| Type | Description |
|---|---|
| ControllerMastershipPolicy |
MotionSystem
Gets the motions system domain of the controller.
Declaration
public MotionSystem MotionSystem { get; }
Property Value
| Type | Description |
|---|---|
| MotionSystem |
Name
Gets the name of the controller.
Declaration
public override string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
View SourceNetworkSettings
Gets the network settings of the controller.
Declaration
public NetworkSettingsInfo NetworkSettings { get; }
Property Value
| Type | Description |
|---|---|
| NetworkSettingsInfo |
Remarks
Not supported by Virtual Controller.
OperatingMode
Gets the current operating mode of the controller.
Declaration
public ControllerOperatingMode OperatingMode { get; }
Property Value
| Type | Description |
|---|---|
| ControllerOperatingMode |
Rapid
Gets the Rapid Domain of the controller.
Declaration
public Rapid Rapid { get; }
Property Value
| Type | Description |
|---|---|
| Rapid |
RemoteLogin
Gets the RemoteLogin which allosw a certain type of users to request a remote login/logout of a TPU user.
Declaration
public RemoteLogin RemoteLogin { get; }
Property Value
| Type | Description |
|---|---|
| RemoteLogin |
RobotWare
Gets information about the current system and options.
Declaration
public SystemRobotWare RobotWare { get; }
Property Value
| Type | Description |
|---|---|
| SystemRobotWare |
RobotWareVersion
Gets the version of the robotware the current system uses.
Declaration
public Version RobotWareVersion { get; }
Property Value
| Type | Description |
|---|---|
| Version |
RunLevel
Gets the current run level of the controller.
Declaration
public Level RunLevel { get; }
Property Value
| Type | Description |
|---|---|
| Level |
StartTime
Gets the system clock at the last startup of the controller.
Declaration
public DateTime StartTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
State
Gets/Sets the current state of the controller.
Declaration
public ControllerState State { get; set; }
Property Value
| Type | Description |
|---|---|
| ControllerState |
Remarks
Set requires Auto mode. Can only be used to change between MotorsOn and MotorsOff respectively. You can not change from MotorsOn to MotorsOff while a RAPID program is executing.
SystemId
Gets the id of the current system of the controller.
Declaration
public Guid SystemId { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
SystemName
Gets the name of the current system of the controller.
Declaration
public string SystemName { get; }
Property Value
| Type | Description |
|---|---|
| string |
TimeServer
Gets or sets the NTP time server of the controller.
Declaration
public string TimeServer { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Value may be IP, DNS name or null/empty.
TimeZone
Gets or sets the time zone of the controller.
Declaration
public string TimeZone { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Value may be a time zone as specified in the time zone database (also known as Olson database) or null/empty. For example: Europe/Stockholm.
UICulture
Gets the UI Culture.
Declaration
public CultureInfo UICulture { get; }
Property Value
| Type | Description |
|---|---|
| CultureInfo |
Methods
View SourceBackup(string)
Initiates a new backup operation. This operation stores the backup in the specified directory on the controller file system.
Declaration
public void Backup(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Output path for backup operation. |
Remarks
This method is asynchronous, wait for the BackupCompleted event.
CheckAvailability(IEnumerable<string>, IEnumerable<MastershipResource>, bool, bool, bool)
Checks Availability preconditions for performing an action on the controller.
Declaration
public void CheckAvailability(IEnumerable<string> requiredGrants, IEnumerable<MastershipResource> requiredMastership, bool allowedInSysFail, bool allowedInExecuting, bool requiresLogon)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | requiredGrants | Required UAS grants (can be null) |
| IEnumerable<MastershipResource> | requiredMastership | Required mastership resources (can be null) |
| bool | allowedInSysFail | |
| bool | allowedInExecuting | |
| bool | requiresLogon |
Remarks
Mastership is only checked for a connection with MastershipPolicy.Manual.
CheckRestore(string)
Checks for possible mismatches and other problems with a backup.
Declaration
public bool CheckRestore(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path of directory. |
Returns
| Type | Description |
|---|---|
| bool | True if restore will complete successfully. |
CheckRestore(string, RestoreIncludes)
Checks for possible mismatches and other problems with a backup.
Declaration
public bool CheckRestore(string path, RestoreIncludes includes)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path of directory. |
| RestoreIncludes | includes | What to include from backup. |
Returns
| Type | Description |
|---|---|
| bool | True if restore will complete successfully. |
CheckRestore(string, RestoreIncludes, RestoreIgnores)
Checks for possible mismatches and other problems with a backup.
Declaration
public bool CheckRestore(string path, RestoreIncludes includes, RestoreIgnores ignores)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path of directory. |
| RestoreIncludes | includes | What to include from backup. |
| RestoreIgnores | ignores | What errors to ignore. |
Returns
| Type | Description |
|---|---|
| bool | True if restore will complete successfully. |
CheckRestore2(string, RestoreIncludes, RestoreIgnores, RestoreIncludeSafetySettings, RestoreIncludeUasSettings)
Checks for possible mismatches and other problems with a backup.
Declaration
public RestoreInfo CheckRestore2(string path, RestoreIncludes includes, RestoreIgnores ignores, RestoreIncludeSafetySettings includeSafetySettings, RestoreIncludeUasSettings includeUasSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the backup. |
| RestoreIncludes | includes | What to include from backup. |
| RestoreIgnores | ignores | What errors to ignore. |
| RestoreIncludeSafetySettings | includeSafetySettings | Include safety settings. Supported from RobotWare 6.05. |
| RestoreIncludeUasSettings | includeUasSettings | Include UAS settings. Supported from RobotWare 7.15. |
Returns
| Type | Description |
|---|---|
| RestoreInfo | A RestoreInfo object with information about the operation. |
Remarks
This method is supported for all RobotWare versions, but provides additional functionality for 7.17 and later.
Connect(ControllerInfo, ConnectionType, bool)
Creates a Controller object with a connection to a controller.
Declaration
public static Controller Connect(ControllerInfo controllerInfo, ConnectionType connectionType, bool validateServerCertificate = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ControllerInfo | controllerInfo | The controller info from NetScan |
| ConnectionType | connectionType | ABB.Robotics.Controllers. |
| bool | validateServerCertificate | Validate the SSL certificate when connecting to a 7.x controller. |
Returns
| Type | Description |
|---|---|
| Controller |
Connect(Guid, ConnectionType, bool)
Creates a Controller object with a connection to a controller.
Declaration
public static Controller Connect(Guid systemId, ConnectionType connectionType, bool validateServerCertificate = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | systemId | The system id of the controller |
| ConnectionType | connectionType | ABB.Robotics.Controllers. |
| bool | validateServerCertificate | Validate the SSL certificate when connecting to a 7.x controller. |
Returns
| Type | Description |
|---|---|
| Controller |
Dispose(bool)
Disposes the current controller object.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Flag that indicates the origin of the call, true indicates a dispose false indicates a finalizer. |
Overrides
View SourceExpandEnvironmentVariables(string)
Substitutes environment variables in a string with their values.
Declaration
public string ExpandEnvironmentVariables(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| string | s |
Returns
| Type | Description |
|---|---|
| string | The value. |
~Controller()
Declaration
protected ~Controller()
GetEnvironmentVariable(string)
Gets the value of an environment variable.
Declaration
public string GetEnvironmentVariable(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name. |
Returns
| Type | Description |
|---|---|
| string | The value. |
Logoff()
Logs off the current user.
Declaration
public void Logoff()
Remarks
RobotStudio addins may not manually log on or off. RobotStudio will handle the same. See also Logon(UserInfo).
Logon(UserInfo)
Logon as the specified user.
Declaration
public void Logon(UserInfo user)
Parameters
| Type | Name | Description |
|---|---|---|
| UserInfo | user | The user. |
Remarks
RobotStudio addins may not manually log on or off. RobotStudio will handle the same. See HostingServices.
ReleaseUnmanagedResources()
Releases unmanaged resources, thus preventing memory leaks. If the PC SDK application is running in a Single Threaded Apartment (STA), the Dispose call will dispose of managed objects, but native objects created internally by the PC SDK will remain. To release these unmanaged resources, this method should be called periodically.
Declaration
[Obsolete("The method Controller.ReleaseUnmanagedResources is not valid from PC SDK 5.60 onwards.")]
public static void ReleaseUnmanagedResources()
Remarks
For an application running in a Multi Threaded Apartment (MTA) the Dispose call will remove both managed and native objects.
Restart()
Performs a warm restart of the controller.
Declaration
public void Restart()
Remarks
On a Virtual Controller the content of the temporary folder (TEMP)$ will be deleted. GetEnvironmentVariable(string)
Restart(ControllerStartMode)
Restarts the controller.
Declaration
public void Restart(ControllerStartMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| ControllerStartMode | mode | The startup mode. |
Remarks
On a Virtual Controller the content of the temporary folder (TEMP)$ will be deleted. GetEnvironmentVariable(string)
RestartAndWaitForReconnect(ControllerStartMode)
Restarts the controller and does not return until it has restarted and reconnected again.
Declaration
public void RestartAndWaitForReconnect(ControllerStartMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| ControllerStartMode | mode | The startup mode. |
Remarks
On a Virtual Controller the content of the temporary folder (TEMP)$ will be deleted. GetEnvironmentVariable(string)
Restore(string)
Performs a Restore operation of a controller system.
Declaration
public void Restore(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the backup. |
Remarks
Requires mastership of Rapid and Configuration domains. Requires UAS_RESTORE grant. Requires Auto mode.
Restore(string, RestoreIncludes)
Performs a Restore operation of a controller system.
Declaration
public void Restore(string path, RestoreIncludes includes)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the backup. |
| RestoreIncludes | includes | Defines what to restore from the backup. |
Remarks
Requires mastership of Rapid and Configuration domains. Requires UAS_RESTORE grant. Requires Auto mode.
Restore(string, RestoreIncludes, RestoreIgnores)
Performs a Restore operation of a controller system.
Declaration
public void Restore(string path, RestoreIncludes includes, RestoreIgnores ignores)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the backup. |
| RestoreIncludes | includes | Defines what to restore from the backup. |
| RestoreIgnores | ignores | Defines what mismatches between current system and backup to ignore. |
Remarks
Requires mastership of Rapid and Configuration domains. Requires UAS_RESTORE grant. Requires Auto mode.
Restore(string, RestoreIncludes, RestoreIgnores, RestoreIncludeSafetySettings, RestoreIncludeUasSettings, bool)
Performs a Restore operation of a controller system.
Declaration
public void Restore(string path, RestoreIncludes includes, RestoreIgnores ignores, RestoreIncludeSafetySettings includeSafetySettings, RestoreIncludeUasSettings includeUasSettings, bool removeBackup)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the backup. |
| RestoreIncludes | includes | Defines what to restore from the backup. |
| RestoreIgnores | ignores | Defines what mismatches between current system and backup to ignore. |
| RestoreIncludeSafetySettings | includeSafetySettings | Include safety settings. Supported from RobotWare 6.05. |
| RestoreIncludeUasSettings | includeUasSettings | Include UAS settings. Supported from RobotWare 7.15. |
| bool | removeBackup | Flag to indicate if the backup folder shall be removed. |
Remarks
Requires mastership of Rapid and Configuration domains. Requires UAS_RESTORE grant. Requires Auto mode.
On a Virtual Controller the restore operation will delete the content of the temporary folder (TEMP)$. Restart()
Restore(string, RestoreIncludes, RestoreIgnores, bool)
Performs a Restore operation of a controller system.
Declaration
public void Restore(string path, RestoreIncludes includes, RestoreIgnores ignores, bool removeBackup)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the backup. |
| RestoreIncludes | includes | Defines what to restore from the backup. |
| RestoreIgnores | ignores | Defines what mismatches between current system and backup to ignore. |
| bool | removeBackup | Flag to indicate if the backup folder shall be removed. |
Remarks
Requires mastership of Rapid and Configuration domains. Requires UAS_RESTORE grant. Requires Auto mode.
On a Virtual Controller the restore operation will delete the content of the temporary folder (TEMP)$. Restart()
SaveDiagnosticsInfoToController(string)
Creates a file with RobotWare diagnostics information on the controllers file system
Declaration
public void SaveDiagnosticsInfoToController(string dignosticsFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | dignosticsFileName |
SendHeartBeat()
Send a heartbeat to the controller to show presence while executing.
Declaration
public void SendHeartBeat()
Remarks
Depending on controller version and configuration, a client that holds mastership must send a heartbeat to the controller to show presence during execution.
If the client does not send a heartbeat with a specified interval, execution will stop and the controller will go to motors off.
This functionality is availabe in RobotWare 7.8 and later and is controlled via the configuration instance SYS/MASTER_BOOL/HeartBeat:
- If the parameter Select is true, a client that holds mastership must send heartbeats or program execution will stop.
- The parameter Timeout corresponds to the maximum heartbeat interval.
This is required for standalone applications, but not for RobotStudio add-ins.
SetNetworkSettings(bool, string, string, string)
Sets the controller LAN adaptor settings.
Declaration
public void SetNetworkSettings(bool isDhcp, string ipAddress, string subnetMask, string gateway)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isDhcp | True when using DHCP, false for fixed IP. |
| string | ipAddress | IP to use when FixIP is configured. |
| string | subnetMask | Subnet mask to use when FixIP is configured. |
| string | gateway | Default gateway to use when FixIP is configured. |
Events
View SourceBackupCompleted
This event is raised when a backup operation completes, the event arguments hold information about the success of the backup operation.
Declaration
public event EventHandler<BackupEventArgs> BackupCompleted
Event Type
| Type | Description |
|---|---|
| EventHandler<BackupEventArgs> |
ConnectionChanged
This event is raised when the connection status to the controller has changed.
Declaration
public event EventHandler<ConnectionChangedEventArgs> ConnectionChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<ConnectionChangedEventArgs> |
MastershipChanged
Please use MastershipChanged or MastershipChanged instead.
Declaration
[Obsolete("Use Controller.Rapid.MastershipChanged or Controller.Configuration.MastershipChanged instead.")]
public event EventHandler<MastershipChangedEventArgs> MastershipChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<MastershipChangedEventArgs> |
OnCertificateError
Raised when connecting to an OmniCore controller with an untrusted SSL certificate.
Declaration
public static event EventHandler<CertificateErrorEventArgs> OnCertificateError
Event Type
| Type | Description |
|---|---|
| EventHandler<CertificateErrorEventArgs> |
Remarks
Will not be raised if running in RobotStudio or if passing validateServerCertificate = false when connecting.
OperatingModeChanged
This event is raised when the operation mode of the controller has changed.
Declaration
public event EventHandler<OperatingModeChangeEventArgs> OperatingModeChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<OperatingModeChangeEventArgs> |
StateChanged
This event is raised when the current state of the controller has changed.
Declaration
public event EventHandler<StateChangedEventArgs> StateChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<StateChangedEventArgs> |