LAPTOP-SNT8I5JK\Boounion
2025-02-20 4cc9fd5bb0c0224e88ca702e6e736e1bc138dce6
1.测试通过Equipment Mode Change Report流程;
已添加1个文件
已删除1个文件
已修改8个文件
75 ■■■■■ 文件已修改
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.1(1).xlsx 补丁 | 查看 | 原始文档 | blame | 历史
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.1.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CStep.cpp 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CStep.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.1(1).xlsx
Binary files differ
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.1.xlsx
Binary files differ
SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.cpp
@@ -80,7 +80,7 @@
    return 0; // 校验通过
}
int CCCLinkIEControl::ReadData2(const StationIdentifier& station, short devType, short devNo, short size, void* pData)
int CCCLinkIEControl::ReadData2(const StationIdentifier& station, DeviceType enDevType, short devNo, short size, void* pData)
{
    // 验证站点参数和数据有效性
    int nRet = ValidateStationAndSize(station, size);
@@ -92,7 +92,8 @@
    // 确保线程安全的最小锁定范围
    {
        std::lock_guard<std::mutex> lock(m_mtx);
        nRet = mdReceive(m_nPath, CombineStation(station), devType, devNo, &size, pData);
        const short nDevType = CalculateDeviceType(station, enDevType);
        nRet = mdReceive(m_nPath, CombineStation(station), nDevType, devNo, &size, pData);
    }
    if (nRet != 0) {
SourceCode/Bond/Servo/CCLinkPerformance/CCLinkIEControl.h
@@ -59,7 +59,7 @@
    // 读取LED状态
    int ReadLedStatus(LedStatus& outLedStatus);
    int ReadData2(const StationIdentifier& station, short devType, short devNo, short size, void* pData);
    int ReadData2(const StationIdentifier& station, DeviceType enDevType, short devNo, short size, void* pData);
private:
    static CCLinkIEControlMode ConvertToCCLinkIEControlMode(short nMode);
SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
@@ -117,13 +117,13 @@
    SPB = 0x0032,     // 缓冲存储器 (字)
    MAIL = 0x0065,   // 特殊软元件类型:邮件类型 (10进制 101)
    MAILMC = 0x0066, // 特殊软元件类型:无确认邮件 (10进制 102)
    LX = 0x03E9,     // 链接直接软元件 (链接输入) (0x03E9~0x04E7) (位)
    LY = 0x07D1,     // 链接直接软元件 (链接输出) (0x07D1~0x08CF) (位)
    LB = 0x59D9,     // 链接直接软元件 (链接继电器) (0x59D9~0x5AD7) (位)
    LW = 0x5DC1,     // 链接直接软元件 (链接寄存器) (0x5DC1~0x5EBF) (字)
    LSB = 0x61A9,    // 链接直接软元件 (链接特殊继电器) (0x61A9~0x62A7) (位)
    LSW = 0x6D61,    // 链接直接软元件 (链接特殊寄存器) (0x6D61~0x6E5F) (字)
    SPG = 0x7148,    // 智能功能模块软元件 (0x7148~0x7247) (字)
    LX = 0x03E8,     // 链接直接软元件 (链接输入) (0x03E9~0x04E7) (位)
    LY = 0x07D0,     // 链接直接软元件 (链接输出) (0x07D1~0x08CF) (位)
    LB = 0x59D8,     // 链接直接软元件 (链接继电器) (0x59D9~0x5AD7) (位)
    LW = 0x5DC0,     // 链接直接软元件 (链接寄存器) (0x5DC1~0x5EBF) (字)
    LSB = 0x61A8,    // 链接直接软元件 (链接特殊继电器) (0x61A9~0x62A7) (位)
    LSW = 0x6D60,    // 链接直接软元件 (链接特殊寄存器) (0x6D61~0x6E5F) (字)
    SPG = 0x7147,    // 智能功能模块软元件 (0x7148~0x7247) (字)
};
// 数据类型
SourceCode/Bond/Servo/CEquipment.cpp
@@ -15,6 +15,7 @@
        m_bLocalAlarm = FALSE;
        m_bAutoRecipeChange = FALSE;
        m_bVCREnable[0] = FALSE;
        m_pCclink = nullptr;
        InitializeCriticalSection(&m_criticalSection);
    }
@@ -32,6 +33,11 @@
    {
        m_listener.onAlive = listener.onAlive;
        m_listener.onCimStateChanged = listener.onCimStateChanged;
    }
    void CEquipment::setCcLink(CCCLinkIEControl* pCcLink)
    {
        m_pCclink = pCcLink;
    }
    void CEquipment::getProperties(std::vector<std::pair<std::string, std::string>>& container)
@@ -54,6 +60,7 @@
    {
        auto iter = m_mapStep.find(addr);
        if (iter != m_mapStep.end()) return -1;
        pStep->setCcLink(m_pCclink);
        m_mapStep[addr] = pStep;
        return 0;
    }
