Beispiel #1
0
        public bool GetAlarmInfo(MvRobotAlarm alminfo, bool isNeedRefresh = true)
        {
            lock (this)
            {
                if (isNeedRefresh)
                {
                    mobjDataTable.Refresh();
                }

                return(mobjAlarm.GetValue(1,
                                          ref alminfo.AlarmID,
                                          ref alminfo.AlarmNumber,
                                          ref alminfo.CauseAlarmID,
                                          ref alminfo.CauseAlarmNumber,
                                          ref alminfo.Severity,
                                          ref alminfo.Year,
                                          ref alminfo.Month,
                                          ref alminfo.Day,
                                          ref alminfo.Hour,
                                          ref alminfo.Minute,
                                          ref alminfo.Second,
                                          ref alminfo.AlarmMessage,
                                          ref alminfo.CauseAlarmMessage,
                                          ref alminfo.SeverityMessage
                                          ));
            }
        }
Beispiel #2
0
        public MvRobotAlarm ReadRobotAlarmInfo()
        {
            MvRobotAlarm alminfo = new MvRobotAlarm();

            if (!this.GetAlarmInfo(alminfo))
            {
                throw new MvException("Fail to read alarm info");
            }
            return(alminfo);
        }
Beispiel #3
0
        public MvFanucRobotInfo GetCurrRobotInfo()
        {
            var msg       = "";
            var alarmInfo = new MvRobotAlarm();

            HasRobotFault(ref msg, ref alarmInfo);

            var robotInfo = new MvFanucRobotInfo();

            robotInfo.PosReg        = this.ReadCurPosUf();
            robotInfo.RobotTime     = DateTime.Now;
            robotInfo.IsReachTarget = this.MoveIsComplete();

            return(robotInfo);
        }
Beispiel #4
0
        /// <summary>
        /// must 用thread
        /// </summary>
        /// <param name="Target"></param>
        /// <param name="_SelectCorJ"></param>
        /// <param name="_SelectOfstOrPos"></param>
        /// <param name="_IsMoveUT"></param>
        /// <param name="Speed"></param>
        /// <returns></returns>
        public bool Pns0101MoveStraightSync(Array Target, int _SelectCorJ, int _SelectOfstOrPos, int _IsMoveUT, int Speed)
        {
            Pns0101MoveStraightAsync(Target, _SelectCorJ, _SelectOfstOrPos, _IsMoveUT, Speed);

            while (this.MoveIsComplete())
            {
                GetCurrRobotInfo();

                var msg       = "";
                var alarmInfo = new MvRobotAlarm();
                if (HasRobotFault(ref msg, ref alarmInfo))
                {
                    break;
                }

                Thread.Sleep(100);
            }

            this.MoveCompeleteReply();

            return(true);
        }
Beispiel #5
0
        public bool HasRobotFault(ref string message, ref MvRobotAlarm alarmInfo)
        {
            //************IMPORTANT*************************************************//
            //UO[1~20] address has been mapping to DI[1~20] address at addr.22
            //AND using BGLogic assign DI[1]~DI[20] to R[21]~R[40] respectivly
            //If you wanna read UO[1], plz read R[21] and so on
            //**********************************************************************

            object UO6Value      = (byte)0;
            bool   IsReadSuccess = false;



            //1:有err   0:normal
            IsReadSuccess = this.GetRegValue(26, ref UO6Value);
            if (!IsReadSuccess)
            {
                throw new Exception("Read Fail");
            }
            if ((int)UO6Value == 1)
            {
                alarmInfo           = ReadRobotAlarmInfo();
                message             = "Robot Err Occur !";
                HasRobotFaultStatus = true;
                //if (RobotFaultStatus != almInfo.Result) { this.Equipment.IO_Switch("LaserIO", DeviceSwitch.OFF); }
            }
            else
            {
                message             = "Success";
                HasRobotFaultStatus = false;

                //if (RobotFaultStatus != almInfo.Result) { this.Equipment.IO_Switch("LaserIO", DeviceSwitch.ON); }
            }

            return(HasRobotFaultStatus);
        }