Gets a
Task object referencing a specific task.
Namespace:
ABB.Robotics.Controllers.RapidDomain
Assembly:
ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax public Task GetTask(
string taskName
)
Parameters
- taskName
- Type: SystemString
Name of the task.
Return Value
Type:
TaskA
Task object to access the task. If the task does not exist, the return value is
null.
Exceptions Remarks NOTE:When the returned instance is no longer needed you must call its Dispose method.
Examples The example below gets an instance of
TaskT_ROB1,
uses its method
GetRapidData(String) to create a
RapidData
object of the RAPID variable
reg1, which is declared in the
USER module.
The value
reg1 is displayed in a textbox.
private void DisplayValueOfReg1()
{
Task t;
RapidData rdReg1;
try
{
Create Controller if not created
if (_controller == null)
_controller = new Controller();
t = _controller.Rapid.GetTask("T_ROB1");
rdReg1 = t.GetRapidData("T_ROB1","USER","reg1");
Num nValOfReg1 = (Num) rdReg1.Value;
textBox1.Text = nValOfReg1.ToString();
}
catch (GeneralException ee)
{
}
catch (System.Exception ee)
{
}
finally
{
if (rdReg1 != null)
rdReg1.Dispose();
if (t != null)
t.Dispose();
}
}
See Also