Click or drag to resize

ModuleCreateRoutine Method (String, Boolean, RoutineType, String, ParameterData)

Creates an empty routine in the module in accordance with specified parameters.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public bool CreateRoutine(
	string routineName,
	bool bLocal,
	RoutineType type,
	string rtnType,
	params ParameterData[] para
)

Parameters

routineName
Type: SystemString
Name of the routine.
bLocal
Type: SystemBoolean
True if it should be a local routine, false if global.
type
Type: ABB.Robotics.Controllers.RapidDomainRoutineType
Specifes the routine type, see RoutineType
rtnType
Type: SystemString
Specifies the return type if the routine is a function.
para
Type: ABB.Robotics.Controllers.RapidDomainParameterData
Specifies the parameters of the routine, see ParameterData

Return Value

Type: Boolean
True if the operation succeeded; otherwise false.
Examples
This example creates a local function with two parameters. The data type of the return value of the function is num.
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.RapidDomain;
...
Controller c = new Controller();
Task[] allTasks = c.Rapid.GetTasks();
Task firstTask = allTasks[0];
Module mod = _task.GetModule("MyModule");
ParameterData p1 = new ParameterData("num","count");
ParameterData p2 = new ParameterData("string","aaa");
mod.CreateRoutine("Routine1", true, RoutineType.FUNC, "num", p1, p2);
...
See Also