Пример #1
0
        private bool IsListReady(uint count)
        {
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }
            const uint RTC5_LIST_BUFFER_MAX = 4000;

            if ((this.listCount + count) >= RTC5_LIST_BUFFER_MAX)
            {
                uint busy, position;
                busy = position = 0;
                RTC5Wrap.n_get_status(this.Index + 1, out busy, out position);
                if (0 != busy)
                {
                    RTC5Wrap.n_set_end_of_list(this.Index + 1);
                    RTC5Wrap.n_execute_list(this.Index + 1, this.listIndex);
                    this.listIndex = this.listIndex ^ 0x03;
                    RTC5Wrap.n_set_start_list(this.Index + 1, this.listIndex);
                }
                else
                {
                    RTC5Wrap.n_set_end_of_list(this.Index + 1);
                    if (this.CtlGetStatus(RtcStatus.Aborted))
                    {
                        return(false);
                    }

                    RTC5Wrap.n_auto_change(this.Index + 1);
                    uint readStatus = 0;
                    switch (this.listIndex)
                    {
                    case 1:
                        do
                        {
                            readStatus = RTC5Wrap.n_read_status(this.Index + 1);
                            System.Threading.Thread.Sleep(1);
                        }while (Convert.ToBoolean(readStatus & 0x20));
                        break;

                    case 2:
                        do
                        {
                            readStatus = RTC5Wrap.n_read_status(this.Index + 1);
                            System.Threading.Thread.Sleep(1);
                        }while (Convert.ToBoolean(readStatus & 0x10));
                        break;
                    }
                    if (this.CtlGetStatus(RtcStatus.Aborted))
                    {
                        return(false);
                    }
                    this.listIndex = this.listIndex ^ 0x03;
                    RTC5Wrap.n_set_start_list(this.Index + 1, this.listIndex);
                }
                this.listCount = count;
            }
            this.listCount += count;
            return(true);
        }
