Codesys閫氳繃绋嬪簭鍒ゆ柇EtherCAT缃戠粶鐘舵-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 24|鍥炲: 0

Codesys閫氳繃绋嬪簭鍒ゆ柇EtherCAT缃戠粶鐘舵

[澶嶅埗閾炬帴]
  • TA鐨勬瘡鏃ュ績鎯
    鎿︽睏
    2019-8-13 14:13
  • 绛惧埌澶╂暟: 32 澶

    [LV.5]甯镐綇灞呮皯I

    鍙戣〃浜 6 澶╁墠 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    鍓嶈█   
    寰堝鏃跺欙紝鎴戜滑闇瑕佸湪瑙︽懜灞忎笂鏄剧ず璁惧鐨凟therCAT涓嬬殑缃戠粶鐘舵侊紝鏄惁浠庣珯鏂嚎绛変俊鎭傜潯瑙夊墠鍐嶅垎浜竴涓疄闄呴」鐩腑鐨勭▼搴忔~

    姝f枃
    1.Code Show
    [AppleScript] 绾枃鏈煡鐪 澶嶅埗浠g爜
    PROGRAM Pro_Motion
    VAR
            pSlave         : POINTER TO ETCSlave;
            DiOverTime     : DINT; //瓒呮椂鏃堕棿
            DiMaxOverTime  : DINT; //鏈闀挎椂闂
            iNodeID        : INT ; //EtherCAT鑺傜偣
            iErrorNodeID   : INT ; //EtherCAT閿欒鑺傜偣
    END_VAR
    
    {region 'Check EtherCAT Network'}
    iNodeID := 1 ;
    pSlave  := EtherCAT_Master_Leadshine_A.FirstSlave;//涓荤珯鍚嶇О
    WHILE pSlave <> 0 DO
            pSlave^();
               IF pSlave^.wState = ETC_SLAVE_STATE.ETC_SLAVE_OPERATIONAL THEN
                    iNodeID       := iNodeID + 1; iErrorNodeID := 0 ; 
                    DiMaxOverTime := DiOverTime ;
            ELSE
                    iErrorNodeID := iNodeID ;         
                    DiOverTime   := DiOverTime + 1 ;
                    EXIT ;
               END_IF ;
               pSlave := pSlave^.NextInstance;
    END_WHILE ;
    {endregion}


    閫氳繃涓婇潰鐨勭▼搴忔鍙互鍦ㄤ粠绔欓氳杩囩▼涓鏂嚎鏃跺欙紝鍒ゆ柇鍑烘槸浠庨偅涓涓妭鐐瑰嚭鐜伴棶棰樸

    缁撳熬

    鍏跺疄锛孋odesys骞冲彴涔嬫墍浠ョ幇鍦ㄥ彂灞曠殑閭d箞鐨勫揩锛屽叾瀹炴潵婧愬緢澶氬熀纭鐨勫熀纭妗嗘灦鎼缓鐨勫ソ銆傦紙鐫¤鍘讳簡锛屽仛鏃ユ洿璐靛湪鍧氭寔~鍔犳补锛侊級

    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

    椤堕儴qrcode搴曢儴
    鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

    QQ|灏忛粦灞|鎵嬫満鐗|Archiver|閰峰痉璁哄潧 ( 鑻廔CP澶16065247鍙-1 )|缃戠珯鍦板浘

    GMT+8, 2025-1-23 03:24 , Processed in 0.266547 second(s), 54 queries .

    閰峰痉缃

    © 2001-2013 Hicodesys. 鎶鏈敮鎸 by 閰峰痉缃

    蹇熷洖澶 杩斿洖椤堕儴 杩斿洖鍒楄〃