private void button_Close_Click(object sender, EventArgs e) { // Properly shut down the local variables in reverse order of precedence so that the ORiN engine is not left hanging RC7Controller.Variables.Clear(); // Clear all local variables from the controller variable (THIS DOES NOT AFFECT VALUES ON THE PHYSICAL RC7 CONTROLLER) RC7variable_S10 = null; // Set the individual local variables to null RC7Task_RobSlave.Stop(1,""); //Stop the RobSlave program. (this is just a suggestion) RC7Controller.Tasks.Clear(); // Clear all local tasks handles from the controller variable RC7Task_RobSlave = null; // Set the individual local variables to null ORiN_Engine.Workspaces.Item(0).Controllers.Remove(RC7Controller.Index); // Remove the controller variable from the ORiN engine RC7Controller = null; // Set the individual controller variable to null ORiN_Engine = null; // Set the ORiN engine variable to null Close(); // Exit this C# program }
public void Stop() { task.Stop(4, null); }