Click or drag to resize

RapidCycleChanged Event

This event occurs when Cycle property has changed.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public event ExecutionCycleChangedEventHandler CycleChanged

Value

Type: ABB.Robotics.Controllers.RapidDomainExecutionCycleChangedEventHandler
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Remarks
Any subscriber that wants to update their GUI as response to the event has to redirect the execution to the GUI-thread, using a Invoke method. Note: You should not switch to GUI-thread if you don't have to since a thread switch have impact on performance.
Examples
This example sets up a subscription to CycleChanged event.
bool ITpsViewSetup.Install(object sender, object data)
{
bool result = true;
try
{
// Create Controller
c = new Controller();

c.Rapid.CycleChanged +=
new CycleChangedEventHandler(r_ExecutionCycleChanged);
}
catch (System.Exception ee)
{
result = false;
}

return result;
}
// Event handler
private void r_ExecutionCycleChanged(object sender, CycleEventArgs e)
{
try
{
this.Invoke(new EventHandler(UpdateUiOnCycleChanged), sender, e);
}
catch (System.Exception ee)
{
// Any error handling goes here
}
}
// Method to call on the UI-thread
private void UpdateUiOnCycleChanged(object sender, EventArgs e)
{
try
{
CycleEventArgs cycleArg
= (CycleEventArgs)e;
if (cycleArg.Cycle == ExecutionCycle.Continuous)
{
// Do something, e.g., update GUI
}
else
{
// Do something, e.g., update GUI
}
}
catch (System.Exception ee)
{
// Any error handling goes here
}
}
See Also