codesys modbustcp-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 269|鍥炲: 0

codesys modbustcp

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2024-8-9 23:26:34 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    鎴戜滑閮界煡閬撳湪浠ュお缃戜笂鍙互浣跨敤modbusTCP鏉ヨ繘琛岄氳銆備互澶綉閫氳闇瑕佹湁鏈嶅姟鍣ㄥ拰瀹㈡埛绔備竴鑸殑PLC鏄湪鎺у埗鍣ㄤ笂寤虹珛涓涓湇鍔″櫒鍣ㄣ傚儚涓婁綅鏈哄強楂樹竴灞傜殑璁惧鍙互杩炴帴PLC锛屾渶甯哥敤鐨勬槸鐢╩odbusTCP鐨勫姛鑳4璇诲彇杈撳叆瀵勫瓨鍣ㄧ殑鍐呭锛岀敤鍔熻兘3璇诲彇淇濇寔瀵勫瓨鍣ㄧ殑鍐呭銆備篃鍙互鍐橮LC鐨勫唴瀹广備絾鏄紝鍦╟odesys褰撲腑鐨勯厤缃拰甯歌鐨勬兂娉曚笉涓鏍凤紝鍙兘閫犳垚娣锋穯銆

    codesys寤虹珛鏈嶅姟鍣
    鍦ㄦ帶鍒跺櫒渚у缓绔嬫湇鍔″櫒鎸夊父瑙勬兂娉曟槸寤虹珛涓涓猰odbus_TCP_master. 浣嗗湪瀹為檯搴旂敤涓紝鎴戜滑闇瑕佸湪璁惧鏍戜笂娣诲姞modbus_TCP_slave_device. 杩欐槸鍦ㄥ缓绔嬫湇鍔″櫒鏈瀹规槗娣锋穯鐨勯儴鍒嗐傛纭殑鍋氭硶濡備笅锛


    30043609_665791b99216936204.jpg


    鍚勯儴鍒嗚缃涓嬨

    閫氱敤璁剧疆
    鎬荤嚎浠庣珯绔彛锛氬父瑙勮缃负502.
    淇濇寔瀵勫瓨鍣細杩欓噷鍙互璁剧疆瑕佷娇鐢ㄧ殑淇濇寔瀵勫瓨鍣ㄧ殑澶氬皯锛屽崰鐢ㄧ殑鍦板潃涓%IW
    杈撳叆瀵勫瓨鍣細杩欓噷鏄緭鍏ュ瘎瀛樺櫒鐨勫湴鍧鐨勫灏戯紝鍗犵敤鐨勫湴鍧涓%QW銆
    璁剧疆鏄惁鏈夎璁剧疆杈撳叆鍜岃緭鍑虹鏁i噺鐨勫湴鍧銆
    涓插彛缃戝叧
    鍦ㄨ繖閲屾槸鍚︿娇鐢ㄤ覆鍙g綉鍏炽

    modbus_TCP_slave_device鐨勬槧灏
    杩欎竴閮ㄥ垎璁剧疆浜庢帶鍒跺櫒涓殑鍦板潃鐨勬槧灏勩

    灏嗚缃殑淇濇寔瀵勫瓨鍣ㄥ拰杈撳叆瀵勫瓨鍣ㄤ簬鍏蜂綋鐨勫湴鍧鍏宠仈璧锋潵銆傝繖閲屾垜浠瀹氫簡10鍚勪繚鎸佸瘎瀛樺櫒鍜10鍚勮緭鍏ュ瘎瀛樺櫒銆傛槧灏勫叧绯诲湪杩欓噷璁剧疆銆


    30043609_665791b9af62c87426.jpg


    涓嬮潰鏄痬odbus_TCP_Slave_Device IEC瀵硅薄锛岀姸鎬佸拰淇℃伅椤规病鏈夎缃殑閮ㄥ垎銆

    鏈嶅姟鍣ㄥ姛鑳藉疄楠
    鍦℅VL鍏ㄥ眬鍙橀噺搴撲腑寤虹珛涓涓彉閲忥細

    [AppleScript] 绾枃鏈煡鐪 澶嶅埗浠g爜
    VAR_GLOBAL
    	IO_QW0 AT %QW0 : INT;
    END_VAR


    澧炲姞涓娈垫暟鎹鍔犵殑绋嬪簭锛岀劧鍚庝笅杞借繍琛岀▼搴忋


    30043609_665791b9c425891409.jpg


    鍦ㄥ閮ㄨ绠楁満涓婅繍琛屽鍔熻兘璋冭瘯鍔╂墜


    30043609_665791b9e287731585.jpg


    閫夋嫨绔彛涓502锛岃繛鎺ユ湇鍔″櫒銆傛樉绀鸿繛鎺ユ湇鍔″櫒鎴愬姛銆傚湪鍙戦佸尯杈撳叆modbusTCP璇诲彇杈撳叆瀵勫瓨鍣ㄧ殑鍐呭锛屾垜浠鍙10涓緭鍏ュ瘎瀛樺櫒鐨勫唴瀹广傚懡浠16杩涘埗鐮佸涓嬶細

    00 01 00 00 00 06 05 04 03 E8 00 0A

    杩斿洖甯у涓嬶紝鍒嗗埆鏄袱娆$殑杩斿洖甯э細

    杩斿洖甯1锛

    00 01 00 00 00 17 05 04 14 21 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    杩斿洖甯2锛

    00 01 00 00 00 17 05 04 14 21 DA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    鍏朵腑鐨勫瓧鑺9鍜屽瓧鑺10鏄▼搴忎腑鐨勮緭鍏ュ瘎瀛樺櫒1鐨勫唴瀹规槸鍦ㄧ▼搴忎腑涓嶆柇閫掑鐨勩

    鎬荤粨
    浣跨敤modbusTCP鍙互鏂逛究鐨勫疄鐜板閮ㄤ簬codesys鎺у埗鍣ㄧ殑鐨勬暟鎹氳銆備絾鍦ㄩ厤缃椂瀹规槗浜х敓娣锋穯锛屾垜璁や负codesys鏄互澶栭儴璁惧鐨勮搴︽潵鐪嬫湇鍔″櫒鍜屼粠绔欒澶囥
    鍦∕odbusTCP閫氳涓簲褰撴敞鎰忥紝姣忎釜鎶ユ枃鐨勬渶澶ч暱搴﹀簲璇ユ槸鏈夐檺鍒剁殑锛屽簲璇ユ瘡娆¤鍙栫殑鏁伴噺鍦254涓瓧鑺傦紝127涓瘎瀛樺櫒鐨勫唴瀹癸紝濡傛灉瓒呭嚭杩欎釜鑼冨洿浼氬け璐ャ傚湪杩欓噷璁板綍涓嬫潵渚涘ぇ瀹跺弬鑰冦



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

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2024-11-23 20:01 , Processed in 0.158304 second(s), 60 queries .

    閰峰痉缃

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

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