Click or drag to resize

ModuleGetRapidData Method

Gets a RapidData object that references a RAPID data instance in the robot controller.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public RapidData GetRapidData(
	params string[] rapidData
)

Parameters

rapidData
Type: SystemString
An array of strings, which specifies where in the RAPID domain the RAPID data is declared.

Return Value

Type: RapidData
A RapidData object to access the RAPID data. If the RAPID data instance does not exist, the return value is null.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
ArgumentNullExceptionrapidData is null or empty.
Remarks
If the name of the declaring module is unknown SearchRapidSymbol(RapidSymbolSearchProperties, String, String) can be used to retrieve the RapidData object. NOTE:When the RapidData instance is no longer needed you must call its Dispose method.
Examples
This example uses the GetRapidData method in two different ways, first a RapidData object representing RAPID data declared in a module is created. Then a RapidData object representing RAPID data declared in a routine is created. If the values of these two objects are equal true is returned, else false.
private bool CompareValues(Module m,string stModVar,string stRoutName,string stRoutVar)
{
    RapidData rd1;
    RapidData rd2;
    bool result = false;
    try
    {
        // Get module declared variable
        rd1 = m.GetRapidData(stModVar);

        // Get routine declared variable
        rd2 = m.GetRapidData(stRoutName,stRoutVar);

        result = (rd1.Value.ToString() == rd2.Value.ToString());
    }
    catch (GeneralException ee)
    {
        // TODO: Add error handling
    }
    catch (System.Exception ee)
    {
        // TODO: Add error handling
    }
    finally
    {
        // Release resources
        if (rd1 != null)
            rd1.Dispose();
        rd1 = null;

        if (rd2 != null)
            rd2.Dispose();
        rd2 = null;
    }

    return result;
}
See Also