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

ST缂栫▼-寰幆璇彞IF/CASE璇彞鐢ㄦ硶

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2024-11-5 21:07:19 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    ST缂栫▼-寰幆璇彞IF/CASE璇彞鐢
    1. IF璇彞
    鈶犲叧閿瓧IF
    鈶″垽鏂墽琛屾潯浠讹紝鏍规嵁鎵ц鏉′欢锛屾墽琛岀浉搴旂殑鎸囦护

    鈶㈣娉曡〃杈
    IF   鐪熷亣閫昏緫琛ㄨ揪寮1 THEN  
    璇彞1;
    ELSE
    璇彞3;
    END_IF
    鎻愮ず
    鈶犵孩鑹查儴鍒嗗彲浠ョ渷鎺夛紱
    瀵逛簬澶氫釜鏉′欢鏃讹紝涔熷彲浠ュ啓鎴愶細
    IF   鐪熷亣閫昏緫琛ㄨ揪寮1 THEN  
    璇彞1;
    ELSIF 鐪熷亣閫昏緫琛ㄨ揪寮2 THEN
    璇彞2;
    鈥︹
    ELSIF 鐪熷亣閫昏緫琛ㄨ揪寮n THEN
    璇彞n;
    ELSE
    璇彞3;
    END_IF
    鈶F璇彞鎵ц閫昏緫鍥撅細
    143710wr0yqqqqhvh4qrhv.png
    IF搴旂敤瀹炰緥
    143710x9rvabyb09eiy096.png

    2. CASE璇彞
    鈶犲叧閿瓧CASE
    鈶″垽鏂拰鏉′欢鍙橀噺鍖归厤鎯呭喌澶勭悊瀵瑰簲鐨勫懡浠
    鈶㈣娉曡〃杈
    CASE 鐪熷亣閫昏緫琛ㄨ揪寮廜F
    Val1:璇彞1;
    Val2:璇彞2;
    Val3,Val4:璇彞3;
    Val6,Val7..Val10:璇彞4;
    Valn:璇彞n;
    ...
    ELSE 璇彞5;
    END_CASE;
    鈶ASE璇彞鎵ц閫昏緫锛
    143710r8x8f83yf14qyu65.png
    鎻愮ず锛
    鈶犳潯浠跺彉閲忓彧鑳芥槸鏁存暟Val鍙兘鏄暣鏁
    鈶$浉鍚岃〃杈惧紡锛屽涓笉鍚屽彉閲Val涔嬮棿鐢ㄥ垎鍙烽殧寮
    鈶㈢浉鍚岃〃杈惧紡锛屽涓笉鍚岃繛缁彉閲Val涔嬮棿鐢..闅斿紑file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps69D4.tmp.png
    CASE搴旂敤
    143711gszoz99qqpd6so3z.png
    娓稿锛屽鏋滄偍瑕佹煡鐪嬫湰甯栭殣钘忓唴瀹硅鍥炲
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

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

    閰峰痉缃

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

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