Пример #2
0
        /// <summary>
        /// 关闭激光,移动激光聚焦点至加工起始位置
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public static void Rtc_Ready(decimal x, decimal y)
        {
            UInt32 List_No = 1u;

            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //  执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(List_No, 0u) == 0);
            // Transmit the following list commands to the list buffer.
            RTC5Wrap.set_start_list(List_No);
            //修正当前位置00
            RTC5Wrap.jump_abs(-Convert.ToInt32(y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(x * Para_List.Parameter.Rtc_Pos_Reference));
            //设置List结束位置
            RTC5Wrap.set_end_of_list();
            //启动执行
            RTC5Wrap.execute_list(List_No);
            //Busy 运行等待结束
            uint Busy;

            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
            //goto 指定点
            RTC5Wrap.goto_xy(-Convert.ToInt32(y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(x * Para_List.Parameter.Rtc_Pos_Reference));
        }
Пример #3
0
        public bool Initialize(double kFactor, LaserMode laserMode, string ctbFileName)
        {
            Debug.Assert(kFactor > 0);
            RTC5Wrap.n_stop_execution(this.Index + 1);
            uint error      = RTC5Wrap.n_load_program_file(this.Index + 1, string.Empty);
            uint cardCnt    = RTC5Wrap.rtc5_count_cards();
            uint dllVersion = RTC5Wrap.get_dll_version();
            uint hexVersion = RTC5Wrap.get_hex_version();
            uint rtcVersion = RTC5Wrap.get_rtc_version();
            uint lastError  = RTC5Wrap.n_get_last_error(this.Index + 1);
            uint serialNo   = RTC5Wrap.n_get_serial_number(this.Index + 1);

            this.kFactor = kFactor;
            ///active high
            RTC5Wrap.n_set_laser_control(this.Index + 1, 0);

            if (!this.CtlLoadCorrectionFile(CorrectionTableIndex.Table1, ctbFileName))
            {
                return(false);
            }
            if (!this.CtlSelectCorrection(CorrectionTableIndex.Table1))
            {
                return(false);
            }
            RTC5Wrap.n_config_list(this.Index + 1, 4_000 * 2, 4_000 * 2);
            RTC5Wrap.n_set_laser_mode(this.Index + 1, (uint)laserMode);
            RTC5Wrap.n_set_firstpulse_killer(this.Index + 1, 0);
            RTC5Wrap.n_set_standby(this.Index + 1, 0, 0);
            return(true);
        }
Пример #4
0
        /// <summary>
        /// XY方向绝对位移
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="Control"></param>
        /// <param name="List_No"></param>
        public static void Abs_XY(decimal x, decimal y, UInt32 Control, UInt32 List_No)//距离、控制方式、list区域
        {
            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //  执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(List_No, 0u) == 0);
            // Transmit the following list commands to the list buffer.
            RTC5Wrap.set_start_list(List_No);

            //生成数据
            if (Control == 4)//jump_rel
            {
                RTC5Wrap.jump_rel(-Convert.ToInt32(y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(x * Para_List.Parameter.Rtc_Pos_Reference));
            }
            else if (Control == 6)//mark_rel
            {
                RTC5Wrap.mark_rel(-Convert.ToInt32(y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(x * Para_List.Parameter.Rtc_Pos_Reference));
            }
            //设置List结束位置
            RTC5Wrap.set_end_of_list();

            //启动执行
            RTC5Wrap.execute_list(List_No);

            //Busy 运行等待结束
            uint Busy;

            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
        }
Пример #5
0
 public bool CtlSelectCorrection(CorrectionTableIndex primaryHeadTableIndex, CorrectionTableIndex secondaryHeadTableIndex = CorrectionTableIndex.TableNone)
 {
     RTC5Wrap.n_select_cor_table(this.Index + 1,
                                 Convert.ToUInt32(primaryHeadTableIndex),
                                 Convert.ToUInt32(secondaryHeadTableIndex));
     return(true);
 }
Пример #6
0
        /// <summary>
        /// 执行 未经任何矫正的数据,包括坐标系匹配,用于原始振镜坐标系输出,进行桶形矫正
        /// </summary>
        /// <param name="Rtc_Datas"></param>
        /// <param name="List_No"></param>
        public static void Draw_Cal(List <Interpolation_Data> Rtc_Datas, UInt32 List_No)
        {
            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //  执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(List_No, 0u) == 0);
            // Transmit the following list commands to the list buffer.
            //RTC5Wrap.set_start_list(List_No);

            //初始Jump到启动点位
            RTC5Wrap.jump_abs(Convert.ToInt32(Rtc_Datas[0].Rtc_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Rtc_Datas[0].Rtc_y * Para_List.Parameter.Rtc_Pos_Reference));

            //生成数据
            foreach (var o in Rtc_Datas)
            {
                if (o.Type == 11)//arc_abs 绝对圆弧
                {
                    RTC5Wrap.arc_abs(Convert.ToInt32(o.Center_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.Center_y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle));
                }
                else if (o.Type == 12)//arc_rel
                {
                    RTC5Wrap.arc_rel(Convert.ToInt32(o.Center_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.Center_y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle));
                }
                else if (o.Type == 13)//jump_abs
                {
                    RTC5Wrap.jump_abs(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 14)//jump_rel
                {
                    RTC5Wrap.jump_rel(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 15)//mark_abs
                {
                    RTC5Wrap.mark_abs(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 16)//mark_rel
                {
                    RTC5Wrap.mark_rel(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference));
                }
            }
            //结束Jump到启动点位
            //RTC5Wrap.jump_abs(0,0);

            //设置List结束位置
            RTC5Wrap.set_end_of_list();

            //启动执行
            RTC5Wrap.execute_list(1u);

            //Busy 运行等待结束
            uint Busy;

            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
        }
Пример #7
0
 public bool ListEnd()
 {
     if (this.CtlGetStatus(RtcStatus.Aborted))
     {
         return(false);
     }
     RTC5Wrap.n_set_end_of_list(this.Index + 1);
     return(true);
 }
Пример #8
0
 public bool ListBegin()
 {
     Debug.Assert(this.CtlGetStatus(RtcStatus.NotBusy));
     this.listIndex = 1;
     this.listCount = 0;
     this.aborted   = false;
     RTC5Wrap.n_set_start_list(this.Index + 1, this.listIndex);
     return(true);
 }
Пример #9
0
        public bool CtlMove(Vector2 vPosition)
        {
            Vector2 v     = Vector2.Transform(vPosition, this.Matrix.Calculate);
            int     xBits = Convert.ToInt32(v.X * this.kFactor);
            int     yBits = Convert.ToInt32(v.Y * this.kFactor);

            RTC5Wrap.n_goto_xy(this.Index + 1, xBits, yBits);
            return(true);
        }
Пример #10
0
        public bool CtlGetStatus(RtcStatus status)
        {
            bool result = false;
            uint busy, position;

            busy = position = 0;
            switch (status)
            {
            case RtcStatus.Busy:
                RTC5Wrap.n_get_status(this.Index + 1, out busy, out position);
                result = Convert.ToBoolean(busy > 0);
                break;

            case RtcStatus.NotBusy:
                result = !this.CtlGetStatus(RtcStatus.Busy);
                break;

            case RtcStatus.List1Busy:
                uint l1Status = RTC5Wrap.n_read_status(this.Index + 1);
                result = Convert.ToBoolean(l1Status & 0x0F);
                break;

            case RtcStatus.List2Busy:
                uint l2Status = RTC5Wrap.n_read_status(this.Index + 1);
                result = Convert.ToBoolean(l2Status & 0x10);
                break;

            case RtcStatus.NoError:
                bool aborted   = this.CtlGetStatus(RtcStatus.Aborted);
                uint lastError = RTC5Wrap.n_get_last_error(this.Index + 1);
                bool error     = 0 != lastError;
                result = !aborted && !error;
                break;

            case RtcStatus.Aborted:
                result = this.aborted;
                break;

            case RtcStatus.PositionAckOK:
                uint posAckStatus = RTC5Wrap.n_get_head_status(this.Index + 1, 1);
                result = Convert.ToBoolean(posAckStatus & 0x0F + posAckStatus & 0x10);
                break;

            case RtcStatus.PowerOK:
                uint powStatus = RTC5Wrap.n_get_head_status(this.Index + 1, 1);
                result = Convert.ToBoolean(powStatus & 0x80);
                break;

            case RtcStatus.TempOK:
                uint tempStatus = RTC5Wrap.n_get_head_status(this.Index + 1, 1);
                result = Convert.ToBoolean(tempStatus & 0x40);
                break;
            }
            return(result);
        }
Пример #11
0
        /// <summary>
        /// jump跳刀
        /// </summary>
        /// <param name="Rtc_Datas"></param>
        /// <param name="List_No"></param>
        public static void Draw_Jump_Correct(List <Interpolation_Data> Rtc_Datas, UInt32 List_No)
        {
            //定义处理的变量
            Vector  Tmp_Point = new Vector();
            decimal Tmp_End_X = 0.0m;
            decimal Tmp_End_Y = 0.0m;

#if !DEBUG
            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(List_No, 0u) == 0);
            // Transmit the following list commands to the list buffer.
            RTC5Wrap.set_start_list(List_No);
#endif


            //生成数据
            foreach (var o in Rtc_Datas)
            {
                //Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Correct_Rtc_Axes(o.End_x, o.End_y));
                Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Correct_Rtc_Axes_Angle(o.End_x, o.End_y));
                Tmp_End_X = Tmp_Point.X;
                Tmp_End_Y = Tmp_Point.Y;
#if !DEBUG
                if (o.Type == 13)//jump_abs
                {
                    RTC5Wrap.jump_abs(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 14)//jump_rel
                {
                    RTC5Wrap.jump_rel(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference));
                }
#endif
            }
#if !DEBUG
            //结束Jump到启动点位
            //RTC5Wrap.jump_abs(0, 0);

            //设置List结束位置
            RTC5Wrap.set_end_of_list();

            //启动执行
            RTC5Wrap.execute_list(1u);

            //Busy 运行等待结束
            uint Busy;
            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
#endif
        }
Пример #12
0
        public bool CtlBusyWait()
        {
            uint busy, position;

            do
            {
                System.Threading.Thread.Sleep(1);
                RTC5Wrap.n_get_status(this.Index + 1, out busy, out position);
            }while (0 != busy);
            return(true);
        }
Пример #13
0
        public bool CtlReset()
        {
            uint lastError = RTC5Wrap.n_get_last_error(this.Index + 1);

            if (0 != lastError)
            {
                RTC5Wrap.n_reset_error(this.Index + 1, lastError);
            }

            this.aborted = false;
            return(true);
        }
Пример #14
0
        public bool CtlLoadCorrectionFile(CorrectionTableIndex tableIndex, string ctbFileName)
        {
            if (this.CtlGetStatus(RtcStatus.Busy))
            {
                return(false);
            }
            this.ctbFileName[(uint)tableIndex] = ctbFileName;
            uint error = RTC5Wrap.n_load_correction_file(this.Index + 1,
                                                         ctbFileName, Convert.ToUInt32(tableIndex), 2);

            return(true);
        }
Пример #15
0
 public bool ListLaserOff()
 {
     if (this.CtlGetStatus(RtcStatus.Aborted))
     {
         return(false);
     }
     if (!this.IsListReady(1))
     {
         return(false);
     }
     RTC5Wrap.n_laser_signal_off_list(this.Index + 1);
     return(true);
 }
Пример #16
0
        public bool CtlSpeed(double jump, double mark)
        {
            if (this.CtlGetStatus(RtcStatus.Busy))
            {
                return(false);
            }
            double jump_bitperms = jump / (double)1.0e3 * this.kFactor;
            double mark_bitperms = mark / (double)1.0e3 * this.kFactor;

            RTC5Wrap.n_set_jump_speed_ctrl(this.Index + 1, jump_bitperms);
            RTC5Wrap.n_set_mark_speed_ctrl(this.Index + 1, mark_bitperms);
            return(true);
        }
Пример #17
0
 public bool ListLaserOn(double msec)
 {
     if (this.CtlGetStatus(RtcStatus.Aborted))
     {
         return(false);
     }
     if (!this.IsListReady(1))
     {
         return(false);
     }
     RTC5Wrap.n_laser_on_list(this.Index + 1, (uint)(msec / 100.0));
     return(true);
 }
Пример #18
0
 public bool ListWait(double msec)
 {
     if (this.CtlGetStatus(RtcStatus.Aborted))
     {
         return(false);
     }
     if (msec * 1.0e3 >= 10)
     {
         if (!this.IsListReady(1))
         {
             return(false);
         }
         RTC5Wrap.n_long_delay(this.Index + 1, (uint)(msec * 100.0));
     }
     return(true);
 }
Пример #19
0
        /// <summary>
        /// jump跳刀
        /// </summary>
        /// <param name="Rtc_Datas"></param>
        /// <param name="List_No"></param>
        public static void Draw_Jump(List <Interpolation_Data> Rtc_Datas, UInt32 List_No)
        {
#if !DEBUG
            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(List_No, 0u) == 0);
            // Transmit the following list commands to the list buffer.
            RTC5Wrap.set_start_list(List_No);
#endif


            //生成数据
            foreach (var o in Rtc_Datas)
            {
#if !DEBUG
                if (o.Type == 13)//jump_abs
                {
                    RTC5Wrap.jump_abs(Convert.ToInt32(-o.End_y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 14)//jump_rel
                {
                    RTC5Wrap.jump_rel(Convert.ToInt32(-o.End_y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference));
                }
#endif
            }
#if !DEBUG
            //结束Jump到启动点位
            //RTC5Wrap.jump_abs(0, 0);

            //设置List结束位置
            RTC5Wrap.set_end_of_list();

            //启动执行
            RTC5Wrap.execute_list(1u);

            //Busy 运行等待结束
            uint Busy;
            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
#endif
        }
Пример #20
0
        public bool ListSpeed(double jump, double mark)
        {
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }
            double jump_bitperms = jump / (double)1.0e3 * this.kFactor;
            double mark_bitperms = mark / (double)1.0e3 * this.kFactor;

            if (!this.IsListReady(2))
            {
                return(false);
            }
            RTC5Wrap.n_set_jump_speed(this.Index + 1, jump_bitperms);
            RTC5Wrap.n_set_mark_speed(this.Index + 1, mark_bitperms);
            return(true);
        }
Пример #21
0
        public bool ListJump(Vector2 vPosition)
        {
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }
            Vector2 v     = Vector2.Transform(vPosition, this.Matrix.Calculate);
            int     xBits = (int)(v.X * this.kFactor);
            int     yBits = (int)(v.Y * this.kFactor);

            if (!this.IsListReady(1))
            {
                return(false);
            }

            RTC5Wrap.n_jump_abs(this.Index + 1, xBits, yBits);
            return(true);
        }
Пример #22
0
        public bool ListFrequency(double frequency, double pulseWidth)
        {
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }
            double period     = 1.0f / frequency * (double)1.0e6;
            double halfPeriod = period / 2.0f;

            if (!this.IsListReady(1))
            {
                return(false);
            }
            RTC5Wrap.n_set_laser_timing(this.Index + 1,
                                        (uint)(halfPeriod * 64.0),
                                        (uint)(pulseWidth * 64.0),
                                        0, 0);
            return(true);
        }
Пример #23
0
        public bool CtlFrequency(double frequency, double pulseWidth)
        {
            if (this.CtlGetStatus(RtcStatus.Busy))
            {
                return(false);
            }
            double period     = 1.0f / frequency * (double)1.0e6;
            double halfPeriod = period / 2.0f;

            RTC5Wrap.n_set_start_list(this.Index + 1, 1);
            RTC5Wrap.n_set_laser_timing(this.Index + 1,
                                        (uint)(halfPeriod * 64.0),
                                        (uint)(pulseWidth * 64.0),
                                        0,
                                        0);
            RTC5Wrap.n_set_end_of_list(this.Index + 1);
            RTC5Wrap.n_execute_list(this.Index + 1, 1);
            this.CtlBusyWait();
            return(true);
        }
Пример #24
0
 public bool CtlDelay(double laserOn, double laserOff, double scannerJump, double scannerMark, double scannerPolygon)
 {
     if (this.CtlGetStatus(RtcStatus.Busy))
     {
         return(false);
     }
     RTC5Wrap.n_set_start_list(this.Index + 1, 1);
     RTC5Wrap.n_set_scanner_delays(this.Index + 1,
                                   (uint)(scannerJump / 10.0),
                                   (uint)(scannerMark / 10.0),
                                   (uint)(scannerPolygon / 10.0)
                                   );
     RTC5Wrap.n_set_laser_delays(this.Index + 1,
                                 (int)(laserOn * 2.0),
                                 (uint)(laserOff * 2.0)
                                 );
     RTC5Wrap.n_set_end_of_list(this.Index + 1);
     RTC5Wrap.n_execute_list(this.Index + 1, 1);
     this.CtlBusyWait();
     return(true);
 }
Пример #25
0
 public bool ListDelay(double laserOn, double laserOff, double scannerJump, double scannerMark, double scannerPolygon)
 {
     if (this.CtlGetStatus(RtcStatus.Aborted))
     {
         return(false);
     }
     if (!this.IsListReady(2))
     {
         return(false);
     }
     RTC5Wrap.n_set_scanner_delays(this.Index + 1,
                                   (uint)(scannerJump / 10.0),
                                   (uint)(scannerMark / 10.0),
                                   (uint)(scannerPolygon / 10.0)
                                   );
     RTC5Wrap.n_set_laser_delays(this.Index + 1,
                                 (int)(laserOn * 2.0),
                                 (uint)(laserOff * 2.0)
                                 );
     return(true);
 }
Пример #26
0
        public bool ListArc(Vector2 center, double sweepAngle)
        {
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }

            Vector2 v    = Vector2.Transform(center, this.Matrix.Calculate);
            int     quot = (int)(Math.Abs(sweepAngle) / 360.0);
            double  rem  = sweepAngle - Math.Sign(sweepAngle) * 360.0f * quot;

            if (!this.IsListReady((uint)(quot + 1)))
            {
                return(false);
            }
            for (int i = 0; i < quot; i++)
            {
                RTC5Wrap.n_arc_abs(this.Index + 1, (int)(center.X * this.kFactor), (int)(center.Y * this.kFactor), Math.Sign(sweepAngle) * -360.0);
            }
            RTC5Wrap.n_arc_abs(this.Index + 1, (int)(center.X * this.kFactor), (int)(center.Y * this.kFactor), -rem);
            return(true);
        }
Пример #27
0
        /// <summary>
        /// 修改参数
        /// </summary>
        public static void Change_Para()
        {
            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(1u, 0u) == 0);
            // Timing, delay and speed preset.
            // Transmit the following list commands to the list buffer.
            RTC5Wrap.set_start_list(1u);
            // Wait for Para_List.Parameter.Warmup_Time seconds
            //RTC5Wrap.long_delay(Convert.ToUInt32(Para_List.Parameter.Warmup_Time / Para_List.Parameter.Scanner_Delay_Reference));
            RTC5Wrap.set_laser_pulses(
                Convert.ToUInt32(Para_List.Parameter.Laser_Half_Period * Para_List.Parameter.Rtc_Period_Reference),  // half of the laser signal period.
                Convert.ToUInt32(Para_List.Parameter.Laser_Pulse_Width * Para_List.Parameter.Rtc_Period_Reference)); // pulse widths of signal LASER1.
            RTC5Wrap.set_scanner_delays(
                Convert.ToUInt32(Para_List.Parameter.Jump_Delay / Para_List.Parameter.Scanner_Delay_Reference),      // jump delay, in 10 microseconds.
                Convert.ToUInt32(Para_List.Parameter.Mark_Delay / Para_List.Parameter.Scanner_Delay_Reference),      // mark delay, in 10 microseconds.
                Convert.ToUInt32(Para_List.Parameter.Polygon_Delay / Para_List.Parameter.Scanner_Delay_Reference));  // polygon delay, in 10 microseconds.
            RTC5Wrap.set_laser_delays(
                Convert.ToInt32(Para_List.Parameter.Laser_On_Delay * Para_List.Parameter.Laser_Delay_Reference),     // laser on delay, in microseconds.
                Convert.ToUInt32(Para_List.Parameter.Laser_Off_Delay * Para_List.Parameter.Laser_Delay_Reference));  // laser off delay, in microseconds.
            // jump speed in bits per milliseconds.
            RTC5Wrap.set_jump_speed(Para_List.Parameter.Jump_Speed);
            // marking speed in bits per milliseconds.
            RTC5Wrap.set_mark_speed(Para_List.Parameter.Mark_Speed);
            RTC5Wrap.set_end_of_list();
            RTC5Wrap.execute_list(1u);

            //Pump source warming up ,wait!!!
            uint Busy;

            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
        }
