RsGenericDataDeclaration Class |
Namespace: ABB.Robotics.RobotStudio.Stations
public sealed class RsGenericDataDeclaration : RsDataDeclaration
The RsGenericDataDeclaration type exposes the following members.
Name | Description | |
---|---|---|
RsGenericDataDeclaration(String, String) |
Initializes a new instance of the RsGenericDataDeclaration class.
| |
RsGenericDataDeclaration(String, String, Int32) |
Initializes a new instance of the RsGenericDataDeclaration class as an array with 1-3 dimensions.
|
Name | Description | |
---|---|---|
Attributes |
Returns a collection of dynamic attributes attached to the object
(Inherited from ProjectObject.) | |
Children |
Enumerates all child objects.
(Inherited from ProjectObject.) | |
ContainingProject |
Returns the Project that this object is a part of, or null if it is
not part of a Project.
(Inherited from ProjectObject.) | |
DataType |
Gets the RAPID data type of the Data Declaration.
(Inherited from RsDataDeclaration.) | |
DisplayName | (Inherited from RsDataDeclaration.) | |
InitialExpression |
Gets or sets the InitialExpression of the DataDeclaration.
| |
Local |
Gets or sets if the DataDeclaration is declared local in a module. (Corresponds to the LOCAL keyword in RAPID).
(Inherited from RsDataDeclaration.) | |
ModuleName |
Gets or sets the name of the RAPID module that the DataDeclaration will be synchronized to.
(Inherited from RsDataDeclaration.) | |
Name |
Gets or sets the name of the DataDeclaration
(Inherited from RsDataDeclaration.) | |
Parent |
Returns the objects parent, if it has one.
(Inherited from ProjectObject.) | |
StorageType |
Gets or sets the RapidStorageType of the DataDeclaration
(Inherited from RsDataDeclaration.) | |
Synchronize |
Gets or sets whether the DataDeclaration should be synchronized to the VC when the referencing RsPathProcedure is.
(Inherited from RsDataDeclaration.) | |
TypeDisplayName |
Gets a localized name for the type of this object.
(Inherited from ProjectObject.) | |
UIVisible |
Gets or sets a value that indicates if this object should be displayed in GUI
such as an object browser.
(Inherited from ProjectObject.) | |
UniqueId |
Gets a persisted, globally unique identifier for this object, that can be used
to find the object using the GetObjectFromUniqueId(String) method.
(Inherited from ProjectObject.) |
Name | Description | |
---|---|---|
Copy |
Creates a copy of the DataDeclaration.
(Inherited from RsDataDeclaration.) | |
Equals | (Inherited from Object.) | |
FindObjects |
Recursively finds object that satisfy a condition.
(Inherited from ProjectObject.) | |
GetDimensions | Gets the dimensions of the DataDeclaration. | |
GetHashCode | (Inherited from Object.) | |
GetReferencingInstructions |
Returns all RsInstructions that are referencing this DataDeclaration.
(Inherited from RsDataDeclaration.) | |
GetType | (Inherited from Object.) | |
ToString | (Inherited from ProjectObject.) |
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(); }