From 016183bc4926c4fd80599dc7e06542c5396e6fd8 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 12 四月 2025 16:24:25 +0800
Subject: [PATCH] 1.读取机器的Job Event上报; 2.修复在读取CC-Link数据当单元号超出32767时读取失败的问题。

---
 SourceCode/Bond/Servo/CPageGraph2.cpp                         |    9 
 SourceCode/Bond/Servo/CReadStep.cpp                           |    6 
 SourceCode/Bond/Servo/Servo.vcxproj                           |    2 
 .gitignore                                                    |    2 
 SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h   |    4 
 SourceCode/Bond/Servo/CWriteStep.cpp                          |    6 
 SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.cpp |    8 
 SourceCode/Bond/Servo/CJobDataB.cpp                           |  115 ++++++++++++++++++
 SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp   |    4 
 SourceCode/Bond/Servo/Servo.vcxproj.filters                   |    2 
 SourceCode/Bond/Servo/CEqJobEventStep.cpp                     |   86 ++++++++++++++
 Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.2.xlsx  |    0 
 SourceCode/Bond/Servo/CJobDataB.h                             |    9 +
 SourceCode/Bond/Servo/ToolUnits.cpp                           |   13 ++
 SourceCode/Bond/Servo/CEquipment.cpp                          |    7 +
 SourceCode/Bond/Servo/CEqJobEventStep.h                       |   26 ++++
 SourceCode/Bond/Servo/CMaster.cpp                             |   42 ++++++
 SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h     |    2 
 SourceCode/Bond/Servo/CEquipment.h                            |    1 
 SourceCode/Bond/Servo/ToolUnits.h                             |    1 
 SourceCode/Bond/Servo/Common.h                                |    4 
 21 files changed, 323 insertions(+), 26 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8681c35..f1a3d18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,3 +50,5 @@
 SourceCode/Bond/x64/Debug/ServoConfiguration.ini
 *.iobj
 SourceCode/Bond/x64/Debug/Backups/
+Document/鍏变韩鏂囦欢澶�/
+Document/鍏变韩鏂囦欢澶�.rar
diff --git a/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.2.xlsx b/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.2.xlsx
new file mode 100644
index 0000000..fe5bd01
--- /dev/null
+++ b/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.2.xlsx
Binary files differ
diff --git a/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp b/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp
index baad0d5..8315cc3 100644
--- a/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp
+++ b/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp
@@ -80,7 +80,7 @@
     return 0; // 校验通过
 }
 
