ST寰幆璇彞for,while,repeat缂栫▼瀹炰緥-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 200|鍥炲: 0

ST寰幆璇彞for,while,repeat缂栫▼瀹炰緥

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2024-11-5 21:08:09 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    ST缂栫▼-寰幆璇彞FOR/WHILE/REPEAT璇彞鐢

    1. FOR璇彞
    鈶犲叧閿瓧FOR
    鈶OR寰幆鍙互缂栧啓澶勭悊閲嶅閫昏緫銆
    鈶㈣娉曡〃杈
    FOR i:=璧峰鍊(鏁存暟) TO 缁撴潫鍊(鏁存暟) BY {姝ラ暱( 鏁存暟)} DO
    {璇彞;}
    END_FOR
    鈶OR璇彞鎵ц閫昏緫鍥撅細
    142558b6zy00hifmgh0xsr.png
    鎻愮ず锛
    {}鍙渷鐣,鐪佺暐榛樿姝ラ暱涓姣忛儴閫掑鎴栭掑噺1锛
    鈶OR璇彞搴旂敤浜庡惊鐜鏁版湁闄愮殑寰幆锛
    鈶OR寰幆娆℃暟杩囧ぇ浼氬鍔犵▼搴忔壂鎻忔椂闂
    鈶璇彞;}鍙湁涓鏉¤鍙ユ椂锛寋}鍙渷鐣

    FOR浣跨敤瀹炰緥
    141657cic6g6qqic2515w2.png



    2. WHILE璇彞
    鈶犲叧閿瓧WHILE
    鈶HILE 寰幆锛屽彲浠ョ紪鍐欏鐞嗛噸澶嶉昏緫銆
    鈶㈣娉曡〃杈
    WHILE 鐪熷亣閫昏緫琛ㄨ揪寮廌O
    璇彞;
    END_WHILE;
    鈶HILE璇彞鎵ц閫昏緫鍥撅細
    142559jkwdtam0ka5jjjp9.png
    鎻愮ず锛
    WHILE璇彞搴旂敤浜庡惊鐜鏁颁笉纭畾鐨勫惊鐜紱
    鈶″垽鏂潯浠跺彲鐢ㄤ换鎰忕湡鍋囬昏緫琛ㄨ揪寮
    鈶㈢湡鍋囬昏緫琛ㄨ揪寮忎竴鐩翠负鐪燂紝浼氳繘鍏ユ寰幆锛
      缂栫▼鏃跺簲閬垮厤姝诲惊鐜
    WHILE浣跨敤瀹炰緥
    141657w6gm4e4ggzg4ekwm.png

    3. REPEAT璇彞
    鍏抽敭瀛桼EPEAT锛孯EPEAT 寰幆鏉′欢鏄湪寰幆鎸囦护鎵ц鍚庢墠妫鏌ョ殑锛屽嵆涓嶇寰幆鏉′欢鍙栧煎浣曪紝寰幆鑷冲皯鎵ц涓娆★紱

    鈶犲叧閿瓧REPEAT
    鈶¢氳繃REPEAT寰幆锛屽彲浠ョ紪鍐欏鐞嗛噸澶嶉昏緫銆
    鈶㈣娉曡〃杈
    REPEAT
    璇彞;
    UNTIL 鐪熷亣閫昏緫琛ㄨ揪寮
    END_REPEAT;
    鈶EPEAT璇彞鎵ц閫昏緫鍥撅細
    142559i1u8u1w7eb3dklqe.png

    鎻愮ず锛
    鈶燫EPEAT璇彞搴旂敤浜庡惊鐜鏁颁笉纭畾鐨勫惊鐜紱
    鈶″惊鐜嚦灏戜細鎵ц涓娆
    鈶㈠垽鏂潯浠跺彲鐢ㄤ换鎰忕湡鍋囬昏緫琛ㄨ揪寮
    鈶g湡鍋囬昏緫琛ㄨ揪寮忎竴鐩翠负鐪燂紝浼氳繘鍏ユ寰幆锛
      缂栫▼鏃跺簲閬垮厤姝诲惊鐜

    REPEAT浣跨敤瀹炰緥
    141657p0ap2eykn8aay9x3.png [size=0.83em]repeat.png (22.25 KB, 涓嬭浇娆℃暟: 2018)
    涓嬭浇闄勪欢
    [color=rgb(204, 204, 204) !important]2020-2-24 14:16 涓婁紶






    娓稿锛屽鏋滄偍瑕佹煡鐪嬫湰甯栭殣钘忓唴瀹硅鍥炲
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2025-1-23 05:54 , Processed in 0.159854 second(s), 60 queries .

    閰峰痉缃

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

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