Пример #28
0
        public bool ListExecute(bool busyWait = true)
        {
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }
            uint busy, position;

            busy = position = 0;
            RTC5Wrap.n_get_status(this.Index + 1, out busy, out position);
            if (busy > 0)
            {
                RTC5Wrap.n_auto_change(this.Index + 1);
            }
            if (busyWait)
            {
                this.CtlBusyWait();
            }
            if (this.CtlGetStatus(RtcStatus.Aborted))
            {
                return(false);
            }
            return(true);
        }
Пример #29
0
        /// <summary>
        /// 执行 数据采样矫正后的数据 矩阵补偿
        /// </summary>
        /// <param name="Rtc_Datas"></param>
        /// <param name="List_No"></param>
        public static void Draw_Matrix_Correct(List <Interpolation_Data> Rtc_Datas, UInt32 List_No)
        {
            //定义处理的变量
            Vector  Tmp_Point    = new Vector();
            decimal Tmp_R0_X     = 0.0m;
            decimal Tmp_R0_Y     = 0.0m;
            decimal Tmp_End_X    = 0.0m;
            decimal Tmp_End_Y    = 0.0m;
            decimal Tmp_Center_X = 0.0m;
            decimal Tmp_Center_Y = 0.0m;

#if !DEBUG
            //  wait list List_No to be not busy
            //  load_list( List_No, 0) returns 1 if successful, otherwise 0
            //执行到POS 0
            do
            {
            }while (RTC5Wrap.load_list(List_No, 0u) == 0);
            // Transmit the following list commands to the list buffer.
            RTC5Wrap.set_start_list(List_No);
#endif
            if (Para_List.Parameter.Rtc_Affinity_Type == 2)
            {
                Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Get_Line_Fit_Coordinate(Rtc_Datas[0].Rtc_x, Rtc_Datas[0].Rtc_y, Fit_Matrices));
                Tmp_R0_X  = Tmp_Point.X;
                Tmp_R0_Y  = Tmp_Point.Y;
            }
            else
            {
                //获取数据落点
                Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Get_Affinity_Point(0, Rtc_Datas[0].Rtc_x, Rtc_Datas[0].Rtc_y, affinity_Matrices));
                Tmp_R0_X  = Tmp_Point.X;
                Tmp_R0_Y  = Tmp_Point.Y;
            }

