Class ConfigurationDatabase
Main class for configuration management.
Inherited Members
Namespace: ABB.Robotics.Controllers.ConfigurationDomain
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public class ConfigurationDatabase : SDKControllerBoundBase, IComparable, INamedObject, IDisposable, IMastershipResource
Properties
Domains
Gets all domains as a collection.
Declaration
public DomainCollection Domains { get; }
Property Value
Type | Description |
---|---|
DomainCollection |
ExternalIO
Gets the external IO configuration domain.
Declaration
public Domain ExternalIO { get; }
Property Value
Type | Description |
---|---|
Domain |
IsMaster
Get the current mastership state.
Declaration
public bool IsMaster { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRobotWare7
Declaration
public bool IsRobotWare7 { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ManMachineCommunication
Gets Man Machine Communication domain.
Declaration
public Domain ManMachineCommunication { get; }
Property Value
Type | Description |
---|---|
Domain |
MotionControl
Gets MotionController configuration domain.
Declaration
public Domain MotionControl { get; }
Property Value
Type | Description |
---|---|
Domain |
Process
Gets the process configuration domain.
Declaration
public Domain Process { get; }
Property Value
Type | Description |
---|---|
Domain |
SerialIO
Gets the Serial IO configuration domain.
Declaration
public Domain SerialIO { get; }
Property Value
Type | Description |
---|---|
Domain |
System
Gets the system configuration domain.
Declaration
public Domain System { get; }
Property Value
Type | Description |
---|---|
Domain |
Methods
Accept(IMetadataVisitor)
Accepts a visitor object.
Declaration
public void Accept(IMetadataVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
IMetadataVisitor | visitor | Visitor object. |
Load(String)
Loads a configuration file into the database. Uses LoadMode.Add.
Declaration
public void Load(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. (On the controller). |
Load(String, LoadMode)
Loads a configuration file into the database.
Declaration
public void Load(string path, LoadMode mode)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. (On the controller). |
LoadMode | mode | The load mode. |
Read(String[])
Reads the value localized by the path.
Declaration
public string Read(params string[] path)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | path | The path. |
Returns
Type | Description |
---|---|
System.String | The value as a string. |
Examples
The first example reads the unitmap value for signal TestDI. The variables in the path are the same as the ones in the configuration files (in this case eio.cfg). The second example reads the value of cal_offset for rob1_1 (moc.cfg).
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.ConfigurationDomain;
...
Controller controller = new Controller();
ConfigurationDatabase cfg = controller.Configuration;
string[] path = { "EIO", "EIO_SIGNAL", "TestDI", "UnitMap" };
string data = cfg.Read(path);
string[] path = { "MOC", "MOTOR_CALIB", "rob1_1", "cal_offset" };
string data = cfg.Read(path);
Write(String, Boolean, String[])
Writes a value to the path.
Declaration
public void Write(string value, bool log, params string[] path)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
System.Boolean | log | Log changes to the controller event log. Supported from RW 6.06. |
System.String[] | path | The path. |
Examples
This example sets the unitmap of signal "TestDI" to 17.
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.ConfigurationDomain;
...
try
{
Controller controller = new Controller();
Mastership master;
ConfigurationDatabase cfg = controller.Configuration;
using (master = Controllers.Mastership.Request(controller.Configuration))
{
string[] path = { "EIO", "EIO_SIGNAL", "TestDI", "UnitMap" };
cfg.Write("17", path);
}
}
catch (System.InvalidOperationException ex)
{
MessageBox.Show("Mastership is held by another client.");
}
catch (System.Exception ex)
{
// TODO: Add error handling
}
finally
{
//must release mastership in case an error occurred when Write was executed
if (master != null)
{
master.Dispose();
master = null;
}
}
}
Write(String, String[])
Writes a value to the path.
Declaration
public void Write(string value, params string[] path)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
System.String[] | path | The path. |
Events
MastershipChanged
This event is raised when mastership is changed.
Declaration
public event EventHandler<MastershipChangedEventArgs> MastershipChanged
Event Type
Type | Description |
---|---|
System.EventHandler<MastershipChangedEventArgs> |
Explicit Interface Implementations
IMastershipResource.Ensure()
Call this method to ensure the mastership of the resource.
Declaration
void IMastershipResource.Ensure()
IMastershipResource.Release()
Call this method to release the mastership of the resource.
Declaration
void IMastershipResource.Release()
IMastershipResource.Request()
Call this method to request the mastership of the resource.
Declaration
void IMastershipResource.Request()