銆怌ODESYS澶ц鍫傘慍ELL_CHECK_4 搴-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
绂忕墰杩庢槬锛屽睘鎴戞渶鐗涳綖
鏌ョ湅: 1019|鍥炲: 0

銆怌ODESYS澶ц鍫傘慍ELL_CHECK_4 搴

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

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

    鍙戣〃浜 2018-7-4 22:12:33 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    CELL_CHECK_4 搴撳氨鏄 CELL_CHECK_4.lib 搴撴枃浠朵腑鐨勫姛鑳藉潡銆傛湰搴撲腑灏卞彧鏈
    CELL_CHECK_4 涓涓姛鑳藉潡銆
    鍔熻兘鎻忚堪锛
    鏈姛鑳藉潡涓昏鏄竴涓剦鍐叉娴嬪姛鑳藉潡銆傚綋杈撳叆鐨勮剦鍐蹭俊鍙峰繀椤诲湪 150 涓▼搴忓惊鐜腑
    鏈夋墍鏀瑰彉锛屾鏃 ALLUP 杈撳嚭涓 TRUE锛屽惁鍒欎负 FALSE銆
    鍑芥暟鍥惧涓嬶細
    640_缁撴灉.jpg
    杈撳叆锛
    锛1锛 HeartB1锛孊OOL 鍨嬶紝瑕佹娴嬬殑鑴夊啿淇″彿 1銆
    锛2锛 HeartB2锛孊OOL 鍨嬶紝瑕佹娴嬬殑鑴夊啿淇″彿 2銆
    锛3锛 HeartB3锛孊OOL 鍨嬶紝瑕佹娴嬬殑鑴夊啿淇″彿 3銆
    锛4锛 HeartB4锛孊OOL 鍨嬶紝瑕佹娴嬬殑鑴夊啿淇″彿 4銆
    杈撳嚭锛
    锛1锛 ALLUp锛孊OOL 鍨嬶紝杈撳嚭妫娴嬬粨鏋滅殑淇″彿銆
    锛2锛 HB_Send锛孊OOL 鍨嬶紝鍔熻兘鍧楁湰韬殑鑴夊啿淇″彿銆
    锛3锛 HBTime_1锛孶SINT 鍨嬶紝瀵逛簬淇″彿 1 鐨勭▼搴忓惊鐜鏁板櫒锛屽綋鏈鏁板櫒鐨勫煎ぇ浜 150 鏃 ALLUp 杈撳嚭涓 FALSE锛屽惁鍒欎负 TRUE銆
    锛4锛 HBTime_2锛孶SINT 鍨嬶紝瀵逛簬淇″彿 2 鐨勭▼搴忓惊鐜鏁板櫒锛屽綋鏈鏁板櫒鐨勫煎ぇ浜 150 鏃 ALLUp 杈撳嚭涓 FALSE锛屽惁鍒欎负 TRUE銆
    锛5锛 HBTime_3锛孶SINT 鍨嬶紝瀵逛簬淇″彿 3 鐨勭▼搴忓惊鐜鏁板櫒锛屽綋鏈鏁板櫒鐨勫煎ぇ浜 150 鏃 ALLUp 杈撳嚭涓 FALSE锛屽惁鍒欎负 TRUE銆
    锛6锛 HBTime_4锛孶SINT 鍨嬶紝瀵逛簬淇″彿 4 鐨勭▼搴忓惊鐜鏁板櫒锛屽綋鏈鏁板櫒鐨勫煎ぇ浜 150 鏃 ALLUp 杈撳嚭涓 FALSE锛屽惁鍒欎负 TRUE銆
    鍏HW
    HW 搴撲篃灏辨槸鎸囩殑鏄湪 hw_n.lib 鏂囦欢涓殑涓浜涘姛鑳藉潡銆
    6.1 CONFIGURE_PI鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    鑴夊啿杈撳叆璁剧疆锛屽畠鏄氳繃姣旇緝 A锛孊 涓や釜閫氶亾杈撳叆鐨勮剦鍐蹭俊鍙锋潵缁欏嚭涓涓杞垨鍙嶈浆鐨勬暟鍊笺
    濡傛灉鍙绠楀崟鑴夊啿杈撳叆锛孋ONFIGURE_PI 鐨 CHANNEL A 绛変簬鐩稿簲鐨勫硷紝CHANNEL B
    鐨勫艰缃负 16銆傚鏋滄槸瑕佽绠楁鍙嶈浆锛孉 鐩歌緭鍏ュ拰 B 鐩歌緭鍏ョ浉浣嶅樊 90 搴︼紝鍒 CHANNEL A鍜 CHANNEL B 鐨勫肩瓑浜庣浉搴旂殑 CHANNEL 鍊笺傚瘎瀛樺櫒鍦板潃 IW130~IW137銆両W150~IW157鐨勫煎瓨鏀剧殑鏄鐨勫硷紝IW120~IW127銆両W160~IW167 瀛樻斁鐨勬槸璁℃暟鍊硷紝鍦 CODESYS 鑱旀満鐩戞帶鏃跺彧鏄剧ず A 鐩歌緭鍏ョ殑棰戠巼鍊笺
    楂橀熻剦鍐茶緭鍏ョ鑳藉妫娴嬬殑鏈楂橀鐜囧拰绋嬪簭鐨勫ぇ灏忔湁鍏筹紝褰撶▼搴忚秺澶э紝鍗崇▼搴忓惊鐜竴鍛
    闇瑕佺殑鏃堕棿瓒婇暱锛岃剦鍐茶緭鍏ョ鑳藉妫娴嬬殑棰戠巼灏辫秺浣庛傚綋瀹為檯鐨勮緭鍏ラ鐜囪秴杩囨帶鍒跺櫒鑳藉妫
    娴嬬殑鏈澶ч鐜囧垯鍦ㄧ浉搴旂殑瀵勫瓨鍣ㄩ噷鐨勯鐜囧煎拰鏋佹暟鍊煎氨浼氫笉鍑嗙‘銆傚綋璋冪敤RESET_PI鍑芥暟鏃
    褰撶浉搴旂殑鍙傛暟鍊煎氨鏄疌HANNEL A鐨勫兼椂锛岀浉搴旂殑璁℃暟鍊煎氨褰掗浂銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (1)_缁撴灉.jpg

    杈撳叆锛

    锛1锛堿,BYTE鍨嬶紝閫氶亾A锛屽嵆杈撳叆淇″彿鐨勯氶亾鍙枫
    锛2锛塀,BYTE鍨嬶紝閫氶亾B锛屽嵆杈撳叆淇″彿鐨勯氶亾鍙枫
    6.2   GET-TUPLE鍑芥暟
    鍔熻兘鎻忚堪锛
    杩欐槸涓涓郴缁熶繚鐣欏嚱鏁般傛槸涓涓狿OINTER TO BYTE鍨嬪嚱鏁般
    鍑芥暟鍥惧涓嬶細
    640 (2)_缁撴灉.jpg
    杈撳叆锛
    锛1锛 ID锛孊YTE鍨嬶紝瑕侀夋嫨鐨凾UPLE鐨勫彿銆
    锛2锛 Selection锛孊OOL鍨嬶紝褰撲负TRUE鏃讹紝鏄夋嫨TUP LE Set boot锛屽綋涓篢RUE鏃讹紝鏄
    閫夋嫨Application銆
    6.3 LOAD_USER_PROGRAM鍑芥暟
    鍔熻兘鎻忚堪锛氭湰鍑芥暟鏄疊OOL鍨嬬殑銆
    鍑芥暟鍥惧涓嬶細
    640 (3)_缁撴灉.jpg
    杈撳叆锛
    锛1锛 Dummy锛孊OOL鍨嬶紝
    6.4 PARAMS_STORE鍑芥暟
    鍔熻兘鎻忚堪锛
    瀛樺偍鍙傛暟MW0~MW247锛岀郴缁熸瘡闅100s淇濆瓨涓娆″弬鏁板埌瀛樺偍鍣ㄣ傛湰鍑芥暟鏄疊OOL鍨嬬殑銆
    鍑芥暟鍥惧涓嬶細
    640 (4)_缁撴灉.jpg
    杈撳叆锛

    锛1锛 ENABLE锛孊OOL 鍨嬶紝浣胯兘銆

    6.5 RESET_PI鍑芥暟
    鍔熻兘鎻忚堪锛
       鑴夊啿杈撳叆璁℃暟澶嶄綅銆傚姛鑳芥槸鎶婅剦鍐茶緭鍏ヨ鏁板櫒缃浂锛岃蒋杩炴帴鍙H鎺ユ墍瑕佸浣嶇殑閫氶亾鍙枫
    濡傛灉瑕佺敤B閫氶亾鑴夊啿涓婂崌娌垮浣岮閫氶亾鐨勮剦鍐茶鏁板硷紙鎴栫敤A鑴夊啿鐨勪笂鍗囨部澶嶄綅B閫氶亾鐨勮鏁
    鍊硷級锛屽垯CH鐨勬暟鍊煎涓嬪叕寮忔墍绀猴細
    CH=(Restting channel number+1)*16+Channel to reset
    鍑芥暟鍥惧涓嬶細
    640 (5)_缁撴灉.jpg
    杈撳叆锛
    锛1锛塁H,BYTE鍨嬶紝瑕佸浣嶉氶亾銆
    6.6    SET-AI-TYPE 鍑芥暟
    鍔熻兘鎻忚堪锛
    璁剧疆妯℃嫙閲忚緭鍏ョ涓虹數绔緭鍏ャ傛湰鍑芥暟鏄疊OOL鍨嬬殑銆
    2023妯℃澘鐨勶紙X3.7鍜孹3.10锛夎剼閫氳繃姝ゆ柟娉曟病鏈夊姙娉曡缃紝鍙互閫氳繃濡備笅鏂规硶灏嗘鑴氭敼涓虹數娴佽緭鍏AR
    PPOINTER TO WORD锛
    P3:WORD;
    VAR-END
    PP:=16#FFC4
    PP:=P3OR16#2000;(*閫夋嫨鐢佃剳杈撳叆*锛
      PP:=P3AND16#DFFF;(*閫夋嫨鐢靛帇杈撳叆*锛
    鍑芥暟濡傚浘锛
    640 (6)_缁撴灉.jpg
    杈撳叆锛
    锛1锛 Value锛孊YTE鍨嬶紝閫氳繃Va lue鐨勮緭鍏ユ潵璁惧畾杈撳叆閽堟槸鐢靛帇杈撳叆杩樻槸鐢垫祦杈撳叆銆
    6.7 SET_CYCLE_TIME鍑芥暟
    鍔熻兘鎻忚堪锛
    瀹冩槸涓涓郴缁熶繚鐣欏嚱鏁帮紝鏄竴涓狟OOL鍨嬬殑鍑芥暟銆
    鍑芥暟鍥惧涓嬶細
    640 (7)_缁撴灉.jpg
    杈撳叆锛
    锛1锛 Ctime锛學ORD鍨嬨
    6.8 SET_PWM_F鍑芥暟
    鍔熻兘鎻忚堪锛
    Set PWM frequency 妯″潡鐢ㄤ簬璁剧疆杈撳嚭 PWM 淇″彿鐨勯鐜.鍙棰戠巼鑼冨洿浠 40 鍒2550 Hz銆侳REQ 涓哄疄闄呯殑杈撳嚭棰戠巼闄や互 10锛孋H 鏄渶瑕佽缃浉搴旈鐜囩殑閫氶亾锛堢浉搴旂殑 PWM杈撳嚭鐨勫湴鍧鍙峰噺鍘 100锛夈傚鏋滈氶亾鏄湪鍚屼竴缁勯噷锛屽彧瑕佽缃叾涓竴涓殑 PWM 杈撳嚭鐨勯氶亾鍙风殑棰戠巼锛屽叾浣欑殑閫氶亾鐨勯鐜囦篃鏄拰鍏朵竴鏍枫
      涓鑸皢绯荤粺纭欢鍒濆鍖栬缃浉鍏崇殑绋嬪簭鏀惧湪绋嬪簭鐨勫垵濮嬪寲绋嬪簭娈碉紙鍙槸鍦ㄧ郴缁熶笂鐢电灛闂存墽琛屼竴娆★級閲屻
    鍑芥暟鍥惧涓嬶細
    640 (8)_缁撴灉.jpg
    杈撳叆
    锛1锛 FREQ锛孊YTE鍨嬶紝涓哄疄闄呯殑杈撳嚭棰戠巼闄や互10銆
    锛2锛 CH锛孊YTE鍨嬶紝CH鏄渶瑕佽缃浉搴旈鐜囩殑閫氶亾鍙凤紙鐩稿簲鐨凱WM杈撳嚭鐨勫湴鍧鍙风爜鍑忓幓100锛夈
    6.9 TEMPERATURES鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    璁$畻妯″潡鐨勬俯搴︼紝Temperature 鍔熻兘妯″潡鏈変袱璺姤璀﹁緭鍑 (TEMP 1 and TEMP 2)涓璺ā鎷熼噺杈撳嚭(AD_TEMP) 锛屽彲閫氳繃涓嬭堪鍏紡璁$畻娓╁害鍊笺傝繕鏈変竴璺疄闄呯殑娓╁害鍊艰緭鍑(TEMP)銆俠it_per_deg = 81,263 bit_offset = 5,177 * 103
    temperature = (AD_TEMP - bit_offset) / bit_per_deg
    Examble:
    AD_TEMP = 8470
    tempereture = (8470 - 5,177 * 103) / 81,263 = 40,519 掳C
       鐩墠 2023 妯″潡娌℃湁妫娴嬫俯搴︾殑鍔熻兘锛2024 鏈夛紝浣嗘槸涓嶈兘鐢ㄧ洰鍓嶇殑鍑芥暟璁$畻锛屽彲浠ユ寜鐓т互涓嬫柟娉曡绠 2024 妯″潡鐨勬俯搴︼細
    Temperature:=DINT_TO_INT(((UINT_TO_DINT(%IW115)*8060)/65535-636)/10);
    鍑芥暟鍥惧涓嬶細
    640 (9)_缁撴灉.jpg
    杈撳嚭锛
    锛1锛 TEMP1锛孊OOL鍨嬶紝褰撴俯搴﹁秴杩73掳C鏄緭鍑轰负TRUE銆
    锛2锛 TEMP2锛孊OOL鍨嬶紝褰撴俯搴︿綆浜-40掳C鏄緭鍑轰负TRUE銆
    锛3锛 AD_TEMP锛學ORD鍨嬶紝妯℃嫙淇″彿杈撳嚭锛屽彲閫氳繃涓婇潰鍏紡璁$畻瀹為檯娓╁害鍊笺
    锛4锛 TEMP锛孲INT鍨嬶紝杈撳嚭鐨勫疄闄呮俯搴﹀笺
    6.9 TEST_PARAM_PARITY鍑芥暟
    鍔熻兘鎻忚堪锛
    娴嬭瘯鍐欏叆鐨勫弬鏁帮紝鏄竴涓狟OOL鍨嬬殑鍑芥暟銆
    鍑芥暟鍥惧涓嬶細
    640 (10)_缁撴灉.jpg
    杈撳叆锛
    锛1锛 ENABLE锛孊OOL鍨嬶紝浣胯兘銆
    6.10 USER_FUNCTION鍑芥暟
    鍔熻兘鎻忚堪锛
    鏈嚱鏁颁篃鏄竴涓郴缁熶繚鐣欑殑鍑芥暟銆
    鍑芥暟濡傚浘锛
    640 (11)_缁撴灉.jpg
    杈撳叆锛氾紙1锛塂umm鏈夛紝BOOL鍨嬨
    CheckFault鍔熻兘鍧                                                                                                      
    鍔熻兘鎻忚堪锛
    妫娴嬭緭鍏ユ槸鍚︽湁閿欒銆備簨瀹炰笂鏈姛鑳藉潡鏄疢otion鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼
    鍔熻兘鍥惧涓嬶細
    640 (12)_缁撴灉.jpg
    杈撳叆锛
    锛1锛 Control锛孖NT鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛2锛 FeedBacl锛孶INT鍨嬶紝姣斾緥闃鍙嶉杈撳叆0~65535锛屽搴旂殑鐢垫祦涓0~1瀹夊煿銆
    杈撳嚭锛
    锛1锛 DO_FaultInDirUp锛孊OOL鍨嬶紝
    锛2锛 DO_FaultInDirDown锛孊OOL鍨嬶紝

    鎵撹祻榧撳姳涓涓嬶紒
    +10
    鍥炲

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2021-3-5 22:15 , Processed in 0.201599 second(s), 64 queries .

    閰峰痉缃

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

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