RapidExecutionStatusChanged Event |
Namespace:
ABB.Robotics.Controllers.RapidDomain
Assembly:
ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
Exceptions
RemarksAny subscriber that wants to update their UI as response to
the event has to redirect the execution to the UI-thread, using a
Invoke method.
Note: You should not switch to UI-thread if you don't have to since
a thread switch have impact on performance.
ExamplesThis example sets up a subscription to the
ExecutionStatusChanged event. When a RAPID program
starts executing the GUI of the application should be disabled and when the execution stops it should be enabled.
bool ITpsViewSetup.Install(object sender,object data)
{
bool result = true;
try
{
c = new Controller();
c.Rapid.ExecutionStatusChanged +=
new ExecutionStatusChangedEventHandler(r_ExecutionStatusChanged);
}
catch (System.Exception ee)
{
result = false;
}
return result;
}
private void r_ExecutionStatusChanged(object sender, ExecutionStatusChangedEventArgs e)
{
try
{
this.Invoke(new EventHandler(UpdateUiOnExeStatusChanged),sender,e);
}
catch (System.Exception ee)
{
}
}
private void UpdateUiOnExeStatusChanged(object sender, EventArgs e)
{
try
{
ExecutionStatusChangedEventArgs exStatusArg
= (ExecutionStatusChangedEventArgs) e;
if (exStatusArg.NewStatus == ExecutionStatus.Running)
this.DisableUI();
else
this.EnableUI();
}
catch (System.Exception ee)
{
}
}
See Also