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); }