コード例 #1
0
        public static int moveMagnet(double pos, double speed, double acc, MagnetMotorSetup setup)
        {
            int iuPos = (int)Math.Round(pos * 4 * setup.nLines * setup.TR / (2 * Math.PI));

            double iuSpeed = speed * 4 * setup.nLines * setup.TR * setup.Tslew / (2 * Math.PI);

            double iuAcc = acc * 4 * setup.nLines * setup.TR * setup.Tslew * setup.Tslew / (2 * Math.PI);

            return(MoveAbsolute(iuPos, iuSpeed, iuAcc, 1, 0));
        }
コード例 #2
0
        public static double getMotorPosition(MagnetMotorSetup setup)
        {
            int val = 0;
            //kaki+floe: needs update with specific names given a specific config
            //for the magnet drive position is (apparently) Target_Position
            string name = "Target_Position";

            GetLongVariable(name, ref val);

            double retVal = val * 2 * Math.PI / (4 * setup.nLines * setup.TR);

            return(retVal);
        }