- Code: Select all
try
{
// All your code here
int j = 10 / i--;
}
catch (Exception ex)
{
// Handle the error
exec.AddStatusmessage("Error! " + ex.Message);
exec.Callbutton(130);
loop = false;
}
#Events
int i = 50;
(Start as a macroloop, it will divide by zero after 50*20 ms. Displays message, presses stop, stops macroloop.)
Edit: You can also turn on a flashing LED to show the error condition.