Click or drag to resize

FpRapidData Constructor (RapidData, Int32)

Initializes a new instance of the FpRapidData class for an array data.

Namespace:  ABB.Robotics.Tps.Windows.Forms
Assembly:  ABB.Robotics.GTPU (in ABB.Robotics.GTPU.dll) Version: 6.5.129.0
Syntax
C#
public FpRapidData(
	RapidData rapidData,
	int[] arrayIndex
)

Parameters

rapidData
Type: ABB.Robotics.Controllers.RapidDomainRapidData
A RapidData instance that represent the the array object to edit.
arrayIndex
Type: SystemInt32
Indexes that represent the array element to edit (1 is first element).
Exceptions
ExceptionCondition
ArgumentExceptionrapidData is null or not an array.
ArgumentOutOfRangeExceptionarrayIndex is not valid for this array.
Examples
This example shows how to access the RAPID Data edit value dialog using an array. To be able to use the dialog you must create some objects.
private ABB.Robotics.Controllers.Controller controller;
private ABB.Robotics.Controllers.RapidDomain.Rapid rapid;
private ABB.Robotics.Controllers.RapidDomain.Task task;
private ABB.Robotics.Controllers.RapidDomain.Module module;
...
controller = new ABB.Robotics.Controllers.Controller();
rapid = controller.Rapid;
In this example we are creating a generic method for accessing the dialog. In the calling routine the array indexes must be compliant with the array data defined in RAPID.
int[] arrayIndex = new int[3];
arrayIndex[0] = 1; arrayIndex[1] = 1; arrayIndex[2] = 1;
launchRapidEditDialog("T_ROB1","MainModule",MyArray3Dim,arrayIndex);
private void launchRapidEditDialog(string taskName, string moduleName, string anyDataArray, int [] arrayIndex)
{
    task = rapid.GetTask(taskName);
    if (task != null)
    {
        module = task.GetModule(moduleName);
        if (module != null)
        {
            using (ABB.Robotics.Controllers.RapidDomain.RapidData data = module.GetRapidData(anyDataArray))
            {
                if (data != null)
                {
                    try
                    {
                        ABB.Robotics.Tps.Windows.Forms.FpRapidData ui = 
                                new ABB.Robotics.Tps.Windows.Forms.FpRapidData(data, arrayIndex);
                        ui.ShowMe(this);
                    }
                    catch (System.Exception e)
                    {
                        // Do something!
                    }
                }
            }
        }
    }
}
See Also