public DensoTask(CaoTask t) { task = t; foreach (var s in TaskVarStrings) { TaskCaoVars.Add(s, task.AddVariable(s, "")); } }
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 }
private void button_Connect_Click(object sender, EventArgs e) { button_Connect.Enabled = false; // Create a link to the RC7 controller via the engine (CAO.exe) RC7Controller = ORiN_Engine.Workspaces.Item(0).AddController( "Sample", // This is the name of the connection to the RC7 controller; Pass an empty string to have the controller auto-generate a name "CaoProv.DENSO.NetwoRC", // This is the name of the DENSO ORiN provider for RC7; It must be exactly as shown "", // This is the name of the machine executing the DENSO ORiN provider (usually the machine running this program) "Conn=eth:192.168.0.2"); // This is the IP address of the physical RC7 controller //In order to perform motion commands on the pc side you should start the RobSlave.pac program on the RC7 RC7Task_RobSlave = RC7Controller.AddTask("RobSlave", ""); RC7Task_RobSlave.Start(1, ""); // Add a local variable that is linked to string variable S10 on the physical RC7 controller RC7variable_S10 = RC7Controller.AddVariable("S10"); button_ReadVariable.Enabled = true; button_WriteVariable.Enabled = true; button_Close.Enabled = true; }