123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.SCCore;
- using MECF.Framework.Common.Communications;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.RT.ModuleLibrary.Commons;
- using SecsGem.Core;
- using SecsGemSerial.Application;
- using SecsGemSerial.Core;
- using SecsGemSerial.Core.EnumData;
- using SecsGemSerial.Core.Model;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.IO.Ports;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Venus_RT.Devices.SMIF
- {
-
-
-
-
-
- public class FortrendPLUS500 : ISMIF
- {
- public enum StreamType
- {
- SMIFState = 1,
- SMIFControl = 2,
- LP = 3,
- TAG = 4,
- ALARM = 5,
- DVDATA = 6,
- COMMANDERROR = 9,
- RFIDCOMMAND = 18,
- SMARTTAG8400COMMAND = 100,
- }
-
- private string _portname;
-
- public bool IsConnected;
-
- public bool IsOnline;
-
- public bool IsLoaded;
-
- public bool IsLocked;
-
- public bool IsError;
- private SecsGemSerialApplication _serial = null;
- private ModuleName _smifbelong;
-
-
-
-
- public FortrendPLUS500(ModuleName VCEName)
- {
- _smifbelong = VCEName;
- _portname = SC.GetStringValue($"{VCEName}.SMIF.Port");
- SerialOptions serialOptions = new SerialOptions()
- {
- Port = _portname ?? "COM81",
- BaudRate = 9600,
- DataBits = 8,
- Parity = Parity.None,
- StopBits = StopBits.One,
- };
- SecsGemSerialOptions secsGemSerialOptions = new SecsGemSerialOptions()
- {
- DeviceId = 0
- };
-
- _serial = new SecsGemSerialApplication(VCEName.ToString(), serialOptions, secsGemSerialOptions);
- _serial.OnAlarm += _serial_OnAlarm;
- }
- private void _serial_OnAlarm(string alarm)
- {
-
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"SMIF({_smifbelong}) received Alarm:{alarm}");
- }
- public void Initialize()
- {
- _serial.Initialize();
- _serial.RemoteControl(out string reason);
- }
- private void OnSMIFDataChanged(string oneLineMessage)
- {
- }
- public void Query()
- {
- SmifData smifdata = _serial.QueryAllSvids(out string reason);
- List<EnumSlot> mapdata = smifdata?.WaferMap;
- int? wafercount = smifdata?.WaferCount;
- E84Signals SmifIO = smifdata?.E84Signals;
- }
- public void Home()
- {
- if (!_serial.RemoteCommand(EnumRemoteCmd.HomeSmif, out string reason))
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Home Command Failed for {reason}!Please Check SMIF({_smifbelong})");
- else
- LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send Home Command to SMIF({_smifbelong})");
- }
- public void Load()
- {
- if (!_serial.RemoteCommand(EnumRemoteCmd.StartLoadOpenCycle, out string reason))
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Load Command Failed for {reason}!Please Check SMIF({_smifbelong})");
- else
- LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send Load Command to SMIF({_smifbelong})");
- }
- public void Unload()
- {
- if (!_serial.RemoteCommand(EnumRemoteCmd.StartUnloadCloseCycle, out string reason))
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Unload Command Failed for {reason}!Please Check SMIF({_smifbelong})");
- else
- LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send UnLoad Command to SMIF({_smifbelong})");
- }
- public void Lock()
- {
- if (!_serial.RemoteCommand(EnumRemoteCmd.KeepPrtLocked, out string reason))
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Lock Command Failed for {reason}!Please Check SMIF({_smifbelong})");
- else
- LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send Lock Command to SMIF({_smifbelong})");
- }
- public void Unlock()
- {
- if (!_serial.RemoteCommand(EnumRemoteCmd.UnlockPort, out string reason))
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Unlock Command Failed for {reason}!Please Check SMIF({_smifbelong})");
- else
- LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send UnLock Command to SMIF({_smifbelong})");
- }
- public void Reset()
- {
- if (!_serial.RemoteCommand(EnumRemoteCmd.HomeSmif, out string reason))
- LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Unlock Command Failed for {reason}!Please Check SMIF({_smifbelong})");
- else
- LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send UnLock Command to SMIF({_smifbelong})");
- }
-
-
-
- public void Abort()
- {
- }
- }
- }
|