濡備綍鐢⊿T璇█鍐欎竴涓鍔熻兘寮鍏虫帶鍒剁▼搴忥紙闄勮禒妗堜緥绋嬪簭锛-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 143|鍥炲: 0

濡備綍鐢⊿T璇█鍐欎竴涓鍔熻兘寮鍏虫帶鍒剁▼搴忥紙闄勮禒妗堜緥绋嬪簭锛

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

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

    鍙戣〃浜 2024-8-30 15:54:59 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    鍦ㄩ」鐩紑鍙戣繃绋嬩腑锛岄毦鍏嶄細閬囧埌闂ㄨ锛堝畨鍏ㄩ棬锛夋帶鍒躲佹満鍣ㄧ姸鎬佸垏鎹€佸畾鏃朵换鍔°佺敤鎴风晫闈氦浜掔瓑绛夋儏鍐碉紝閭d箞缂栧啓涓涓帶鍒跺姛鑳藉潡灏辫兘鏂逛究鍦拌В鍐抽棶棰樸

    鎺у埗瑕佹眰锛
    • 杈圭紭瑙﹀彂涓庣姸鎬佸垏鎹細褰揗ode鍙橀噺涓篎ALSE鏃讹紝濡傛灉IN杈撳叆寮曡剼妫娴嬪埌涓涓笂鍗囨部锛堝嵆浠嶧ALSE鍙樹负TRUE锛夛紝杈撳嚭Q灏嗙洿鎺ヨ璁剧疆涓篢RUE銆傝屽綋Mode涓篢RUE鏃讹紝鍚屾牱鐨勪笂鍗囨部灏嗗鑷碤杈撳嚭鐨勭姸鎬佸彂鐢熷垏鎹紝鍗充粠TRUE鍙樹负FALSE鎴栧弽涔嬨

    • 璁剧疆淇″彿锛氫竴鏃ET杈撳叆鍙橀噺琚疆涓篢RUE锛岃緭鍑篞灏嗙珛鍗宠璁剧疆涓篢RUE銆

    • 瓒呮椂鑷姩澶嶄綅锛氬鏋淭imeout鍙橀噺琚祴浜堜簡涓涓潪闆剁殑鏃堕棿鍊硷紝閭d箞鍦ㄨ鏃堕棿鍊煎埌鏈熷悗锛岃緭鍑篞灏嗚嚜鍔ㄨ澶嶄綅涓篎ALSE銆

    • 澶嶄綅淇″彿锛歊ST杈撳叆鍙橀噺涓鏃﹁缃负TRUE锛岃緭鍑篞灏嗙珛鍗宠缃负FALSE銆



    鍔熻兘鍧楃▼搴忥細
    [AppleScript] 绾枃鏈煡鐪 澶嶅埗浠g爜
    //鍙橀噺澹版槑
    VAR_INPUT CONSTANT
      Mode : BOOL;
      Timeout : TIME;
    END_VAR
    VAR_INPUT
      IN,SET,RST : BOOL;
    END_VAR
    VAR_OUTPUT
      Q : BOOL;
    END_VAR
    VAR
      Ton1 : TON;
      Edge: BOOL;
    END_VAR
    
    
    // 濡傛灉Ton1.Q锛屽垯灏哘璁剧疆涓篎ALSE  
    IF Ton1.Q THEN 
      Q := FALSE; 
    END_IF;
    
    // 濡傛灉RST锛堝浣嶏級淇″彿涓1锛屽垯灏哘璁剧疆涓篎ALSE
    IF RST THEN
      Q := FALSE;
    ELSIF SET THEN// 濡傛灉SET淇″彿涓1锛屽垯灏哘璁剧疆涓篢RUE    
      Q := TRUE;
      
    //濡傛灉IN涓1涓擡dge涓0锛屽垯鏍规嵁Mode鐨勫兼潵鍒囨崲鎴栬缃甉鐨勫 
    ELSIF IN AND NOT Edge THEN  
      IF Mode THEN 
        q := NOT Q; 
      ELSE 
        q := TRUE; 
      END_IF;
    END_IF;
    
    // 鏇存柊Edge鍙橀噺鐨勫间负IN鐨勫綋鍓嶅硷紝鐢ㄤ簬涓嬩竴娆℃娴婭N鐨勫彉鍖
    Edge := IN;
    // 濡傛灉timeout鐨勫煎ぇ浜0绉掞紙鍗筹紝濡傛灉璁剧疆浜嗚秴鏃舵椂闂达級锛屽垯璋冪敤Ton1鍑芥暟锛屽皢Q鐨勫间綔涓鸿緭鍏ワ紝骞惰缃秴鏃舵椂闂  
    IF Timeout > T#0S THEN 
      Ton1(in := Q, PT := Timeout); 
    END_IF;


    640?wx_fmt=png&from=appmsg.jpg
    涓婅堪鍔熻兘鍧楅傜敤浜庨渶瑕佹牴鎹閮ㄤ俊鍙峰彉鍖栨潵鎺у埗杈撳嚭鐘舵佺殑鍦烘櫙锛岀壒鍒槸鍦ㄩ渶瑕佽竟缂樿Е鍙戙佺姸鎬佸垏鎹€佽秴鏃惰嚜鍔ㄥ浣嶅拰蹇熷搷搴斿浣嶄俊鍙风殑鎺у埗閫昏緫涓


    CONTROLLER.project

    150.67 KB, 涓嬭浇娆℃暟: 2, 涓嬭浇绉垎: 閰峰竵 -1

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

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2024-11-23 20:36 , Processed in 0.162503 second(s), 60 queries .

    閰峰痉缃

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

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