Codesys鈥斺旀眰鏁扮粍涓殑鏈澶ф渶灏忓硷紙for璇彞锛-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 1007|鍥炲: 1

Codesys鈥斺旀眰鏁扮粍涓殑鏈澶ф渶灏忓硷紙for璇彞锛

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2023-11-22 16:04:23 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    浠ヤ笅鍐呭绾睘涓汉鐞嗚В锛屽鏈夐敊璇杩庢寚姝c
    鏈瘒涓昏鏄叧浜庢眹宸漇T缂栫▼锛宖or璇彞鐨勪竴涓皬妗堜緥锛屾槸姹傚嚭鏁扮粍涓殑鏈澶ф渶灏忓肩殑涓涓皬绋嬪簭銆
    棣栧厛绠鍗曡鏄庝竴涓嬶紝濡備綍瀹氫箟鏁扮粍鍨嬪彉閲忋
    瀹氫箟涓缁存暟缁勭殑鎸囦护鏍煎紡濡備笅锛
    鏁扮粍鍚嶏細ARRAY[寮濮嬩笅鏍..缁撴潫涓嬫爣] OF 銆愭暟鎹被鍨嬨 锛

    涓句緥锛欰RY0: ARRAY[0..6] OF UINT :=[12,98,42,1,90,100,23];

    涓婅堪鐨勪緥瀛愪腑锛孉RY0涓烘暟缁勫悕锛屾暟缁勭殑寮濮嬩笅鏍囨槸0.缁撴潫涓嬫爣鏄6锛屼竴鍏变竷涓彉閲忋傛暟缁勭殑鍙橀噺绫诲瀷杩樺彲浠ユ槸real銆乄ord绛夈
    瀹氫箟浜岀淮涓夌淮鏁扮粍鐨勬渚嬪涓嬶細
    1. ARY1: ARRAY[0..2,0..3] OF REAL ;
    2. ARY2: ARRAY[0..6,0..2,0..3] OF WORD ;
    澶嶅埗浠g爜
    涓嬮潰鏄畬鏁翠唬鐮
    1. /********************鍙橀噺澹版槑************************/
    2. PROGRAM PLC_PRG
    3. VAR
    4.         ARY0: ARRAY[0..6] OF UINT :=[12,98,42,1,90,100,23];
    5.         //ARY1: ARRAY[0..2,0..3] OF REAL ;
    6.         //ARY2: ARRAY[0..6,0..2,0..3] OF WORD ;
    7.         ARY_MIN: UINT :=0;
    8.         ARY_MAX: UINT :=0;
    9.        
    10.         I: UINT;
    11. END_VAR
    12. /********************绋嬪簭缂栧啓************************/
    13. ARY_MIN := ARY0[0];
    14. ARY_MAX := ARY0[0];
    15. FOR I:=0 TO 6 BY 1 DO
    16.                 IF ARY0[I] > ARY_MAX THEN
    17.                         ARY_MAX := ARY0[I];
    18.                 END_IF;
    19.                 IF ARY0[I] < ARY_MIN THEN
    20.                         ARY_MIN := ARY0[I];
    21.                 END_IF
    22. END_FOR
    澶嶅埗浠g爜
    璋㈣阿澶у~
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

  • TA鐨勬瘡鏃ュ績鎯
    寮蹇
    2017-12-12 17:00
  • 绛惧埌澶╂暟: 1 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2023-11-29 12:36:58 | 鏄剧ず鍏ㄩ儴妤煎眰
    鎰熻阿鍒嗕韩锛岃阿璋
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鏉ヨ嚜瀹夊崜瀹㈡埛绔鏉ヨ嚜瀹夊崜瀹㈡埛绔
    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2024-11-23 20:14 , Processed in 0.144830 second(s), 56 queries .

    閰峰痉缃

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

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