CODESYS鐨勯殣鍚娴嬪姛鑳-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 213|鍥炲: 0

CODESYS鐨勯殣鍚娴嬪姛鑳

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2024-11-5 21:09:28 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    鍦ㄧ▼搴忕殑缂栧啓杩囩▼涓紝鍙兘浼氬彂鐢熷涓嬬殑鍑犵鎯呭喌锛
    飦 闄ゆ硶杩愮畻鐨勮闄ゆ暟鍦ㄦ煇浜涙儏鍐典笅浼氫负闆讹紱
    飦 鎸囬拡鍦ㄨ祴鍊肩殑杩囩▼涓彲鑳戒笉灏忓績鎸囧悜绌哄湴鍧锛
    飦 璋冪敤鏁扮粍鏃舵暟缁勮竟鐣屽埆婧㈠嚭浜嗭紱
    閽堝涓婅堪鎯呭喌锛孋oDeSys 鏈夊搴旂殑瑙e喅鏂规锛岀敤鎴峰彲浠ュ簲鐢ㄤ笅娣诲姞闅愬紡妫鏌 POUs锛岄殣寮忔鏌
    POUs 鑳藉妫鏌ュ嚱鏁扮殑闃靛垪鍜岀晫闄愶紝浠ュ強闄ゆ暟涓洪浂鍜岃繍琛岀郴缁熶腑鐨勬寚閽堛
    鏈変互涓嬭繖鍥涚鍑芥暟鍔熻兘锛
    飦 CheckBounds锛 锛堟鏌ユ暟缁勮竟鐣屽嚱鏁帮級
    飦 CheckDivInt /CheckDivLInt/CheckDivReal/CheckDivLreal锛 锛 妫鏌ラ櫎闆跺嚱鏁 )
    飦 CheckRange/CheckRangeUnsigned锛 ( 鍩熻竟鐣岀殑妫鏌ュ嚱鏁 )
    飦 CheckPointer ( 鎸囬拡妫鏌ュ嚱鏁 )
    鍏充簬涓婇潰鍥涚绫诲瀷鍑芥暟锛孋heckPointer ( 鎸囬拡妫鏌ュ嚱鏁 )鏃堕渶瑕佺敤鎴疯嚜宸辩紪鍐欑殑锛屽叾浠栫殑鏄笉鍙紪鍐欑殑銆
    183812js870dk3o8rd3skl.png
    1.鎿嶄綔姝ラ锛
    鍦ㄥ簲鐢ㄤ笅榧犳爣鍙抽敭閫夋嫨鈥滄坊鍔犲璞♀濓紝閫夋嫨鈥滅敤浜庨殣鍚鏌ョ殑 POU鈥濓紝闅忓悗绯荤粺鍒
    浼氬脊鍑哄璇濇锛岃繘琛屽嚱鏁伴夋嫨

    183812hndfnzp5aefvjj58.png
    2.鍑芥暟鍒嗘瀽锛
    (2-1)  CheckDivInt/CheckDivLint/CheckDivReal/CheckDivLreal 妫鏌ラ櫎闆跺嚱鏁颁负浜嗘鏌ラ櫎鏁扮殑鍊硷紝閬垮厤绋嬪簭杩涜闄ら浂杩愮畻锛孋oDeSys 涓彲浠ヤ娇鐢ㄦ鏌ュ嚱鏁 CheckDivInt/
    CheckDivLint/ CheckDivReal/ CheckDivLreal銆傚湪灏嗗畠浠寘鍚湪搴旂敤涓箣鍚庢瘡涓浉鍏充唬鐮佸彂鐢熺殑闄ゆ硶
    杩囩▼閮藉皢浜х敓涓涓鍑芥暟璋冪敤鐨勯澶勭悊銆
    褰撴垜浠柊寤轰竴涓彉閲忔病鏈夊垵濮嬭祴鍊硷紝鐩存帴鎷夊嚭鏉ヨ繘琛岄櫎娉曡繍绠楋紝杩欎釜鏃跺欑郴缁熶細鎶ラ敊锛屽洜涓烘病鏈夊垵濮嬭祴鍊艰繖涓彉閲忕郴缁熶細榛樿涓0
    183843o6piydo6do6qoiom.png
    褰撲娇鐢ㄤ簡闅愬惈妫娴嬮櫎0鏃讹紝绯荤粺浼氬皢涓哄垵濮嬭祴鍊肩殑鍙橀噺榛樿涓1锛岄伩鍏嶄骇鐢熺▼搴忛敊璇

    183938xtwwu16tk00p1j1b.png

    (2-2)CheckBounds 妫鏌ユ暟缁勮竟鐣屽嚱鏁

    姝ゅ嚱鏁版鏌ユ槸鍚﹀鏁扮粍鐨勮竟鐣屾湁瓒呭嚭銆傞氬父搴旂敤鍦ㄥ彲鍙樼殑鏁扮粍绫诲瀷琚垎閰嶅簲鐢ㄤ腑锛屼娇鐢ㄨ闅愯棌
    鍑芥暟鍙互鐢ㄦ湁鏁堢殑淇濊瘉鍑芥暟杈圭晫涓嶈瓒呭嚭銆


    濡傛灉娌℃湁閲囩敤锛屾暟缁勭殑鏈澶у间細浠庡ご寮濮嬬畻锛屽鍥句腑
    184016qylsseh2yypy55z3.png
    閲囩敤浜嗘暟缁勮竟鐣屾娴嬪彉閲忔渶澶у间細鎸夌収鏁扮粍鐨勬渶澶ц竟鐣屾潵璧嬪硷紝濡傚浘涓
    184017yd8t8cjkhn6y3tyj.png


    (2-3) CheckRange/CheckRangeUnsigned 鍩熻竟鐣岀殑妫鏌ュ嚱鏁颁负浜嗗湪杩愯杩囩▼涓鏌ュ煙鐨勯檺鍒讹紝鍙互浣跨敤鍑芥暟 CheckRangeSigned 鎴 CheckRangeUnsigned銆
    姝ゆ鏌ュ姛鑳界殑鐩殑鏄伆褰撶殑瀛愰泦杩濊澶勭悊锛堝璁剧疆涓涓娴嬪埌鐨勯敊璇棗甯滄垨鏀瑰彉鍊硷級銆傚綋涓涓
    鍙橀噺鐨勫瓙闆嗙被鍨嬭纭鍚庤繖涓姛鑳藉皢琚殣钘忚闂傚綋璁块棶杩欎釜鍔熻兘鏃跺緱鍒颁互涓嬭緭鍏ュ弬鏁帮細
    飦 鍊硷細鍩熺被鍨嬭鍒嗛厤鐨勫
    飦 浣庯細鍩熺殑涓嬮檺
    飦 楂橈細鍩熺殑涓婇檺
    濡傛灉琚垎閰嶇殑鍊兼槸鍦ㄦ湁鏁堢殑鍩熷唴锛屼粬灏嗕綔涓哄姛鑳戒腑鐨勮繑鍥炲艰浣跨敤銆傚惁鍒欙紝瀵瑰簲瓒呰繃鑼冨洿鐨勬暟
    鍊硷紝瑕佷箞涓婇檺鎴栦笅杈圭晫鐨勮寖鍥村皢琚繑鍥炪
    濡傚浘涓紨绀虹殑鏄笂闄愬硷紝褰撴病鏈夌敤杈规部妫娴嬬殑鏃跺欐渶澶у兼槸澶т簬杈规部鐨勩
    184055zgx7db674ppp22l7.png


    浣跨敤浜嗚竟娌挎娴嬪氨鏄寜鐓х紪鍐欑殑鏈澶у硷紝杩欎釜鍦版柟浣跨敤浜嗚娉ㄦ剰閬垮厤璁$畻闄峰叆姝诲惊鐜紝鍥犱负浠栨槸涓嶄細瓒呭嚭鏈澶у肩殑銆

    184055rycooz7i3co5yc99.png

    (2-4) CheckPointer 鎸囬拡妫鏌ュ嚱鏁 锛堥渶瑕佺敤鎴疯嚜宸辩紪鍐欙紝鏍煎紡鏈夊緢澶氱涓嬮潰鍙槸鎴戜釜浜虹紪鍐欐娴嬫暟鎹被鍨嬩笉瀵圭殑鏃跺欏浣曚骇鐢熸姤璀︼級鍑芥暟 CheckPointer 妫鏌ュ湴鍧鐨勬寚閽堝紩鐢ㄦ槸鍚﹂兘鍦ㄦ湁鏁堢殑鍐呭瓨鑼冨洿鍐呫傚湪杩愯杩囩▼涓紝鐢ㄦ埛鍙互
    鍦ㄦ瘡涓寚閽堟搷浣滈兘鍙互浣跨敤 CheckPointer 鏉ヨ繘琛屾寚閽堣闂殑妫鏌ャ 瀹冨彲浠ョ敤鏉ユ鏌ュ湴鍧鎸囬拡寮曠敤鏄
    鍚﹀潎鍦ㄦ湁鏁堢殑鍐呭瓨鑼冨洿銆傛澶栵紝杩樺彲浠ョ敤鏉ユ娴嬪榻愮殑鍐呭瓨鍖轰笌寮曠敤鐨勫彉閲忔暟鎹被鍨嬬殑鎸囬拡鎸囧悜銆
    濡傛灉涓や釜鏉′欢閮芥弧瓒筹紝CheckPointer 杩斿洖涓嶅彉杈撳叆鎸囬拡銆
    褰撹皟鐢ㄥ嚱鏁拌幏寰椾互涓嬭緭鍏ュ弬鏁版椂锛
    ptToTest锛 鎸囨爣鐨勭洰鏍囧湴鍧锛
    iSize锛氬紩鐢ㄥ彉閲忕殑鍨嬪彿锛涘瀷鍙风殑鏁版嵁绫诲瀷蹇呴』鏄暣鏁板吋瀹圭殑骞朵笖蹇呴』娑电洊鏈澶ф綔鍦ㄥ偍瀛樺湪鎸囨爣
    鍦板潃涓殑鏁版嵁鍨嬪彿锛
    iGran锛氳闂殑闂撮殧锛岃繖鏄渶澶х殑鏃犵粨鏋勬暟鎹被鍨嬶紝 iGran 鐨勬暟鎹被鍨嬪繀椤绘槸鏁存暟鍏煎鐨勶紱

    bWrite锛氳闂殑绫诲瀷锛圱RUE=鍐欏叆璁块棶锛孎ALSE=璇诲叆璁块棶锛夛紱
    (鍏充簬iSize鍜宨Gran杩欎袱涓彉閲忕被鍨嬬殑鎰忔濇槸妫娴嬪叧浜庢寚閽堟暟鎹被鍨嬩唬琛ㄧ殑瀛楄妭鏄笉鏄纭殑锛屽INT鏄2锛孯EAL鏄4锛
    183401i1lhaxxoswrhss6f.png
    濡傛灉娌℃湁寮鎸囬拡妫娴嬶紝鏁版嵁绫诲瀷浼犻掓槸涓嶆纭殑濡傚浘
    183425rozcwb7hao7wz9ul.png
    姝g‘鐨勫鍥
    183424vis9aa763slx3hh6.png


    濡傛灉閲囩敤浜嗛殣鍚寚閽堟娴嬩細浜х敓鎶ヨ
    183424x0rqhw4ul0uld342.png

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

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2025-1-23 06:19 , Processed in 0.215819 second(s), 60 queries .

    閰峰痉缃

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

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