Ejemplo n.º 1
0
        public void SetChannelVoltage(uint channelIndex, uint V_0_150)
        {
            // minimum step size=100, otherwise will mResult in error,
            // step=0-4095  SA_StepMove_S
            //mResult = CCoarseController.SA_GotoGripperOpeningRelative_S((uint)(uint)mSystemIndex, (uint)(uint)channelIndex, V_0_4095, 1);
            if (V_0_150 > 150)
            {
                V_0_150 = 150;
            }
            V_0_150 *= (uint)(4095.0 / 150.0);

            mResult = CCoarseController.SA_ScanMoveAbsolute_S((uint)mSystemIndex, (uint)(uint)channelIndex, V_0_150, 100000);


            if (mResult != CCoarseController.SA_OK)
            {
                //Initialize();
                MY_DEBUG("SetChannelVoltage error!\n");
                Initialize();

                MY_DEBUG("redo initialize=" + redo_count.ToString());
                if (redo_count++ < 10)
                {
                    SetChannelVoltage(channelIndex, V_0_150);
                }
            }
            redo_count = 0;
        }
Ejemplo n.º 2
0
        //////////////////////////////////////

        void  MoveToFinePosition(uint channel, uint position, uint speed)
        {
            if (position > 4095 || position < 0)
            {
                MY_DEBUG("MoveToFinePosition input exceeding error!\n");
            }
            if (position > 4095)
            {
                position = 4095;
            }
            if (position < 0)
            {
                position = 0;
            }

            CCoarseController.SA_ScanMoveAbsolute_S((uint)mSystemIndex, (uint)channel, position, speed);
        }