PLC鐨勯珮浣庡瓧鑺傝浆鎹-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 139|鍥炲: 0

PLC鐨勯珮浣庡瓧鑺傝浆鎹

[澶嶅埗閾炬帴]
  • TA鐨勬瘡鏃ュ績鎯
    寮蹇
    2017-11-20 22:07
  • 绛惧埌澶╂暟: 2 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 6 澶╁墠 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    PLC鐨勫瘎瀛樺櫒鍒嗕负鍗曞瓧锛圵ord锛夊拰鍙屽瓧(Dword)锛學ord鍗犵敤2涓瓧鑺侭yte锛孌word鍗犵敤4涓瓧鑺侭yte;
    鍦≒LC鍜屽叾浠栬澶囬氳寰寰浠ュ瓧鑺備负鍗曚綅杩涜浼犻佺殑锛屾牴鎹笉鍚岀殑閫氳鍗忚锛屼紶閫佹墍鍙戠殑鍐呭涓嶄竴鑷达紝鍏朵腑鏈変簺鍗忚闇瑕佽繘琛屽墠鍚庡瓧鑺備氦鎹,鍚戝父瑙佺殑PLC锛屼笁鑿憋紝姹囧窛绛夋棩绯籔LC鏈変笓闂ㄧ殑鎸囦护SWAP鏉ヨ繘琛岃浆鎹紱渚嬪瀵勫瓨鍣 A:=16#AABB,缁忚繃SWAP鎸囦护鍚庯紝A=16#BBAA

    PLC鐨勯珮浣庡瓧鑺傝浆鎹-1.png

    PLC鐨勯珮浣庡瓧鑺傝浆鎹-2.png


    Codesys缂栫▼鍜屼紶缁熺殑PLC缂栫▼涓嶄竴鏍凤紝Codesys缂栫▼鏄睘浜庝竴绉嶉潰鍚戝璞$殑缂栫▼鏂瑰紡锛屼娇鐢ㄨ捣鏉ユ瘮杈冨叿鏈夌伒娲绘э紝鍙互鏍规嵁鑷繁鐨勭紪绋嬩範鎯鏍兼潵杩涜缂栫▼绋嬪簭锛涗笅闈妇渚嬪浣曚娇鐢–odesys鏉ヨ繘琛岀紪鍐橲WAP鎸囦护锛

    PLC鐨勯珮浣庡瓧鑺傝浆鎹-3.png


    鏂板缓Codesys鏂囦欢锛岃澶囬夋嫨V3-X64锛岀紪绋嬭瑷鏀寔6绉嶏紝杩欓噷涓句緥浠呬娇鐢ㄧ粨鏋勫寲鏂囨湰ST锛

    PLC鐨勯珮浣庡瓧鑺傝浆鎹-4.png

    鍦ㄥ彉閲忓0鏄庡尯鍏堝畾涔夌▼搴忎腑瑕佸嚭鐜扮殑鍙橀噺锛岀劧鍚庡湪绋嬪簭鎵ц鍖虹紪鍐欒繍琛岀殑绋嬪簭锛
    浠g爜濡備笅锛
    ---------------------------------------鍙橀噺澹版槑鍖--------------------------------------------------------------------------
    [AppleScript] 绾枃鏈煡鐪 澶嶅埗浠g爜
    PROGRAM PLC_PRG//绋嬪簭鍚嶅瓧
    VAR
        //
        IN           :WORD;//IN鏄彉閲忓悕绉帮紝   WORD鏄彉閲忓彉閲忕被鍨
        OUT          :WORD;
    END_VAR
    ---------------------------------------绋嬪簭鎵ц鍖-------------------------------------------------------------
    OUT :=IN/256+(IN MOD 256)*256;
    (*
    16浣嶆暟鎹櫎浠256锛屽嵆灏16浣嶆暟鎹殑楂樹綆8浣嶈嚜鍔ㄥ垎寮銆
    渚嬪鍘熸暟鍊兼槸锛2#1111111100000000锛岃浆鎹㈡垚10杩涘埗灏辨槸  65280,杞崲鍑16杩涘埗灏辨槸FF00.
    灏嗚鏁板奸櫎浠256鍜屽彇浣256锛岀粨鏋滃垎鍒槸  鏁板肩殑楂8浣嶏紙鏁存暟锛夛紝鍜屾暟鍊肩殑浣8浣嶏紙浣欐暟锛
    鍐嶅皢浣欐暟涔樹互256+鏁存暟寰楀嚭鐨勬柊鏁版嵁灏辨槸楂樹綆瀛楄妭杞崲鍚庣殑鏁板硷紱
    
    *)
    


    ------------------------------------------------浠跨湡----------------------------------------------------------------

    PLC鐨勯珮浣庡瓧鑺傝浆鎹-5.png


    鍦ㄥ湪绾块夐」鎵鹃偅涓夋嫨浠跨湡妯″紡锛屽綋杞欢鏈浣庝笅鍑虹嚎浠跨湡鐨勬椂鍊欙紝鐐瑰嚮鐧诲綍锛岀劧鍚庡湪寮瑰嚭鐨勭晫闈㈤夋嫨纭锛

    PLC鐨勯珮浣庡瓧鑺傝浆鎹-6.png


    鐐瑰嚮绋嬪簭澹版槑鍖虹殑鍑嗗鍊硷紝鍙抽敭灏嗘樉绀烘ā寮忔洿鏀规垚16杩涘埗锛岀劧鍚庤緭鍏ュ綋鍓嶅16#AABB锛岀劧鍚庣偣鍑昏皟璇曞啓鍏ュ煎嵆鍙繘琛屼豢鐪燂紱


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

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2025-9-1 05:49 , Processed in 0.166522 second(s), 61 queries .

    閰峰痉缃

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

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