Click or drag to resize

RoutineGetRapidData 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
Name of the RAPID data instance.

Return Value

Type: RapidData
A RapidData object. If the RAPID data instance doesn't exist null is returned.
Exceptions
ExceptionCondition
ArgumentNullExceptionrapidData is null or empty.
GeneralExceptionA General Exception has occurred.
Remarks
NOTE:When the returned instance is no longer needed you must call its Dispose method.
Examples
This example uses the method GetRapidData(String) to get the value of the RAPID data stStr1.
private string GetRoutineString(Module m,string stRoutName)
{
   Routine routine;
   RapidData rd;
   string result = string.Empty;
   try
   {
     // Create routine object
     routine = m.GetRoutine(stRoutName);

     // Get RapidData of stStr1
     rd = routine.GetRapidData("stStr1");

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

     if (routine != null)
     routine.Dispose();
     routine = null;
   }
   return result;
}
See Also