123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using Aitex.Common.Util;
- using Aitex.Core.Common;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Device.Unit;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Communications;
- using MECF.Framework.Common.DBCore;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading;
- using System.Threading.Tasks;
- namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.OcrReaders.Cognex
- {
- public class CognexWaferIDReaderWithCylinder:CognexWaferIDReader
- {
- public CognexWaferIDReaderWithCylinder(string module,string name,string scRoot,IoSensor[] dis,IoTrigger[] dos ):base(module,name, scRoot)
- {
- _diCylinderExtend = dis[1];
- _diCylinderRetract = dis[2];
- _doCylinderExtend = dos[0];
- _doCylinderRetract = dos[1];
- }
- private IoSensor _diCylinderExtend;
- private IoSensor _diCylinderRetract;
- private IoTrigger _doCylinderExtend;
- private IoTrigger _doCylinderRetract;
- protected override bool fStartReadWaferID(object[] param)
- {
- _doCylinderExtend.SetTrigger(true, out _);
- _doCylinderRetract.SetTrigger(false, out _);
- int wCount = 0;
- while (true)
- {
- if (_diCylinderExtend.Value && !_diCylinderRetract.Value)
- {
- break;
- }
- Thread.Sleep(100);
- wCount++;
- if (wCount > 100)
- {
- OnError("MoveCylinderTimeout");
- return false;
- }
- }
- return base.fStartReadWaferID(param);
- }
- protected override bool fMonitorReading(object[] param)
- {
- if(base.fMonitorReading(param))
- {
- _doCylinderExtend.SetTrigger(false, out _);
- _doCylinderRetract.SetTrigger(true, out _);
- return true;
- }
- return false;
- }
- }
- }
|