-int CCCLinkIEControl::ReadData2(const StationIdentifier& station, DeviceType enDevType, short devNo, short size, void* pData)
+int CCCLinkIEControl::ReadData2(const StationIdentifier& station, DeviceType enDevType, long devNo, long size, void* pData)
 {
     // 验证站点参数和数据有效性
     int nRet = ValidateStationAndSize(station, size);
@@ -93,7 +93,7 @@
     {
         std::lock_guard<std::mutex> lock(m_mtx);
         const short nDevType = CalculateDeviceType(station, enDevType);
-        nRet = mdReceive(m_nPath, CombineStation(station), nDevType, devNo, &size, pData);
+        nRet = mdReceiveEx(m_nPath, station.nNetNo, station.nStNo, nDevType, devNo, &size, pData);
     }
 
     if (nRet != 0) {
diff --git a/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h b/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h
index 5d92f9e..60f4e7d 100644
--- a/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h
+++ b/SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h
@@ -59,7 +59,7 @@
     // 读取LED状态
     int ReadLedStatus(LedStatus& outLedStatus);
 
-    int ReadData2(const StationIdentifier& station, DeviceType enDevType, short devNo, short size, void* pData);
+    int ReadData2(const StationIdentifier& station, DeviceType enDevType, long devNo, long size, void* pData);
 
 private:
     static CCLinkIEControlMode ConvertToCCLinkIEControlMode(short nMode);
diff --git a/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.cpp b/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.cpp
index 141634c..7bc469d 100644
--- a/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.cpp
+++ b/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.cpp
@@ -442,7 +442,7 @@
 }
 
 // 通用读数据
-int CPerformanceMelsec::ReadData(const StationIdentifier& station, const short nDevType, const short nDevNo, short nSize, std::vector<short>& vecData) {
+int CPerformanceMelsec::ReadData(const StationIdentifier& station, const long nDevType, const long nDevNo, long nSize, std::vector<short>& vecData) {
     // 验证站点参数和数据有效性
     int nRet = ValidateStationAndSize(station, nSize);
     if (nRet != 0) {
@@ -459,7 +459,7 @@
         std::lock_guard<std::mutex> lock(m_mtx);
         short* pData = vecData.data();
         nSize *= sizeof(short);
-        nRet = mdReceive(m_nPath, CombineStation(station), nDevType, nDevNo, &nSize, pData);
+        nRet = mdReceiveEx(m_nPath, station.nNetNo, station.nStNo, nDevType, (long)(unsigned short)nDevNo, &nSize, pData);
     }
 
     if (nRet != 0) {
@@ -559,7 +559,7 @@
 }
 
 // 通用写数据
-int CPerformanceMelsec::WriteData(const StationIdentifier& station, const short nDevType, const short nDevNo, short nSize, short* pData) {
+int CPerformanceMelsec::WriteData(const StationIdentifier& station, const long nDevType, const long nDevNo, long nSize, short* pData) {
     // 验证站点参数
     int nRet = ValidateStation(station);
     if (nRet != 0) {
@@ -577,7 +577,7 @@
     {
         std::lock_guard<std::mutex> lock(m_mtx);
         nSize *= sizeof(short);
-        nRet = mdSend(m_nPath, CombineStation(station), nDevType, nDevNo, &nSize, pData);
+        nRet = mdSendEx(m_nPath, station.nNetNo, station.nStNo, nDevType, nDevNo, &nSize, pData);
     }
 
     if (nRet != 0) {
diff --git a/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h b/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
index a6020c4..84b7a9d 100644
--- a/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
+++ b/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
@@ -377,11 +377,11 @@
 	int GetBoardStatus(BoardStatus& status);
 
 	// 读写数据
-	int ReadData(const StationIdentifier& station, short nDevType, short nDevNo, short nSize, std::vector<short>& vecData);
+	int ReadData(const StationIdentifier& station, long nDevType, long nDevNo, long nSize, std::vector<short>& vecData);
 	int ReadBitData(const StationIdentifier& station, DeviceType enDevType, short nDevNo, short nBitCount, BitContainer& vecData);
 	int ReadWordData(const StationIdentifier& station, DeviceType enDevType, short nDevNo, short nWordCount, WordContainer& vecData);
 	int ReadDWordData(const StationIdentifier& station, DeviceType enDevType, short nDevNo, short nDWordCount, DWordContainer& vecData);
-	int WriteData(const StationIdentifier& station, short nDevType, short nDevNo, short nSize, short* pData);
+	int WriteData(const StationIdentifier& station, long nDevType, long nDevNo, long nSize, short* pData);
 	int WriteBitData(const StationIdentifier& station, DeviceType enDevType, short nDevNo, const BitContainer& vecData);
 	int WriteWordData(const StationIdentifier& station, DeviceType enDevType, short nDevNo, const WordContainer& vecData);
 	int WriteDWordData(const StationIdentifier& station, DeviceType enDevType, short nDevNo, const DWordContainer& vecData);
diff --git a/SourceCode/Bond/Servo/CEqJobEventStep.cpp b/SourceCode/Bond/Servo/CEqJobEventStep.cpp
new file mode 100644
index 0000000..43bff4d
--- /dev/null
+++ b/SourceCode/Bond/Servo/CEqJobEventStep.cpp
@@ -0,0 +1,86 @@
+#include "stdafx.h"
+#include "CEqJobEventStep.h"
+#include "Log.h"
+
+
+namespace SERVO {
+	CEqJobEventStep::CEqJobEventStep() : CReadStep()
+	{
+		m_nJobDataBDev = 0;
+	}
+
+	CEqJobEventStep::~CEqJobEventStep()
+	{
+
+	}
+
+	void CEqJobEventStep::setJobDataDev(int nDev)
+	{
+		m_nJobDataBDev = nDev;
+	}
+
+	void CEqJobEventStep::getAttributeVector(CAttributeVector& attrubutes)
+	{
+		CReadStep::getAttributeVector(attrubutes);
+
+		std::string strTemp;
+		attrubutes.addAttribute(new CAttribute("Dev",
+			("W" + CToolUnits::toHexString(m_nJobDataBDev, strTemp)).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("PortNo",
+			std::to_string(m_jobDataB.getPortNo()).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("CarrierId",
+			m_jobDataB.getCarrierId().c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("PruductId",
+			m_jobDataB.getPruductId().c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("CarrierState",
+			m_jobDataB.getCarrierStateDescription(strTemp).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("SlotMapping",
+			std::to_string(m_jobDataB.getSlotMapping()).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("SlotSelectedFlag",
+			std::to_string(m_jobDataB.getSlotSelectedFlag()).c_str(), ""));
+		std::vector<std::string>& ids = m_jobDataB.getGlassIds();
+		for (int i = 0; i < ids.size(); i++) {
+			attrubutes.addAttribute(new CAttribute((std::string("GlassId") + std::to_string(i+1)).c_str(),
+				ids[i].c_str(), ""));
+		}
+	}
+
+	int CEqJobEventStep::onReadData()
+	{
+		CReadStep::onReadData();
+
+
+		char szBuffer[1024];
+		int nRet = m_pCclink->ReadData2(m_station, DeviceType::W, m_nJobDataBDev,
+			640, szBuffer);
+		if (0 != nRet) {
+			return -1;
+		}
+
+		m_jobDataB.unserialize(szBuffer, 640);
+		LOGI("<CEqJobEventStep-%s>Read JobDataB\n", m_strName.c_str());
+
+		return 0;
+	}
+
+	int CEqJobEventStep::onComplete()
+	{
+		CReadStep::onComplete();
+		LOGI("<CEqJobEventStep> onComplete.");
+
+		return 0;
+	}
+
+	int CEqJobEventStep::onTimeout()
+	{
+		CReadStep::onTimeout();
+		LOGI("<CEqJobEventStep> onTimeout.");
+
+		return 0;
+	}
+
+	CJobDataB* CEqJobEventStep::getJobDataB()
+	{
+		return &m_jobDataB;
+	}
+}
diff --git a/SourceCode/Bond/Servo/CEqJobEventStep.h b/SourceCode/Bond/Servo/CEqJobEventStep.h
new file mode 100644
index 0000000..f2b1c70
--- /dev/null
+++ b/SourceCode/Bond/Servo/CEqJobEventStep.h
@@ -0,0 +1,26 @@
+#pragma once
+#include "CReadStep.h"
+#include "CJobDataB.h"
+
+
+namespace SERVO {
+	class CEqJobEventStep : public CReadStep
+	{
+	public:
+		CEqJobEventStep();
+		~CEqJobEventStep();
+
+	public:
+		virtual void getAttributeVector(CAttributeVector& attrubutes);
+		virtual int onReadData();
+		virtual int onComplete();
+		virtual int onTimeout();
+		void setJobDataDev(int nDev);
+		CJobDataB* getJobDataB();
+
+	private:
+		int m_nJobDataBDev;
+		CJobDataB m_jobDataB;
+	};
+}
+
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 595b2ee..4d23681 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -370,7 +370,6 @@
 
 
 		// 以下根据信号做流程处理
-		CStep* pStep;
 
 		// Equipment Mode Change Report(0x360)
 		// Equipment Status Change Report(0x361)
@@ -396,6 +395,12 @@
 		// EQ Mode
 		CHECK_WRITE_STEP_SIGNAL(0x355, pszData, size);
 
+		// EQ Job Event
+		CHECK_READ_STEP_SIGNAL(0x380, pszData, size);
+		CHECK_READ_STEP_SIGNAL(0x381, pszData, size);
+		CHECK_READ_STEP_SIGNAL(0x386, pszData, size);
+		CHECK_READ_STEP_SIGNAL(0x387, pszData, size);
+
 		// Port1 ~ Port4
 		CHECK_READ_STEP_SIGNAL(0x3e0, pszData, size);
 		CHECK_READ_STEP_SIGNAL(0x3e1, pszData, size);
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index fec3754..82e21ca 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -17,6 +17,7 @@
 #include "CEqReadIntStep.h"
 #include "CEqCassetteTransferStateStep.h"
 #include "CEqCassetteCtrlCmdStep.h"
+#include "CEqJobEventStep.h"
 #include <vector>
 #include <map>
 #include <list>
diff --git a/SourceCode/Bond/Servo/CJobDataB.cpp b/SourceCode/Bond/Servo/CJobDataB.cpp
index efa4896..8373485 100644
--- a/SourceCode/Bond/Servo/CJobDataB.cpp
+++ b/SourceCode/Bond/Servo/CJobDataB.cpp
@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "CJobDataB.h"
+#include "ToolUnits.h"
 
 
 namespace SERVO {
@@ -13,19 +14,36 @@
 
 	}
 
+	short CJobDataB::getPortNo()
+	{
+		return m_nPortNo;
+	}
+
+	std::string& CJobDataB::getCarrierId()
+	{
+		return m_strCarrierId;
+	}
+
+	std::string& CJobDataB::getPruductId()
+	{
+		return m_pruductId;
+	}
+
 	int CJobDataB::serialize(char* pszBuffer, int nBufferSize)
 	{
+		if (nBufferSize < 640) return -1;
+
 		int index = 0;
 		memcpy(&pszBuffer[index], &m_nPortNo, sizeof(short));
 		index += sizeof(short);
 
 		int strLen = min(20, m_strCarrierId.size());
 		memcpy(&pszBuffer[index], m_strCarrierId.c_str(), strLen);
-		index += strLen;
+		index += 20;
 
 		strLen = min(20, m_pruductId.size());
 		memcpy(&pszBuffer[index], m_pruductId.c_str(), strLen);
-		index += strLen;
+		index += 20;
 
 		memcpy(&pszBuffer[index], &m_nCarrierState, sizeof(short));
 		index += sizeof(short);
@@ -40,9 +58,100 @@
 			std::string& strGlassId = m_glassIds.at(i);
 			strLen = min(20, strGlassId.size());
 			memcpy(&pszBuffer[index], strGlassId.c_str(), strLen);
-			index += strLen;
+			index += 20;
 		}
 
 		return 320 * 2;
 	}
+
+	int CJobDataB::unserialize(char* pszBuffer, int nBufferSize)
+	{
+		if (nBufferSize < 640) return -1;
+
+		int index = 0;
+		memcpy(&m_nPortNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		CToolUnits::convertString(&pszBuffer[index], 20, m_strCarrierId);
+		index += 20;
+
+		CToolUnits::convertString(&pszBuffer[index], 20, m_pruductId);
+		index += 20;
+
+		memcpy(&m_nCarrierState, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nSlotMapping, &pszBuffer[index], sizeof(int));
+		index += sizeof(int);
+
+		memcpy(&m_nSlotSelectedFlag, &pszBuffer[index], sizeof(int));
+		index += sizeof(int);
+
+		std::string strGlassId;
+		m_glassIds.clear();
+		for (int i = 0; i < 25; i++) {
+			CToolUnits::convertString(&pszBuffer[index], 20, strGlassId);
+			index += 20;
+			if (!strGlassId.empty()) {
+				m_glassIds.push_back(strGlassId);
+			}
+		}
+
+		return 320 * 2;
+	}
+
+	short CJobDataB::getCarrierState()
+	{
+		return m_nCarrierState;
+	}
+
+	std::string& CJobDataB::getCarrierStateDescription(std::string& strDescription)
+	{
+		static char* pszDescription[20] = {
+			"Bind",
+			"CancelPod",
+			"CancelPodNotification",
+			"CancelPodOut",
+			"CancelPodAtPort",
+			"CancelBind", 
+			"Clamp",
+			"ClosePod",
+			"IndexDown",
+			"IndexUp",
+			"OpenPod",
+			"PodComplete",
+			"PodIn",
+			"PodNotification",
+			"PodOut",
+			"PodRelease",
+			"PodTagReadData",
+			"PodTagWriteData",
+			"Proceed WithPod",
+			"Unclamp"
+		};
+
+		if (0 <= m_nCarrierState && m_nCarrierState < 20) {
+			strDescription = pszDescription[m_nCarrierState];
+		}
+		else {
+			strDescription = "";
+		}
+
+		return strDescription;
+	}
+
+	int CJobDataB::getSlotMapping()
+	{
+		return m_nSlotMapping;
+	}
+
+	int CJobDataB::getSlotSelectedFlag()
+	{
+		return m_nSlotSelectedFlag;
+	}
+
+	std::vector<std::string>& CJobDataB::getGlassIds()
+	{
+		return m_glassIds;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CJobDataB.h b/SourceCode/Bond/Servo/CJobDataB.h
index 3644ad9..632285b 100644
--- a/SourceCode/Bond/Servo/CJobDataB.h
+++ b/SourceCode/Bond/Servo/CJobDataB.h
@@ -11,7 +11,16 @@
 		~CJobDataB();
 
 	public:
+		short getPortNo();
+		std::string& getCarrierId();
+		std::string& getPruductId();
+		short getCarrierState();
+		std::string& getCarrierStateDescription(std::string& strDescription);
+		int getSlotMapping();
+		int getSlotSelectedFlag();
+		std::vector<std::string>& getGlassIds();
 		int serialize(char* pszBuffer, int nBufferSize);
+		int unserialize(char* pszBuffer, int nBufferSize);
 
 	private:
 		short m_nPortNo;
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 0e3a765..fda6aeb 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -156,7 +156,8 @@
 			}
 
 			for (auto item : m_listEquipment) {
-				if (item->getID() == EQ_ID_Bonder1) {
+				if (item->getID() == EQ_ID_Bonder1 ||
+					item->getID() == EQ_ID_Bonder2) {
 					const StationIdentifier& station = item->getStation();
 					MemoryBlock& block = item->getReadBitBlock();
 
@@ -726,7 +727,6 @@
 		pEquipment->setID(EQ_ID_Bonder1 + index);
 		pEquipment->setName(index == 0 ? "Bonder 1" : "Bonder 2");
 		pEquipment->setDescription(index == 0 ? "Bonder 1." : "Bonder 2.");
-		// pEquipment->setStation(1, index == 0 ? 3 : 4);
 		pEquipment->setStation(0, 255);
 		pEquipment->setReadBitBlock(index == 0 ? 0x4600 : 0x4c00,
 			index == 0 ? 0x4c00 : 0x5200);
@@ -738,7 +738,7 @@
 			CEqModeStep* pStep = new CEqModeStep();
 			pStep->setName(STEP_MODE);
 			pStep->setWriteSignalDev(index == 0 ? 0x330 : 0x630);
-			pStep->setModeDev(index == 0 ? 0x6a8c : 0x848c);
+			pStep->setModeDev(index == 0 ? 0x6a8c : 0x8a8c);
 			if (pEquipment->addStep(0x360, pStep) != 0) {
 				delete pStep;
 			}
@@ -860,6 +860,42 @@
 				delete pStep;
 			}
 		}
+		{
+			CEqJobEventStep* pStep = new CEqJobEventStep();
+			pStep->setName(STEP_EQ_RECEIVED_JOB_UPS1);
+			pStep->setWriteSignalDev(index == 0 ? 0x300 : 0x600);
+			pStep->setJobDataDev(index == 0 ? 0x6388 : 0x8388);
+			if (pEquipment->addStep(0x380, pStep) != 0) {
+				delete pStep;
+			}
+		}
+		{
+			CEqJobEventStep* pStep = new CEqJobEventStep();
+			pStep->setName(STEP_EQ_RECEIVED_JOB_UPS2);
+			pStep->setWriteSignalDev(index == 0 ? 0x301 : 0x601);
+			pStep->setJobDataDev(index == 0 ? 0x64c8 : 0x84c8);
+			if (pEquipment->addStep(0x381, pStep) != 0) {
+				delete pStep;
+			}
+		}
+		{
+			CEqJobEventStep* pStep = new CEqJobEventStep();
+			pStep->setName(STEP_EQ_SENT_OUT_JOB_UPS1);
+			pStep->setWriteSignalDev(index == 0 ? 0x306 : 0x606);
+			pStep->setJobDataDev(index == 0 ? 0x6000 : 0x8000);
+			if (pEquipment->addStep(0x386, pStep) != 0) {
+				delete pStep;
+			}
+		}
+		{
+			CEqJobEventStep* pStep = new CEqJobEventStep();
+			pStep->setName(STEP_EQ_SENT_OUT_JOB_UPS2);
+			pStep->setWriteSignalDev(index == 0 ? 0x307 : 0x607);
+			pStep->setJobDataDev(index == 0 ? 0x6140 : 0x8140);
+			if (pEquipment->addStep(0x387, pStep) != 0) {
+				delete pStep;
+			}
+		}
 
 
 		pEquipment->init();
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index beaf70e..9e6a522 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -173,7 +173,7 @@
 			}
 			*/
 			// 娴嬭瘯娓呴櫎Cim Message
-			/*
+			
 			if (pEquipment->getID() == EQ_ID_Bonder1
 				|| pEquipment->getID() == EQ_ID_Bonder2) {
 				static int msgId = 0; msgId++;
@@ -184,9 +184,10 @@
 					pEquipment->clearCimMessage(msgId, 2);
 				}
 			}
-			*/
+			
 
 			// 娴嬭瘯璁剧疆鏃堕棿
+			/*
 			if (pEquipment->getID() == EQ_ID_Bonder1
 				|| pEquipment->getID() == EQ_ID_Bonder2) {
 				CTime time = CTime::GetCurrentTime();
@@ -197,7 +198,7 @@
 					(short)time.GetMinute(),
 					(short)time.GetSecond());
 			}
-			
+			*/
 
 			
 			// 娴嬭瘯璁剧疆cim mode
@@ -208,8 +209,8 @@
 				pEquipment->setCimMode(ii % 2 == 0);
 			}
 			*/
+			
 			/*
-			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
 			if (pEquipment->getID() == EQ_ID_Bonder1
 				|| pEquipment->getID() == EQ_ID_Bonder2) {
 				static int ii = 0; ii++;
diff --git a/SourceCode/Bond/Servo/CReadStep.cpp b/SourceCode/Bond/Servo/CReadStep.cpp
index 7e05c00..a482c7a 100644
--- a/SourceCode/Bond/Servo/CReadStep.cpp
+++ b/SourceCode/Bond/Servo/CReadStep.cpp
@@ -90,14 +90,14 @@
 
 				// 2.给对方写ON
 				nextStep();
-				m_pCclink->SetBitDevice(m_station, DeviceType::B, m_nWriteSignalDev);
+				m_pCclink->SetBitDeviceEx(m_station, (long)DeviceType::B, m_nWriteSignalDev);
 
 
 				// 3.等待对方OFF
 				nextStep();
 				int nStep3Ret = ::WaitForSingleObject(m_hReadSignalOff, TIMEOUT * 1000);
 				if (nStep3Ret == WAIT_TIMEOUT) {
-					m_pCclink->ResetBitDevice(m_station, DeviceType::B, m_nWriteSignalDev);
+					m_pCclink->ResetBitDeviceEx(m_station, (long)DeviceType::B, m_nWriteSignalDev);
 					onTimeout();
 					goto RESET;
 				}
@@ -106,7 +106,7 @@
 
 				// 4.给对方写OFF
 				nextStep();
-				m_pCclink->ResetBitDevice(m_station, DeviceType::B, m_nWriteSignalDev);
+				m_pCclink->ResetBitDeviceEx(m_station, (long)DeviceType::B, m_nWriteSignalDev);
 
 
 				// 6.完成
diff --git a/SourceCode/Bond/Servo/CWriteStep.cpp b/SourceCode/Bond/Servo/CWriteStep.cpp
index 6d79f55..5414b12 100644
--- a/SourceCode/Bond/Servo/CWriteStep.cpp
+++ b/SourceCode/Bond/Servo/CWriteStep.cpp
@@ -99,14 +99,14 @@
 
 				// 2.给对方写ON
 				nextStep();
-				m_pCclink->SetBitDevice(m_station, DeviceType::B, m_nWriteSignalDev);
+				m_pCclink->SetBitDeviceEx(m_station, (long)DeviceType::B, m_nWriteSignalDev);
 
 
 				// 3.等待对方ON
 				nextStep();
 				int nStep3Ret = ::WaitForSingleObject(m_hRecvSignalOn, TIMEOUT * 1000);
 				if (nStep3Ret == WAIT_TIMEOUT) {
-					m_pCclink->ResetBitDevice(m_station, DeviceType::B, m_nWriteSignalDev);
+					m_pCclink->ResetBitDeviceEx(m_station, (long)DeviceType::B, m_nWriteSignalDev);
 					onTimeout();
 					goto RESET;
 				}
@@ -115,7 +115,7 @@
 
 				// 4.写OFF
 				nextStep();
-				m_pCclink->ResetBitDevice(m_station, DeviceType::B, m_nWriteSignalDev);
+				m_pCclink->ResetBitDeviceEx(m_station, (long)DeviceType::B, m_nWriteSignalDev);
 
 
 				// 6.完成
diff --git a/SourceCode/Bond/Servo/Common.h b/SourceCode/Bond/Servo/Common.h
index a61ae5e..5dd038e 100644
--- a/SourceCode/Bond/Servo/Common.h
+++ b/SourceCode/Bond/Servo/Common.h
@@ -133,6 +133,10 @@
 #define STEP_EQ_P3_CASSETTE_CTRL_CMD	_T("EQPort3CassetteCtrlCmd")
 #define STEP_EQ_P4_CASSETTE_CTRL_CMD	_T("EQPort4CassetteCtrlCmd")
 #define STEP_EQ_CIM_MESSAGE_CONFIRM		_T("EQCimMessageConfirm")
+#define STEP_EQ_RECEIVED_JOB_UPS1		_T("EQJEReceivedJobUps1")
+#define STEP_EQ_RECEIVED_JOB_UPS2		_T("EQJEReceivedJobUps2")
+#define STEP_EQ_SENT_OUT_JOB_UPS1		_T("EQJESentOutJobUps1")
+#define STEP_EQ_SENT_OUT_JOB_UPS2		_T("EQJESentOutJobUps2")
 
 
 /* Step ID */
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj b/SourceCode/Bond/Servo/Servo.vcxproj
index 8ec1d6a..1d85c06 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj
+++ b/SourceCode/Bond/Servo/Servo.vcxproj
@@ -213,6 +213,7 @@
     <ClInclude Include="CEqCimMessageCmdStep.h" />
     <ClInclude Include="CEqCimModeChangeStep.h" />
     <ClInclude Include="CEqDateTimeSetCmdStep.h" />
+    <ClInclude Include="CEqJobEventStep.h" />
     <ClInclude Include="CEqModeChangeStep.h" />
     <ClInclude Include="CEqModeStep.h" />
     <ClInclude Include="CEqPortChangeStep.h" />
@@ -292,6 +293,7 @@
     <ClCompile Include="CEqCimMessageCmdStep.cpp" />
     <ClCompile Include="CEqCimModeChangeStep.cpp" />
     <ClCompile Include="CEqDateTimeSetCmdStep.cpp" />
+    <ClCompile Include="CEqJobEventStep.cpp" />
     <ClCompile Include="CEqModeChangeStep.cpp" />
     <ClCompile Include="CEqModeStep.cpp" />
     <ClCompile Include="CEqPortChangeStep.cpp" />
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj.filters b/SourceCode/Bond/Servo/Servo.vcxproj.filters
index f288998..8030cf0 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj.filters
+++ b/SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -85,6 +85,7 @@
     <ClCompile Include="CEqCassetteCtrlCmdStep.cpp" />
     <ClCompile Include="CJobDataB.cpp" />
     <ClCompile Include="CPageCassetteCtrlCmd.cpp" />
+    <ClCompile Include="CEqJobEventStep.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="AlarmManager.h" />
@@ -168,6 +169,7 @@
     <ClInclude Include="CEqCassetteCtrlCmdStep.h" />
     <ClInclude Include="CJobDataB.h" />
     <ClInclude Include="CPageCassetteCtrlCmd.h" />
+    <ClInclude Include="CEqJobEventStep.h" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Servo.rc" />
diff --git a/SourceCode/Bond/Servo/ToolUnits.cpp b/SourceCode/Bond/Servo/ToolUnits.cpp
index b32362a..f3a88bc 100644
--- a/SourceCode/Bond/Servo/ToolUnits.cpp
+++ b/SourceCode/Bond/Servo/ToolUnits.cpp
@@ -316,4 +316,17 @@
 	strOut = ss.str();
 
 	return strOut;
+}
+
+void CToolUnits::convertString(const char* pszBuffer, int size, std::string& strOut)
+{
+	strOut.clear();
+	int nLength = 0;
+	for (int i = 0; i < size; i++) {
+		if (pszBuffer[i] == '\0') break;
+		nLength++;
+	}
+	if (nLength > 0) {
+		strOut = std::string(pszBuffer, nLength);
+	}
 }
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/ToolUnits.h b/SourceCode/Bond/Servo/ToolUnits.h
index fddb2e3..feeae08 100644
--- a/SourceCode/Bond/Servo/ToolUnits.h
+++ b/SourceCode/Bond/Servo/ToolUnits.h
@@ -30,5 +30,6 @@
 	static std::string getCurrentTimeString();
 	static bool startsWith(const std::string& str, const std::string& prefix);
 	static std::string& toHexString(int value, std::string& strOut);
+	static void convertString(const char* pszBuffer, int size, std::string& strOut);
 };
 

--
Gitblit v1.9.3