#if !DEBUG
            //初始Jump到启动点位
            RTC5Wrap.jump_abs(Convert.ToInt32(-Tmp_R0_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_R0_X * Para_List.Parameter.Rtc_Pos_Reference));
#endif
            //生成数据
            foreach (var o in Rtc_Datas)
            {
                if (Para_List.Parameter.Rtc_Affinity_Type == 2)
                {
                    Tmp_Point    = new Vector(Rtc_Cal_Data_Resolve.Get_Line_Fit_Coordinate(o.End_x, o.End_y, Fit_Matrices));
                    Tmp_End_X    = Tmp_Point.X;
                    Tmp_End_Y    = Tmp_Point.Y;
                    Tmp_Point    = new Vector(Rtc_Cal_Data_Resolve.Get_Line_Fit_Coordinate(o.Center_x, o.Center_y, Fit_Matrices));
                    Tmp_Center_X = Tmp_Point.X;
                    Tmp_Center_Y = Tmp_Point.Y;
                }
                else
                {
                    Tmp_Point    = new Vector(Rtc_Cal_Data_Resolve.Get_Affinity_Point(0, o.End_x, o.End_y, affinity_Matrices));
                    Tmp_End_X    = Tmp_Point.X;
                    Tmp_End_Y    = Tmp_Point.Y;
                    Tmp_Point    = new Vector(Rtc_Cal_Data_Resolve.Get_Affinity_Point(0, o.Center_x, o.Center_y, affinity_Matrices));
                    Tmp_Center_X = Tmp_Point.X;
                    Tmp_Center_Y = Tmp_Point.Y;
                }
#if !DEBUG
                if (o.Type == 11)//arc_abs 绝对圆弧
                {
                    RTC5Wrap.arc_abs(Convert.ToInt32(-Tmp_Center_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_Center_X * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle));
                }
                else if (o.Type == 12)//arc_rel
                {
                    RTC5Wrap.arc_rel(Convert.ToInt32(-Tmp_Center_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_Center_X * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle));
                }
                else if (o.Type == 13)//jump_abs
                {
                    RTC5Wrap.jump_abs(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 14)//jump_rel
                {
                    RTC5Wrap.jump_rel(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 15)//mark_abs
                {
                    RTC5Wrap.mark_abs(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference));
                }
                else if (o.Type == 16)//mark_rel
                {
                    RTC5Wrap.mark_rel(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference));
                }
#endif
            }
#if !DEBUG
            //结束Jump到启动点位
            //RTC5Wrap.jump_abs(0, 0);

            //设置List结束位置
            RTC5Wrap.set_end_of_list();

            //启动执行
            RTC5Wrap.execute_list(1u);

            //Busy 运行等待结束
            uint Busy;
            do
            {
                RTC5Wrap.get_status(out Busy, out uint Position);
            } while (Busy != 0U);
#endif
        }
Пример #30
0
 /// <summary>
 /// 振镜加工终止
 /// </summary>
 public static void Draw_Stop()
 {
     //终止运行
     RTC5Wrap.stop_execution();
 }