private void InitVariables() { // Add local variables that are linked to corresponding variables on the physical RC8 controller // Add a variable linked to the robot connected to the RC8 controller Robot = RC8Controller.AddRobot("Arm"); // Add robot variables RobotBusyStatus = Robot.AddVariable("@BUSY_STATUS"); // Add a variable linked to the robot's busy status RobotState = Robot.AddVariable("@State"); // Add a variable which contains the current state of the robot RobotExternalSpeed = Robot.AddVariable("@Extspeed"); // Add a variable linked to the external (teach pendant) speed RobotCurrentPosition = Robot.AddVariable("@CURRENT_POSITION"); // Add a variable which contains the current robot position RobotCurrentAngle = Robot.AddVariable("@CURRENT_ANGLE"); // Add a variable which contains the current robot angle // Add variables that are linked to the current error code and description CurrentErrorCode = RC8Controller.AddVariable("@ERROR_CODE"); CurrentErrorDescription = RC8Controller.AddVariable("@ERROR_DESCRIPTION"); // Register to handle new message events from the controller // Every time the controller has a new message, the ShowMessage function will be called RC8Controller.OnMessage += new _ICaoControllerEvents_OnMessageEventHandler(ShowMessage); // Add a variable linked to string variable S10 RC8variable_S10 = RC8Controller.AddVariable("S10"); timer_InterfaceUpdate.Start(); // Start the GUI timer }
public DensoController(CaoController c) { controller = c; c.OnMessage += OnMessageEvent; OnLogEvent("Controller: robot add variable..."); foreach (var s in ControllerVarStrings) { ControllerCaoVars.Add(s, controller.AddVariable(s, null)); } for (int i = 0; i < 100; i++) { ControllerPointsPVars.Add("P" + i, controller.AddVariable("P" + i, null)); } for (int i = 0; i < 100; i++) { ControllerPointsJVars.Add("J" + i, controller.AddVariable("J" + i, null)); } }
private void button_Connect_Click(object sender, EventArgs e) { button_Connect.Enabled = false; // Create a link to the RC8 controller via the engine (CAO.exe) RC8Controller = ORiN_Engine.Workspaces.Item(0).AddController( "", // This is the name of the connection to the RC8 controller; Pass an empty string to have the controller auto-generate a name "CaoProv.DENSO.RC8", // This is the name of the DENSO ORiN provider for RC8; It must be exactly as shown "localhost", // This is the name of the machine executing the DENSO ORiN provider (usually the machine running this program) "Server=192.168.0.1"); // This is the IP address of the physical RC8 controller // Add a local variable that is linked to string variable S10 on the physical RC8 controller RC8variable_S10 = RC8Controller.AddVariable("S10"); button_ReadVariable.Enabled = true; button_WriteVariable.Enabled = true; button_Close.Enabled = true; }
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; }