Class Instance
An instance of a specific Type. This object is a disconnected set of data from the configuration database.
Inherited Members
Namespace: ABB.Robotics.Controllers.ConfigurationDomain
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public class Instance : SDKControllerBoundBase, IComparable, INamedObject, IDisposable
Properties
EnableLocalCheck
Gets/Sets a flag to control wheter the limits and readonly flag are controlled locally and prior to the SetCall against the controller. Default ít is true.
Declaration
public bool EnableLocalCheck { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsReadOnly
Flag that signals that the object is readonly or not.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Attribute]
Gets/Sets the value of the attribute.
Declaration
public object this[Attribute attribute] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Attribute | attribute |
Property Value
Type | Description |
---|---|
System.Object |
Item[String]
Gets/Sets the value of the named attribute.
Declaration
public object this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Property Value
Type | Description |
---|---|
System.Object |
Type
Gets the type of the object.
Declaration
public Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
Delete()
Deletes the current object from the database.
Declaration
public void Delete()
GetAttribute(String)
Returns the value of the attribute.
Declaration
public object GetAttribute(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of attribute to get value for. |
Returns
Type | Description |
---|---|
System.Object | The value of the attribute. |
Examples
This example shows how to get the value of the attribute for an instance.
implementnotes
Following are the namespaces and initializations to be added:
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.ConfigurationDomain;
// Create an instance to connect to your controller.
Controller _ctrl = new Controller("/10.140.60.29");
ConfigurationDatabase _database = _ctrl.Configuration;
Instance objInstance;
private void GetSetInstanceAttribute()
{
DomainCollection domains = _database.Domains;
Domain domain = Controller.Configuration.Domains[Controller.Configuration.Domains.IndexOf("SYS")];
Controller.Logon(UserInfo.DefaultUser);
using (Controllers.Mastership.Request(Controller.Configuration))
{
ABB.Robotics.Controllers.ConfigurationDomain.Type taskType = domain.Types[domain.Types.IndexOf("CAB_TASKS")];
objInstance = taskType["T_ROB1"];
if (objInstance == null)
objInstance = taskType.Create("Test_Instance");
objInstance.SetAttribute("Entry", "STATIC");
object objEntry = objInstance.GetAttribute("Entry");
// To test the attibute collection and instance item.
object attrEntry = objInstance[taskType.Attributes["Entry"]];
Assert.AreEqual(objEntry, attrEntry);
}
}
GetAttribute(String, Int32)
Returns the value of the attribute.
Declaration
public object GetAttribute(string name, int index)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of attribute to fetch. |
System.Int32 | index | Index of attribute, 1-based. |
Returns
Type | Description |
---|---|
System.Object | The value of the attribute. |
SetAttribute(String, Object)
Sets the value of the attribute.
Declaration
public void SetAttribute(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of attribute to set. |
System.Object | value | New value of attribute. |
Examples
This example shows how to set the value of the attribute for an instance.
implementnotes
Following are the namespaces and initializations to be added:
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.ConfigurationDomain;
// Create an instance to connect to your controller.
Controller _ctrl = new Controller("/10.140.60.29");
ConfigurationDatabase _database = _ctrl.Configuration;
Instance objInstance;
private void GetSetInstanceAttribute()
{
DomainCollection domains = _database.Domains;
Domain domain = Controller.Configuration.Domains[Controller.Configuration.Domains.IndexOf("SYS")];
Controller.Logon(UserInfo.DefaultUser);
using (Controllers.Mastership.Request(Controller.Configuration))
{
ABB.Robotics.Controllers.ConfigurationDomain.Type taskType = domain.Types[domain.Types.IndexOf("CAB_TASKS")];
objInstance = taskType["T_ROB1"];
if (objInstance == null)
objInstance = taskType.Create("Test_Instance");
objInstance.SetAttribute("Entry", "STATIC");
object objEntry = objInstance.GetAttribute("Entry");
// To test the attibute collection and instance item.
object attrEntry = objInstance[taskType.Attributes["Entry"]];
Assert.AreEqual(objEntry, attrEntry);
}
}
SetAttribute(String, Object, Int32)
Sets the value of the attribute.
Declaration
public void SetAttribute(string name, object value, int index)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of attribute to set. |
System.Object | value | New value of attribute. |
System.Int32 | index | Index of attribute, 1-based. |