예제 #1
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetSpindelSetRPMMessage(double RPM, string Direction)
        {
            CNCMessage spindelmessage = new CNCMessage();
            string     dir            = Direction.Trim().ToLower();

            if (RPM < 0)
            {
                return(spindelmessage);
            }
            if (dir != "clockwise" && dir != "counterclockwise")
            {
                return(spindelmessage);
            }


            if (dir == "clockwise")
            {
                spindelmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.RTC_SetSpindleSpeedClockWise));
                spindelmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "S", RPM.ToString()));
            }
            else if (dir == "counterclockwise")
            {
                spindelmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.RTC_SetSpindleSpeedCounterClockWise));
                spindelmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "S", RPM.ToString()));
            }

            return(spindelmessage);
        }
예제 #2
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        /// <summary>
        /// Gets a GRBL Message for moving the tool by ... Millimeters in X direction
        /// </summary>
        /// <returns></returns>
        public override CNCMessage GetMoveByXMessage(double XMillimieter, double Feed)
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "X", XMillimieter.ToString()));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "F", Feed.ToString()));

            return(rmessage);
        }
예제 #3
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetJogByZMessage(double ZMillimieter, double Feed)
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_RunJoggingMogion));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "Z", ZMillimieter.ToString()));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "F", Feed.ToString()));

            return(rmessage);
        }
예제 #4
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetRelativeJogByZMessage(double ZMillimeter, double Feed)
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_RunJoggingMogion));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.G_SetUnitToMillimeter_G21));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.G_RelativeMotion_G91));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "Z", ZMillimeter.ToString()));
            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteValue, "F", Feed.ToString()));

            return(rmessage);
        }
예제 #5
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        /// <summary>
        /// Gets a GRBL Message for Z
        /// </summary>
        /// <returns>CNCMessage</returns>
        public override CNCMessage GetCurrentZMessage()
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.RTC_StatusReportQuery));

            return(rmessage);
        }
예제 #6
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetKillAlarmMessage()
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_KillAlarmLock));

            return(rmessage);
        }
예제 #7
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetSoftResetMessage()
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.RTC_SoftReset));

            return(rmessage);
        }
예제 #8
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        /// <summary>
        /// Gets a GRBL Message for Feed.
        /// This is the message who will returned
        /// [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0]
        /// </summary>
        /// <returns>CNCMessage</returns>
        public override CNCMessage GetCurrentFeedMessage()
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_ViewGCODEParserState));

            return(rmessage);
        }
예제 #9
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        /// <summary>
        /// Gets a GRBL Message for setting the feed of the CNC Controller
        /// </summary>
        /// <returns></returns>
        public override CNCMessage GetSetFeedMessage(double Feed)
        {
            CNCMessage rmessage = new CNCMessage();

            rmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_WriteSetting, "F", Feed.ToString()));

            return(rmessage);
        }
예제 #10
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetHomingMessage()
        {
            CNCMessage homingmessage = new CNCMessage();

            homingmessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.GRBL_RunHomincCycle));


            return(homingmessage);
        }
예제 #11
0
파일: GRBLProtokoll.cs 프로젝트: Bobbbl/PC
        public override CNCMessage GetSetZeroMessage()
        {
            CNCMessage zeromessage = new CNCMessage();

            zeromessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.G_SetOffset_G10));
            zeromessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.P_Tool1));
            zeromessage.AppendCommand(CommandDict.GetCommand(GRBLCommand.L20));
            zeromessage.AppendCommand("X0 ");
            zeromessage.AppendCommand("Y0 ");
            zeromessage.AppendCommand("Z0");


            return(zeromessage);
        }