public int initialize() { int nRetVal = 0; try { string strChannel = _channel.ToString("00"); // Set the motor parameters. HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model; int nResult = initializeMotorParams(_channel, theModel.Config.m_R2Piston_Configuration); if (nResult != 0) { // Initialization failed. logger.Debug("deviceR2Piston::initialize failed."); } else { HelixGenModel _theModel = ((HelixGen.App)(App.Current)).Model; clsAMB controller = _theModel.getMotorBoard(_controllerId); // Move the pump to the initial position. //RNNosition = 89000; controller.SetDirectionPolarity(strChannel, "0"); controller.MoveHome(strChannel); controller.WaitForCompletion(strChannel); /* * controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "2580"); * controller.WaitForCompletion(strChannel);*/ /* * controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "50064"); * controller.WaitForCompletion(strChannel);*/ controller.SetResolution(theModel.Config.m_R2Piston_Configuration.m_nMotorChannel.ToString("00"), theModel.Config.m_R2Piston_Configuration.m_uiMotorResolution.ToString()); // Position = 3; // RNPosition = 50000;//9.9mm // RNNosition = 89000; } } catch (Exception) { nRetVal = 1; } return(nRetVal); }
public int initialize() { int nRetVal = 0; try { string strChannel = _channel.ToString("00"); // Set the motor parameters. HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model; int nResult = initializeMotorParams(_channel, theModel.Config.m_ChassisPiston_Configuration); if (nResult != 0) { // Initialization failed. logger.Debug("deviceChassisPiston::initialize failed."); } else { clsAMB controller = theModel.getMotorBoard(theModel.Config.m_ChassisPiston_Configuration.m_strControllerName); // Move the pump to the initial position. /* * controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "2700"); * controller.WaitForCompletion(strChannel);*/ // controller.SetDirectionPolarity(strChannel, "0"); controller.MoveHome(strChannel); controller.WaitForCompletion(strChannel); /* * controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "5000"); * controller.WaitForCompletion(strChannel); */ controller.SetResolution(theModel.Config.m_ChassisPiston_Configuration.m_nMotorChannel.ToString("00"), theModel.Config.m_ChassisPiston_Configuration.m_uiMotorResolution.ToString()); //Position = 1; } } catch (Exception ex) { logger.Debug("deviceChassisPiston::initialize() Caught an exception: {0}", ex.Message); nRetVal = 1; } return(nRetVal); }
public int initialize1() { int nRetVal = 0; try { string strChannel = _channel.ToString("00"); // Set the motor parameters. HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model; HelixGenModel _theModel = ((HelixGen.App)(App.Current)).Model; clsAMB controller = _theModel.getMotorBoard(_controllerId); // Move the pump to the initial position. //RNNosition = 89000; controller.SetDirectionPolarity(strChannel, "0"); controller.MoveRelativePositive(strChannel, "12080"); controller.WaitForCompletion(strChannel); /* * controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "68100"); * controller.WaitForCompletion(strChannel);*/ controller.SetResolution(theModel.Config.m_R2Piston_Configuration.m_nMotorChannel.ToString("00"), theModel.Config.m_R2Piston_Configuration.m_uiMotorResolution.ToString()); // Position = 3; // RNPosition = 50000;//9.9mm // RNNosition = 89000; } catch (Exception) { nRetVal = 1; } return(nRetVal); }
public int initialize() { int nRetVal = 0; try { string strChannel = _channel.ToString("00"); // Set the motor parameters. HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model; int nResult = initializeMotorParams(_channel, theModel.Config.m_Slider_Configuration); if (nResult != 0) { // Initialization failed. logger.Debug("deviceSlider::initialize failed."); } else { clsAMB controller = theModel.getMotorBoard(_controllerId); // Move the pump to the initial position. controller.SetDirectionPolarity(strChannel, "0"); controller.MoveHome(strChannel); controller.WaitForCompletion(strChannel); controller.MoveRelativePositive(strChannel, "4510"); controller.WaitForCompletion(strChannel); /* * //controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "9500"); * controller.WaitForCompletion(strChannel); * * * controller.SetDirectionPolarity(strChannel, "1"); * //controller.MoveRelativePositive(strChannel, "6156"); * controller.MoveRelativePositive(strChannel, "5800"); * controller.WaitForCompletion(strChannel); * * controller.MoveRelativePositive(strChannel, "4300"); * controller.WaitForCompletion(strChannel); * * controller.SetDirectionPolarity(strChannel, "0"); */ /* controller.MoveToAbsolutePosition(strChannel, * "11114"); * controller.WaitForCompletion(strChannel);*/ //controller.SetDirectionPolarity(strChannel, "1"); controller.SetResolution(theModel.Config.m_Slider_Configuration.m_nMotorChannel.ToString("00"), theModel.Config.m_Slider_Configuration.m_uiMotorResolution.ToString()); //Position = 2; // Position = 1; //RNPosition = 9614; //RNNosition = 6307; //RNNosition = 3307; } } catch (Exception ex) { logger.Debug("deviceSlider::initialize() Caught an exception: {0}", ex.Message); nRetVal = 1; } return(nRetVal); }
public int initialize() { int nRetVal = 0; try { string strChannel = _channel.ToString("00"); // Set the motor parameters. HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model; int nResult = initializeMotorParams(_channel, theModel.Config.m_OpticsMotor_Configuration); if (nResult != 0) { // Initialization failed. logger.Debug("deviceOpticsMotor::initialize failed."); } else { clsAMB controller = theModel.getMotorBoard(_controllerId); // Move the pump to the initial position. string value; controller.GetHomeSwitchStatus(strChannel, out value); if (Int32.Parse(value) == 0) { controller.MoveHome(strChannel); controller.WaitForCompletion(strChannel); } // theModel.DeviceOpticsMotor.Position = 4; /* * for (int nLED = 0; nLED < 6; nLED++) * { * theModel.OpticsModel.SetLedCurrent(nLED + 1, 0.75); * //theModel.OpticsModel.SetLedCurrent(nLED + 1, 0); * } */ // controller.SetStartSpeed(strChannel, "400");//200,400 // controller.SetMaxSpeed(strChannel, "1200");//200,1600 /* * controller.SetDirectionPolarity(strChannel, "0"); * controller.MoveRelativePositive(strChannel, "100000000"); * controller.WaitForCompletion(strChannel); * controller.MoveRelativeNegative(strChannel, "0"); * controller.WaitForCompletion(strChannel); */ controller.SetResolution(theModel.Config.m_OpticsMotor_Configuration.m_nMotorChannel.ToString("00"), theModel.Config.m_OpticsMotor_Configuration.m_uiMotorResolution.ToString()); //if(isFirstIn) //ZeroOptic(); isFirstIn = false; // theModel.OpticsModel.TriggerPhotodetector(); // Position = 1; /* * controller.MoveToAbsolutePosition(strChannel, * "132"); * controller.WaitForCompletion(strChannel);*/ } } catch (Exception) { nRetVal = 1; } return(nRetVal); }