@@ -119,7 +126,7 @@
    void CEquipment::setReadBitBlock(unsigned int start, unsigned int end)
    {
        m_blockReadBit.type = (unsigned int)DeviceType::LB;;
        m_blockReadBit.type = (unsigned int)DeviceType::B;
        m_blockReadBit.start = start;
        m_blockReadBit.end = end;
        m_blockReadBit.size = (m_blockReadBit.end - m_blockReadBit.start + 1) / 8;
@@ -168,12 +175,13 @@
    void CEquipment::onReceiveLBData(const char* pszData, size_t size)
    {
        /*
        TRACE("%s onReceiveLBData: %d bytes\n", m_strName.c_str(), size);
        for (unsigned int i = 0; i < size; i++) {
            if (pszData[i] != 0)
                TRACE("%d[%x]\n", i, pszData[i]);
        }
        */
        // 以下解释和处理数据
        BOOL bFlag;
@@ -239,21 +247,11 @@
        // Equipment Mode Change Report
        index = 0x360;
        bFlag = isBitOn(pszData, size, ++index);
        static int i;
        i++;
        if (i > 10) bFlag = TRUE;
        if (i > 15) bFlag = FALSE;
        if (i > 110) bFlag = TRUE;
        if (i > 115) bFlag = FALSE;
        //if (i == 12) bFlag = FALSE;
        bFlag = isBitOn(pszData, size, index);
        CStep* pStep = getStep(0x360);
        if (pStep != nullptr) {
            pStep->onSignal(bFlag);
        }
    }
    BOOL CEquipment::isBitOn(const char* pszData, size_t size, int index)
SourceCode/Bond/Servo/CEquipment.h
@@ -43,6 +43,7 @@
    public:
        virtual const char* getClassName() = 0;
        virtual void setListener(EquipmentListener listener);
        void setCcLink(CCCLinkIEControl* pCcLink);
        void setID(int nID);
        int getID();
        void setName(const char* pszName);
@@ -105,6 +106,7 @@
        BOOL m_bVCREnable[VCR_MAX];
    private:
        CCCLinkIEControl* m_pCclink;
        std::map<unsigned int, CStep*> m_mapStep;
    };
}
SourceCode/Bond/Servo/CMaster.cpp
@@ -68,7 +68,7 @@
            pEquipment->setName("EFEM(ROBOT)");
            pEquipment->setDescription("EFEM(ROBOT).");
            pEquipment->setReadBitBlock(0x4000, 0x45ff);
            pEquipment->setStation(1, 2);
            pEquipment->setStation(0, 255);
            addEquipment(pEquipment);
            pEquipment->init();
@@ -121,6 +121,7 @@
            }
        };
        pEquipment->setListener(listener);
        pEquipment->setCcLink(&m_cclink);
        m_listEquipment.push_back(pEquipment);
        return 0;
@@ -151,7 +152,7 @@
                const StationIdentifier& station = item->getStation();
                MemoryBlock& block = item->getReadBitBlock();
                int nRet = m_cclink.ReadData2(station, (short)block.type,
                int nRet = m_cclink.ReadData2(station, (DeviceType)block.type,
                    block.start, block.size, block.buffer);
                if (0 == nRet) {
                    item->onReceiveLBData(block.buffer, block.size);
SourceCode/Bond/Servo/CStep.cpp
@@ -19,6 +19,7 @@
        m_hSignalOn = ::CreateEvent(NULL, TRUE, FALSE, NULL);
        m_hSignalOff = ::CreateEvent(NULL, TRUE, FALSE, NULL);
        m_nCurStep = 0;
        m_pCclink = nullptr;
        InitializeCriticalSection(&m_criticalSection);
    }
@@ -33,6 +34,11 @@
        m_hSignalOff = nullptr;
        DeleteCriticalSection(&m_criticalSection);
    }
    void CStep::setCcLink(CCCLinkIEControl* pCcLink)
    {
        m_pCclink = pCcLink;
    }
    void CStep::init()
@@ -79,20 +85,24 @@
                // 1.读取数据
                nextStep();
                TRACE("m_nCurStep:%d\n", m_nCurStep);
                ASSERT(m_pCclink);
                StationIdentifier station(0, 255);
                DWordContainer dc;
                m_pCclink->ReadDWordData(station, DeviceType::W, 0x4a8c, 1, dc);
                int nState = dc.at(0);
                TRACE(">> nState:%d\n", nState);
                // 2.给对方写ON
                nextStep();
                TRACE("m_nCurStep:%d\n", m_nCurStep);
                m_pCclink->SetBitDevice(station, DeviceType::B, 0x30);
                // 3.等待对方OFF
                nextStep();
                TRACE("m_nCurStep:%d\n", m_nCurStep);
                int nStep3Ret = ::WaitForSingleObject(m_hSignalOff, TIMEOUT * 1000);
                if (nStep3Ret == WAIT_TIMEOUT) {
                    timeout();
                    m_pCclink->ResetBitDevice(station, DeviceType::B, 0x30);
                    goto RESET;
                }
                ResetEvent(m_hSignalOff);
@@ -100,6 +110,7 @@
                // 4.给对方写OFF
                nextStep();
                m_pCclink->ResetBitDevice(station, DeviceType::B, 0x30);
                TRACE("m_nCurStep:%d\n", m_nCurStep);
@@ -125,7 +136,6 @@
    void CStep::onSignal(BOOL bSignal)
    {
        TRACE(">>>>>>>>>>>>>>>>>>>> setSignal:%s\n", bSignal ? "ON" : "OFF");
        Lock();
        if (m_nCurStep == 0 && bSignal) {
            SetEvent(m_hSignalOn);
SourceCode/Bond/Servo/CStep.h
@@ -1,4 +1,5 @@
#pragma once
#include "CCLinkIEControl.h"
namespace SERVO {
@@ -10,6 +11,7 @@
    public:
        unsigned WorkingProc();
        void setCcLink(CCCLinkIEControl* pCcLink);
        virtual void init();
        virtual void CStep::term();
        virtual void onSignal(BOOL bSignal);
@@ -22,6 +24,7 @@
        void timeout();
    private:
        CCCLinkIEControl* m_pCclink;
        CRITICAL_SECTION m_criticalSection;
        std::string strName;
        HANDLE m_hWorkThreadHandle;