Exemplo n.º 1
0
        static void Main(string[] args)
        {
            SpiralLab.Core.Initialize();

            #region initialize RTC
            //var rtc = new RtcVirtual(0); //create Rtc for dummy
            //var rtc = new Rtc5(0); //create Rtc5 controller
            //var rtc = new Rtc6(0); //create Rtc6 controller
            //var rtc = new Rtc6Ethernet(0, "192.168.0.100", "255.255.255.0"); //실험적인 상태 (Scanlab Rtc6 Ethernet 제어기)
            var rtc = new Rtc6SyncAxis(0, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "syncaxis", "syncAXISConfig.xml")); //실험적인 상태 (Scanlab XLSCAN 솔류션)

            rtc.Initialize(0, 0, string.Empty);
            rtc.CtlFrequency(50 * 1000, 2); // laser frequency : 50KHz, pulse width : 2usec
            rtc.CtlSpeed(100, 100);         // default jump and mark speed : 100mm/s
            #endregion

            #region initialize Laser (virtual)
            ILaser laser = new LaserVirtual(0, "virtual", 20);  /// 최대 출력 20W 의 가상 레이저 소스 생성
            #endregion

            ConsoleKeyInfo key;
            do
            {
                Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (http://spirallab.co.kr)");
                Console.WriteLine("");
                Console.WriteLine("'F1' : draw rectangle 2D with scanner only");
                Console.WriteLine("'F2' : draw rectangle 2D with stage only");
                Console.WriteLine("'F3' : draw rectangle 2D with scanner and stage");
                Console.WriteLine("'M' : move stage x and y");
                Console.WriteLine("'Q' : quit");
                Console.WriteLine("");
                Console.Write("select your target : ");
                key = Console.ReadKey(false);
                if (key.Key == ConsoleKey.Q)
                {
                    break;
                }
                Console.WriteLine("");
                switch (key.Key)
                {
                case ConsoleKey.F1:
                    Draw(rtc, laser, MotionType.ScannerOnly);
                    break;

                case ConsoleKey.F2:
                    Draw(rtc, laser, MotionType.StageOnly);
                    break;

                case ConsoleKey.F3:
                    Draw(rtc, laser, MotionType.StageAndScanner);
                    break;

                case ConsoleKey.M:
                    rtc.StageMoveSpeed   = 10;
                    rtc.StageMoveTimeOut = 5;
                    rtc.CtlMove(MotionType.StageOnly, 10, 10);
                    break;
                }
            } while (true);
        }
Exemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var xmlConfigFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "syncAxis", "syncAXISConfig.xml");

            if (!File.Exists(xmlConfigFileName))
            {
                MessageBox.Show($"XML configuration file is not founded : {xmlConfigFileName}");
                return;
            }

            #region SyncAxis 초기화
            bool success = true;
            var  rtc     = new Rtc6SyncAxis(0, xmlConfigFileName);
            rtc.Name = "SyncAxis";
            success &= rtc.Initialize(0, LaserMode.None, string.Empty);
            success &= rtc.CtlFrequency(50 * 1000, 2); // laser frequency : 50KHz, pulse width : 2usec
            success &= rtc.CtlSpeed(100, 100);         // default scanner jump and mark speed : 100mm/s

            //스테이지 이동시 기본 값 설정
            rtc.StageMoveSpeed   = 10;
            rtc.StageMoveTimeOut = 5;
            #endregion


            #region 레이저 소스 초기화
            var laser = new LaserVirtual(0, "virtual", 20);  // virtual laser source with max 20W power (최대 출력 20W 의 가상 레이저 소스 생성)
            //var laser = new IPGYLP(0, "IPG YLP", 1, 20);
            //var laser = new JPTTypeE(0, "JPT Type E", 1, 20);
            //var laser = new SPIG4(0, "SPI G3/4", 1, 20);
            //var laser = new PhotonicsIndustryDX(0, "PI", 1, 20);
            //var laser = new AdvancedOptoWaveFotia(0, "Fotia", 1, 20);
            //var laser = new CoherentAviaLX(0, "Avia LX", 1, 20);
            laser.Rtc = rtc;
            laser.Initialize();
            laser.CtlPower(2);
            #endregion


            #region 마커 지정
            var marker = new MarkerDefault(0, " SyncAxis Marker ");
            #endregion

            #region RTC 확장 IO
            this.RtcExt1DInput = new RtcDInput(rtc, 0, "DIN RTC EXT1");
            this.RtcExt1DInput.Initialize();
            this.RtcExt1DOutput = new RtcDOutputExt1(rtc, 0, "DOUT RTC EXT1");
            this.RtcExt1DOutput.Initialize();
            this.RtcExt2DOutput = new RtcDOutputExt2(rtc, 0, "DIN RTC EXT2");
            this.RtcExt2DOutput.Initialize();
            this.siriusEditorForm1.RtcExtension1Input  = this.RtcExt1DInput;
            this.siriusEditorForm1.RtcExtension1Output = this.RtcExt1DOutput;
            this.siriusEditorForm1.RtcExtension2Output = this.RtcExt2DOutput;
            #endregion

            this.Rtc = rtc;
            this.siriusEditorForm1.Rtc    = rtc;
            this.siriusEditorForm1.Laser  = laser;
            this.siriusEditorForm1.Marker = marker;
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            SpiralLab.Core.Initialize();

            #region initialize RTC
            //var rtc = new RtcVirtual(0); ///create Rtc for dummy
            //var rtc = new Rtc5(0); ///create Rtc5 controller
            //var rtc = new Rtc6(0); ///create Rtc6 controller
            //var rtc = new Rtc6Ethernet(0, "192.168.0.200"); ///create Rtc6 ethernet controller
            //var rtc = new Rtc53D(0); ///create Rtc5 + 3D option controller
            //var rtc = new Rtc63D(0); ///create Rtc5 + 3D option controller
            //var rtc = new Rtc5DualHead(0); ///create Rtc5 + Dual head option controller
            //var rtc = new Rtc5MOTF(0); ///create Rtc5 + MOTF option controller
            //var rtc = new Rtc6MOTF(0); ///create Rtc6 + MOTF option controller
            //var rtc = new Rtc6SyncAxis(0);
            var rtc = new Rtc6SyncAxis(0, "syncAXISConfig.xml"); ///create Rtc6 + XL-SCAN (ACS+SYNCAXIS) option controller

            /// 스캐너 보정파일(ct5)은 xml 에서 설정됨
            rtc.Initialize(0.0f, LaserMode.Yag1, string.Empty);
            rtc.CtlFrequency(50 * 1000, 2);     /// laser frequency : 50KHz, pulse width : 2usec
            rtc.CtlSpeed(100, 100);             /// default jump and mark speed : 100mm/s
            rtc.CtlDelay(10, 100, 200, 200, 0); /// scanner and laser delays
            #endregion

            #region initialize Laser (virtial)
            ILaser laser = new LaserVirtual(0, "virtual", 20);
            #endregion

            ConsoleKeyInfo key;
            do
            {
                Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (https://sepwind.blogspot.com)");
                Console.WriteLine("");
                Console.WriteLine("'C' : draw circle (scanner only)");
                Console.WriteLine("'R' : draw rectangle (stage only)");
                Console.WriteLine("'L' : draw circle with lines (stage + scanner)");
                Console.WriteLine("'Q' : quit");
                Console.WriteLine("");
                Console.Write("select your target : ");
                key = Console.ReadKey(false);
                if (key.Key == ConsoleKey.Q)
                {
                    break;
                }
                Console.WriteLine("\r\nWARNING !!! LASER IS BUSY ...");
                var timer = Stopwatch.StartNew();
                switch (key.Key)
                {
                case ConsoleKey.C:
                    DrawCircle(laser, rtc, 10);
                    break;

                case ConsoleKey.R:
                    DrawRectangle(laser, rtc, 10, 10);
                    break;

                case ConsoleKey.L:
                    DrawCircleWithLines(laser, rtc, 10);
                    break;
                }

                Console.WriteLine($"processing time = {timer.ElapsedMilliseconds / 1000.0:F3}s");
            } while (true);

            rtc.Dispose();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            SpiralLab.Core.Initialize();

            #region initialize RTC
            //var rtc = new RtcVirtual(0); //create Rtc for dummy
            //var rtc = new Rtc5(0); //create Rtc5 controller
            //var rtc = new Rtc6(0); //create Rtc6 controller
            //var rtc = new Rtc6Ethernet(0, "192.168.0.100", "255.255.255.0"); //실험적인 상태 (Scanlab Rtc6 Ethernet 제어기)
            string configXmlFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "syncaxis", "syncAXISConfig.xml");
            var    rtc = new Rtc6SyncAxis(0, configXmlFileName); // Scanlab XLSCAN 솔류션

            rtc.Initialize(0, 0, string.Empty);
            rtc.CtlFrequency(50 * 1000, 2); // laser frequency : 50KHz, pulse width : 2usec
            rtc.CtlSpeed(100, 100);         // default jump and mark speed : 100mm/s
            #endregion

            #region initialize Laser (virtual)
            var laser = new LaserVirtual(0, "virtual", 20);  // virtual laser source with max 20W power (최대 출력 20W 의 가상 레이저 소스 생성)
            //var laser = new IPGYLP(0, "IPG YLP", 1, 20);
            //var laser = new JPTTypeE(0, "JPT Type E", 1, 20);
            //var laser = new SPIG4(0, "SPI G3/4", 1, 20);
            //var laser = new PhotonicsIndustryDX(0, "PI", 1, 20);
            //var laser = new AdvancedOptoWaveFotia(0, "Fotia", 1, 20);
            //var laser = new CoherentAviaLX(0, "Avia LX", 1, 20);
            laser.Rtc = rtc;
            laser.Initialize();
            laser.CtlPower(2);
            #endregion

            ConsoleKeyInfo key;
            do
            {
                Console.WriteLine("Testcase for spirallab.sirius. powered by [email protected] (http://spirallab.co.kr)");
                Console.WriteLine("");
                Console.WriteLine("'S' : simulation mode enabled");
                Console.WriteLine("'H' : hardware mode enabled");
                Console.WriteLine("'C' : job characteristic");
                Console.WriteLine("'F1' : draw rectangle 2D with scanner only");
                Console.WriteLine("'F2' : draw rectangle 2D with stage only");
                Console.WriteLine("'F3' : draw rectangle 2D with scanner and stage");
                Console.WriteLine("'F10' : get status");
                Console.WriteLine("'F11' : reset");
                Console.WriteLine("'F12' : abort");
                Console.WriteLine("'M' : move stage x and y");
                Console.WriteLine("'Q' : quit");
                Console.WriteLine("");
                Console.Write("select your target : ");
                key = Console.ReadKey(false);
                if (key.Key == ConsoleKey.Q)
                {
                    break;
                }
                Console.WriteLine("");
                switch (key.Key)
                {
                case ConsoleKey.S:
                    rtc.CtlSimulationMode(true);
                    break;

                case ConsoleKey.H:
                    rtc.CtlSimulationMode(false);
                    break;

                case ConsoleKey.F1:
                    Draw(rtc, laser, MotionType.ScannerOnly);
                    break;

                case ConsoleKey.F2:
                    Draw(rtc, laser, MotionType.StageOnly);
                    break;

                case ConsoleKey.F3:
                    //band width 변경 가능
                    //rtc.CtlBandWidth(2.0f);
                    //멀티헤드 사용시 개별 헤드별 오프셋 처리 가능
                    //rtc.CtlHeadOffset(ScanDevice.ScanDevice1, new Vector2(0.1f, 0.2f), 5);
                    //rtc.CtlHeadOffset(ScanDevice.ScanDevice2, new Vector2(-0.1f, -0.2f), -5);
                    Draw(rtc, laser, MotionType.StageAndScanner);
                    break;

                case ConsoleKey.F10:
                    if (rtc.CtlGetStatus(RtcStatus.Busy))
                    {
                        Console.WriteLine("rtc is busy now ...");
                    }
                    else
                    {
                        Console.WriteLine("rtc is not busy ...");
                    }

                    rtc.CtlGetDynamicsConfig(out var dynamics);
                    Console.WriteLine(dynamics.ToString());
                    rtc.CtlGetTrajectory(out var trajectory);
                    Console.WriteLine(trajectory.ToString());
                    {
                        rtc.CtlGetScannerPosition(ScanDevice.ScanDevice1, out float x, out float y);
                        Console.WriteLine($"scanner x= {x:F3}, y= {y:F3}");
                    }
                    {
                        rtc.CtlGetStagePosition(out float x, out float y);
                        Console.WriteLine($"stage x= {x:F3}, y= {y:F3}");
                    }

                    Console.WriteLine($"band width= {rtc.BandWidth}");
                    Console.WriteLine($"simulation mode= {rtc.IsSimulationMode} with {rtc.SimulationFileName}");

                    break;

                case ConsoleKey.F11:
                    rtc.CtlReset();
                    break;

                case ConsoleKey.F12:
                    rtc.CtlAbort();
                    break;

                case ConsoleKey.C:
                    PrintJobCharacteristic(rtc);
                    break;

                case ConsoleKey.M:
                    rtc.StageMoveSpeed   = 10;
                    rtc.StageMoveTimeOut = 5;
                    rtc.CtlMove(MotionType.StageOnly, 10, 10);
                    break;
                }
            } while (true);
        }