Class RapidData
This class represents a RAPID data.
Inherited Members
Namespace: ABB.Robotics.Controllers.RapidDomain
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public sealed class RapidData : SDKControllerBoundBase, IComparable, INamedObject, IDisposable
Constructors
RapidData(Controller, RapidSymbol)
Initializes a RapidData instance.
Declaration
public RapidData(Controller controller, RapidSymbol symbol)
Parameters
| Type | Name | Description |
|---|---|---|
| Controller | controller | Controller object. |
| RapidSymbol | symbol | Symbol to get data from. |
Properties
BaseIndex
Gets or sets the base index of array.
Declaration
public int BaseIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
IsArray
Checks whether the RAPID data is an array (of one or several dimensions).
Declaration
public bool IsArray { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the data is an array; otherwise false. |
IsLocal
Checks whether the RAPID data is declared locally.
Declaration
public bool IsLocal { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the RAPID data is not declared in a global module. |
Remarks
Will always return false when used with RapidData of SymbolTypes Atomic, RecordComponent or Parameter.
IsTaskPers
Checks whether the RAPID data is declared PERS or TASKPERS. Only of interest for persistent data.
Declaration
public bool IsTaskPers { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the RAPID data is declared TASKPERS; otherwise false. |
Remarks
Will return false if used with RapidData that is not declared as persistent (but constant for example).
Log
Define if changes to the data value shall be logged in the controller event log. Supported from RW 6.06.
Declaration
public bool Log { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RapidType
Gets the name of the RAPID data type, eg. "num".
Declaration
public string RapidType { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Not valid for RapidData of Record. (Will return empty string)
StringValue
Reads/writes the value of the RAPID data in the form of a string. This property can be used instead of ToString() and FillFromString(String).
Declaration
public string StringValue { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Symbol
Gets the symbol for this data object.
Declaration
public RapidSymbol Symbol { get; }
Property Value
| Type | Description |
|---|---|
| RapidSymbol |
TypeUrl
Gets the URL to the type, eg. "RAPID/num".
Declaration
public string TypeUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Not valid for RapidData of Record. (Will return empty string)
Value
Gets or sets the value of the RapidData.
Declaration
public IRapidData Value { get; set; }
Property Value
| Type | Description |
|---|---|
| IRapidData |
Remarks
Consider using the StringValue property instead. It will often have better performance.
Methods
ComputeSize(String)
PDD1732 and WI 9170 - RAPID larger array
Declaration
public static int ComputeSize(string strDataType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strDataType |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ReadItem(Int32)
Reads an element of one dimensional RAPID data array.
Declaration
public IRapidData ReadItem(int x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | Index of the item to read. |
Returns
| Type | Description |
|---|---|
| IRapidData | Returns an IRapidData instance that contains the value of the item. |
ReadItem(Int32, Int32)
Reads an element of a two dimensional RAPID data array.
Declaration
public IRapidData ReadItem(int y, int x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | y | Index, in the second dimension, of the item to read. |
| System.Int32 | x | Index, in the first dimension, of the item to read. |
Returns
| Type | Description |
|---|---|
| IRapidData | Returns an IRapidData instance that contains the value of the item. |
ReadItem(Int32, Int32, Int32)
Reads an element of a three dimensional RAPID data array.
Declaration
public IRapidData ReadItem(int z, int y, int x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | z | Index, in the third dimension, of the item to read. |
| System.Int32 | y | Index, in the second dimension, of the item to read. |
| System.Int32 | x | Index, in the first dimension, of the item to read. |
Returns
| Type | Description |
|---|---|
| IRapidData | Returns a IRapidData instance that contains the value of the item. |
ReadItem(Int32[])
Reads an element of a RAPID data array (one, two or three dimensions)
Declaration
public IRapidData ReadItem(params int[] index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32[] | index | Index of the item to read. |
Returns
| Type | Description |
|---|---|
| IRapidData | Returns an IRapidData instance that contains the value of the item. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | index The index is not valid for the data. |
| System.InvalidOperationException | Rapid data is not an array. |
Subscribe(EventHandler<DataValueChangedEventArgs>, EventPriority)
Subscribes to changes of persistent RAPID data.
Declaration
public void Subscribe(EventHandler<DataValueChangedEventArgs> eventHandler, EventPriority priority)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventHandler<DataValueChangedEventArgs> | eventHandler | EventHandler |
| EventPriority | priority | EventPriority |
Unsubscribe(EventHandler<DataValueChangedEventArgs>)
Unsubscribes to changes of persistent RAPID data.
Declaration
public void Unsubscribe(EventHandler<DataValueChangedEventArgs> eventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventHandler<DataValueChangedEventArgs> | eventHandler | EventHandler |
WriteItem(IRapidData, Int32)
Writes to the specified element of a RAPID array.
Declaration
public void WriteItem(IRapidData newValue, int x)
Parameters
| Type | Name | Description |
|---|---|---|
| IRapidData | newValue | An IRapidData instance that contains the value to write. |
| System.Int32 | x | Index of the element. |
WriteItem(IRapidData, Int32, Int32)
Writes to the specified element of a two dimensional RAPID array.
Declaration
public void WriteItem(IRapidData newValue, int y, int x)
Parameters
| Type | Name | Description |
|---|---|---|
| IRapidData | newValue | An IRapidData instance that contains the value to write. |
| System.Int32 | y | Index, in the second dimension, of the item to write. |
| System.Int32 | x | Index, in the first dimension, of the item to write. |
WriteItem(IRapidData, Int32, Int32, Int32)
Writes to the specified element of a three dimensional RAPID array.
Declaration
public void WriteItem(IRapidData newValue, int z, int y, int x)
Parameters
| Type | Name | Description |
|---|---|---|
| IRapidData | newValue | An IRapidData instance that contains the value to write. |
| System.Int32 | z | Index, in the third dimension, of the item to write. |
| System.Int32 | y | Index, in the second dimension, of the item to write. |
| System.Int32 | x | Index, in the first dimension, of the item to write. |
WriteItem(IRapidData, Int32[])
Writes to the specified element of a RAPID data array of any number of dimensions.
Declaration
public void WriteItem(IRapidData newValue, params int[] index)
Parameters
| Type | Name | Description |
|---|---|---|
| IRapidData | newValue | An IRapidData instance that contains the value to write. |
| System.Int32[] | index | Index of the item to write. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | index The index is not valid for the data. |
| System.InvalidOperationException | RAPID data is not an array. |
| System.ArgumentNullException | newValue is null or empty string. |
Events
ValueChanged
Raised when the value of the data has changed.
Declaration
public event EventHandler<DataValueChangedEventArgs> ValueChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<DataValueChangedEventArgs> |