Class RsDataDeclaration
Inheritance
RsDataDeclaration
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
sistent("DataDeclaration")]
public abstract class RsDataDeclaration : ProjectObject, ISupportCopy, IDeclaration
Constructors
RsDataDeclaration()
Declaration
protected RsDataDeclaration()
RsDataDeclaration(PimDocument)
Only for use by persistence system.
Declaration
protected RsDataDeclaration(PimDocument doc)
Parameters
Type |
Name |
Description |
RobotStudio.API.Persistence.PimDocument |
doc |
|
Fields
_dataType
Declaration
sistent("DataType", PersistAs = PimPersistAs.Attribute)]
[Undoable]
[CLSCompliant(false)]
protected string _dataType
Field Value
_declarationInfo
Declaration
Compliant(false)]
[Persistent("DeclarationInfo")]
[Undoable]
protected RAPIDDeclarationInfo _declarationInfo
Field Value
Type |
Description |
RobotStudio.API.Internal.RAPIDDeclarationInfo |
|
_dimension1
Declaration
oable]
[CLSCompliant(false)]
[Persistent("Dimension1")]
protected short _dimension1
Field Value
_dimension2
Declaration
sistent("Dimension2")]
[CLSCompliant(false)]
[Undoable]
protected short _dimension2
Field Value
_dimension3
Declaration
Compliant(false)]
[Persistent("Dimension3")]
[Undoable]
protected short _dimension3
Field Value
_frameSize
Declaration
oable]
[Persistent("FrameSize", Convert = PimConvert.ConvertLength)]
[CLSCompliant(false)]
protected double _frameSize
Field Value
_initialExpression
Declaration
sistent("InitialExpression")]
[Undoable]
[CLSCompliant(false)]
protected string _initialExpression
Field Value
_isInline
Declaration
oable]
[CLSCompliant(false)]
[Persistent("IsInline")]
protected bool _isInline
Field Value
_routineName
Declaration
Compliant(false)]
[Undoable]
[Persistent("RoutineName")]
protected string _routineName
Field Value
_showName
Declaration
sistent("ShowName")]
[Undoable]
[CLSCompliant(false)]
protected bool _showName
Field Value
_storageType
Declaration
sistent("StorageType")]
[CLSCompliant(false)]
[Undoable]
protected RapidStorageType _storageType
Field Value
Properties
DataType
Gets the RAPID data type of the Data Declaration.
Declaration
public string DataType { get; }
Property Value
Examples
Get DataType.
Project.UndoContext.BeginUndoStep("RsGenericDataDeclarationProperties");
try
{
// ***This example requires a running VC***
Station station = Station.ActiveStation;
// Create a GenericDataDeclaration, representing a string value.
RsGenericDataDeclaration myGenDDString = new RsGenericDataDeclaration("myString", "string");
// Set the InitialExpression of the DataDeclaration.
myGenDDString.InitialExpression = "\"some_value\"";
// Set the module name the DataDeclaration should be syncronized to.
myGenDDString.ModuleName = "myModule_1";
// Define the DataDeclaration as variable.
myGenDDString.StorageType = RapidStorageType.Variable;
// Make sure the DataDeclaration is synchroinized when the task is.
myGenDDString.Synchronize = true;
// Add the DataDeclaration to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myGenDDString);
// Syncronize the DataDeclarations to the VC.
System.Collections.Generic.List<SyncLogMessage> syncLog_1 = new System.Collections.Generic.List<SyncLogMessage>();
await station.ActiveTask.SyncDataAsync(myGenDDString.ModuleName + "/" + myGenDDString.Name, SyncDirection.ToController, syncLog_1);
// Create a genric DataDeclaration, representing a 3-dimensional matrix
// where each dimension has 3 entries.
int[] dimensions = new int[3] { 3, 3, 3 };
RsGenericDataDeclaration myGenDDMatrix = new RsGenericDataDeclaration("myMatrix", "num", dimensions);
// Set the InitialExpression of the DataDeclaration.
myGenDDMatrix.InitialExpression = "[[[1,0,1],[0,0,1],[1,1,2]],[[1,2,1],[1,2,2],[1,1,3]],[[1,4,1],[1,1,2],[1,1,3]]]";
// Set the module name the DataDeclaration should be syncronized to.
myGenDDMatrix.ModuleName = "myModule_2";
// Define the DataDeclaration as persistent.
myGenDDMatrix.StorageType = RapidStorageType.TaskPersistent;
// Make sure the DataDeclaration is synchroinized when the task is.
myGenDDMatrix.Synchronize = true;
// Add the DataDeclaration to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myGenDDMatrix);
// Syncronize the DataDeclarations to the VC.
System.Collections.Generic.List<SyncLogMessage> syncLog_2 = new System.Collections.Generic.List<SyncLogMessage>();
await station.ActiveTask.SyncDataAsync(myGenDDMatrix.ModuleName + "/" + myGenDDMatrix.Name, SyncDirection.ToController, syncLog_2);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
DisplayName
Declaration
public override string DisplayName { get; }
Property Value
Overrides
Local
Gets or sets if the DataDeclaration is declared local in a module. (Corresponds to the LOCAL keyword in RAPID).
Declaration
public bool Local { get; set; }
Property Value
ModuleName
Gets or sets the name of the RAPID module that the DataDeclaration will be synchronized to.
Declaration
public string ModuleName { get; set; }
Property Value
Name
Gets or sets the name of the DataDeclaration
Declaration
public override string Name { get; set; }
Property Value
Overrides
StorageType
Declaration
public RapidStorageType StorageType { get; set; }
Property Value
Synchronize
Gets or sets whether the DataDeclaration should be synchronized to the VC when the referencing RsPathProcedure is.
Declaration
public bool Synchronize { get; set; }
Property Value
Methods
Copy()
Creates a copy of the DataDeclaration.
Declaration
public virtual ProjectObject Copy()
Returns
GetReferencingInstructions()
Returns all RsInstructions that are referencing this DataDeclaration.
Declaration
public RsInstruction[] GetReferencingInstructions()
Returns
Implements