Exemplo n.º 1
0
        public static bool TrySetPosition(double position_mm)
        {
            string errorCode       = "";
            string errorString     = "";
            string controllerState = "";

            ConnexCcLock.DoJobOnSerial((CC, addr) =>
            {
                CC.TS(addr, out errorCode, out controllerState, out errorString);
                return(true);
            });


            if ((controllerState == "32") | (controllerState == "33") | (controllerState == "34"))
            {
                double position = 0.0;

                ConnexCcLock.DoJobOnSerial((CC, addr) =>
                {
                    CC.PA_Set(addr, position_mm, out errorString);
                    CC.TP(addr, out position, out errorString);
                    return(true);
                });

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public double GetPosition()
        {
            double position = 0.0;
            string error    = "";

            ConnexCcLock.DoJobOnSerial((CC, addr) =>
            {
                CC.TP(addr, out position, out error);
                return(true);
            });
            return(position);
        }
        public static bool IsMoving()
        {
            string errorCode       = "";
            string errorString     = "";
            string controllerState = "";

            ConnexCcLock.DoJobOnSerial((CC, addr) =>
            {
                CC.TS(addr, out errorCode, out controllerState, out errorString);

                return(true);
            });


            if (controllerState == "28")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }