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 DensoRobot(CaoRobot r) { robot = r; OnLogEvent("Robot: robot add variable..."); foreach (var s in RobotVarStrings) { RobCaoVars.Add(s, robot.AddVariable(s, "")); } }