MainMachine _IOMonitor.cs 2.3 KB
using OnlineStore;
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DeviceLibrary
{
    partial class MainMachine
    {
        void IOMonitor()
        {
            if (RightMoveInfo.IsStep(MoveStep.Wait)
                && IOValue(IO_Type.RightFornt_Check).Equals(IO_VALUE.HIGH)
                && IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW))
            {
                RightMoveInfo.NewMove(MoveStep.R40_InShelf);
                LogUtil.info("IOMonitor:右侧检测到入料信号");
            }
            if (RightMoveInfo.IsStep(MoveStep.Wait)
                && IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)
                && !RightShelfNoTray)
            {
                RightMoveInfo.NewMove(MoveStep.R01);
                LogUtil.info("IOMonitor:右侧有新料,准备上料");
            }


            if (LeftMoveInfo.IsStep(MoveStep.Wait)
                && IOValue(IO_Type.LeftFornt_Check).Equals(IO_VALUE.HIGH)
                && IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW))
            {
                LeftMoveInfo.NewMove(MoveStep.L60_InShelf);
                LogUtil.info("IOMonitor:左侧检测到入料信号");
            }
            if (LeftMoveInfo.IsStep(MoveStep.Wait)
                && IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH)
                 && !LeftShelfNoTray)
            {
                LeftMoveInfo.NewMove(MoveStep.L01);
                LogUtil.info("IOMonitor:左侧有新料,准备上料");
            }

            //右侧料串已空
            if (RightMoveInfo.IsStep(MoveStep.Wait) && IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH) && RightShelfNoTray)
            {
                Msg.add(crc.GetString("Res0093","右侧料串已空,等待取走料串"), MsgLevel.warning);
            }
            //左侧料串已满
            if (LeftMoveInfo.IsStep(MoveStep.Wait) && IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH) && LeftShelfNoTray)
            {
                Msg.add(crc.GetString("Res0094","左侧料串已满,等待取走料串"), MsgLevel.warning);
            }
        }
    }
}