銆怌ODESYS澶ц鍫傘慞WMControl搴-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6150鍙戝竷锝
鏌ョ湅: 1120|鍥炲: 1

銆怌ODESYS澶ц鍫傘慞WMControl搴

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

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

    鍙戣〃浜 2018-7-4 22:04:35 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    PWMContro搴撲篃灏辨槸鍦≒WMControlVoltageAmpere.lib鏂囦欢涓殑鍔熻兘鍧椼
    7.1 CheckFault鍔熻兘鍧
    鍔熻兘鎻忚堪锛
      妫娴嬭緭鍏ユ槸鍚︽湁閿欒銆備簨瀹炰笂鏈姛鑳藉潡鏄疢otion鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼
    鍔熻兘鍥惧涓嬶細
    640_缁撴灉.jpg
    杈撳叆锛
    锛3锛 Control锛孖NT鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛4锛 FeedBacl锛孶INT鍨嬶紝姣斾緥闃鍙嶉杈撳叆0~65535锛屽搴旂殑鐢垫祦涓0~1瀹夊煿銆
    杈撳嚭锛
    锛3锛 DO_FaultInDirUp锛孊OOL鍨嬶紝
    锛4锛 DO_FaultInDirDown锛孊OOL鍨嬶紝
    7.2 ControlMotionErrors鍔熻兘鍧
         鍔熻兘鎻忚堪锛氫簨瀹炰笂鏈姛鑳藉潡鏄疢otion鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼傜敤鏉ヨ緭鍑哄綋鍓嶉樆鎶楄繃楂樹笌杩囦綆鐨勬儏鍐点
    鍔熻兘鍧楀浘濡備笅锛
    640 (1)_缁撴灉.jpg
    杈撳叆锛
    锛1锛塁ontrol锛孖NT鍨嬶紝鎺у埗淇″彿杈撳叆绔紝-32767~+32767锛屼竴鑸负鎵嬫焺鏍囧畾鍚庣殑鍊笺
    锛2锛塒WM_Up锛孶INT鍨嬶紝涓婄敓绔殑PWM淇″彿銆
    锛3锛塒WM_Down锛孶INT鍨嬶紝涓嬮檷绔殑PWM淇″彿銆
    锛4锛塅eedBack锛孶INT鍨嬶紝姣斾緥闃鍙嶉杈撳叆0~65535锛屽搴旂殑鐢垫祦涓0~1瀹夊煿銆
    锛5锛塒AR_DirUpMaxCurrent锛孶INT鍨嬶紝姝e悜杈撳嚭鍏佽鏈澶у笺傚嵆姣斾緥闃鐨勬渶澶у紑鍚數娴併
    锛6锛塒AR_DirUpMinCurrent锛孶INT鍨嬶紝姝e悜杈撳嚭鍏佽鏈灏忓笺傚嵆姣斾緥闃鐨勬渶灏忓紑鍚數娴併
    锛7锛塒AR_DirDownMinCurrent锛孶INT鍨嬶紝璐熷悜杈撳嚭鍏佽鏈灏忓笺傚嵆姣斾緥闃鐨勬渶灏忓紑鍚數娴併
    锛8锛塒AR_DirDownMaxCurrent锛孶INT鍨嬶紝璐熷悜杈撳嚭鍏佽鏈澶у笺傚嵆姣斾緥闃鐨勬渶澶у紑鍚數娴併
    锛9锛塒AR_CoilResistance锛孶SINT鍨嬶紝绾垮湀鐢甸樆鍊笺
    锛10锛塒AR_SupplyVoltage锛孶SINT鍨嬶紝绯荤粺鐨勪緵鐢电數鍘嬨
    锛11锛塒AR_FaultOnDelay锛孶INT鍨嬶紝鍑洪敊寤舵椂锛0~65535ms銆
    锛12锛塒AR_PercentDifferencelnImpedance锛孶SINT鍨嬶紝瀹归敊鑼冨洿銆
    杈撳嚭锛
    锛1锛塂o_DirUpValveImpedanceTooHigh锛孊OOL 鍨嬶紝姝e悜鏃讹紝褰 impedance 楂樹簬
    锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    锛2锛塂o_DirUpValveImpedanceTooLow锛孊OOL 鍨嬶紝姝e悜鏃讹紝褰 impedance 浣庝簬
    锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    锛3锛塂o_DirDownValveImpedanceTooHigh锛孊OOL 鍨嬶紝璐熷悜鏃讹紝褰 impedance 楂樹簬
    锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    锛4锛塂o_DirDownValveImpedanceTooLow锛孊OOL 鍨嬶紝姝e悜鏃讹紝褰 impedance 浣庝簬
    锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌

    PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    7.3 EndAttenuation鍔熻兘鍧
    鍔熻兘鎻忚堪锛
         浜嬪疄涓婃湰鍔熻兘鍧楁槸Motion鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼
    鍔熻兘鍧楀涓嬪浘锛
    640 (2)_缁撴灉.jpg
    杈撳叆锛
    锛1锛塁ontrol锛孖NT鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛2锛塂I_LimitSwitchUp锛孊OOL鍨嬶紝姝e悜闄愪綅寮鍏筹紝涓篢RUE鏃舵ā鍧楄緭鍏ヤ负
    PAR_EndattenuationValue*Control/100%
    锛3锛塂I_LimitSwitchDown锛孊OOL鍨嬶紝璐熷悜闄愪綅寮鍏筹紝涓篢RUE鏃舵ā鍧楄緭鍏ヤ负
    PAR_EndattenuationValue*Control/100%
    锛4锛塒AR_EndattenuationValue锛孶INT鍨嬶紝闄愪綅鍙傛暟锛屽彇鍊艰寖鍥: 0 锝100 %
    锛5锛塃nable锛屼娇鑳姐
    杈撳嚭锛
    锛1锛 Output锛孖NT鍨嬨
    7.4 Motion鍔熻兘鍧
    鍔熻兘鎻忚堪锛
           Motion妯″潡涓昏鐢ㄤ簬鎺у埗姣斾緥闃锛屾湁涓よ矾PWM杈撳嚭锛屾帶鍒朵俊鍙疯寖鍥-32767 锝 32767锛屽綋鎺у埗淇″彿鍦0 锝32767锛 PWM Up 杈撳嚭锛屽 0锝32767锛涘綋鎺у埗淇″彿鍦0 锝-32767锛 PWMdown杈撳嚭锛屽 0锝32767銆傜敱鍙傛暟鎺у埗鏈澶ф渶灏忚緭鍑虹數娴佽寖鍥.
    鍔熻兘鍧楀浘濡備笅锛
    640 (3)_缁撴灉.jpg
    杈撳叆锛
    1锛塁ontrol锛孖NT鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛2锛塅eedBack锛屾瘮渚嬮榾鍙嶉杈撳叆0~65535锛屽搴旂殑鐢垫祦涓0~1瀹夊煿銆傚綋鍓嶆瘮渚嬮榾鐨勫弽棣堬紝鍙互鐩存帴灏嗘瘮渚嬮榾鐨勫湴绔帴鍏ユ帶鍒跺櫒鐨勬瘮渚嬮榾鍙嶉杈撳叆绔紙EPEC2024锛夛紝鐒跺悗灏嗗湴鍧瀹氫箟涓烘瘮渚嬮榾鍙嶉杈撳叆绔殑鍙傛暟浣滀负璇ュ弽棣堜俊鍙疯緭鍏ュ笺傛垨鑰呭皢姣斾緥闃鐨勫湴鐩存帴浜庢帶鍒跺櫒鐨勫湴鐩歌繛鎺ャ傜劧鍚庡皢鎺у埗鍣ㄧ殑杈撳嚭涔樹互2鍗冲彲銆傚洜涓烘瘮渚嬮榾鐨勬帶鍒朵俊鍙锋槸0~32767锛岃屾瘮渚嬮榾鐨勫弽棣堜俊鍙锋槸0~65535锛屾墍浠ュ皢姣斾緥闃鐨勮緭鍑哄间箻浠2銆
    锛3锛塂I_LimitSwitchUp锛孊OOL鍨嬶紝姝e悜闄愪綅寮鍏筹紝涓篢RUE鏃舵ā鍧楄緭鍏ヤ负PAR_EndattenuationValue*Control/100%
    锛4锛塂I_LimitSwitchDown锛孊OOL鍨嬶紝璐熷悜闄愪綅寮鍏筹紝涓篢RUE鏃舵ā鍧楄緭鍏ヤ负PAR_EndattenuationValue*Control/100%
    锛5锛塒AR_DirUpAecel锛孶SINT鍨嬶紝姝f柟鍚戣緭鍑哄姞閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿杈惧埌鐩稿簲鐨勮緭鍑哄笺
    锛6锛塒AR_DirUpDecel锛孶SINT鍨嬶紝姝f柟鍚戣緭鍑哄噺閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿杈撳嚭鍊间负0銆
    锛7锛塒AR_DirDownAccel锛孶SINT鍨嬶紝璐熸柟鍚戣緭鍑哄噺閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿杈惧埌鐩稿簲鐨勮緭鍑哄笺
    锛8锛塒AR_DirDownDecel锛孶SINT鍨嬶紝璐熸柟鍚戣緭鍑哄姞閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿杈撳嚭鍊间负0銆
    锛9锛塒AR_DirUpMaxCurrent锛孶INT鍨嬶紝姝e悜杈撳嚭鍏佽鏈澶у笺傚嵆姣斾緥闃鐨勬渶澶у紑鍚數娴併傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛10锛塒AR_DirUpMinCurrent锛孶INT鍨嬶紝姝e悜杈撳嚭鍏佽鏈灏忓笺傚嵆姣斾緥闃鐨勬渶灏忓紑鍚數娴併傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛11锛塒AR_DirDownMinCurrent锛孶INT鍨嬶紝璐熷悜杈撳嚭鍏佽鏈灏忓笺傚嵆姣斾緥闃鐨勬渶灏忓紑
    鍚數娴併傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛12锛塒AR_DirDownMaxCurrent锛孶INT鍨嬶紝璐熷悜杈撳嚭鍏佽鏈澶у笺傚嵆姣斾緥闃鐨勬渶澶у紑鍚數娴併傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛13锛塒AR_EndattenuationValue锛孶INT鍨嬶紝闄愪綅鍙傛暟锛屽彇鍊艰寖鍥: 0 锝100 %
    锛14锛塒AR_CoilResistance锛孶SINT鍨嬶紝绾垮湀鐢甸樆鍊笺
    锛15锛塒AR_SupplyVoltage锛孶SINT鍨嬶紝绯荤粺鐨勪緵鐢电數鍘嬨
    锛16锛塒AR_FaultOnDelay锛孶INT鍨嬶紝鍑洪敊寤舵椂锛0~65535ms銆
    锛17锛塒AR_PercentDifferencelnImpedance锛孶SINT鍨嬶紝瀹归敊鑼冨洿銆
    锛18锛塃NABLE锛孊OOL鍨嬶紝浣胯兘銆備娇鑳藉紑鍏筹紝涓 FALSE 鏃讹紝 DO_SupplyVoltage 涓篎ALSE锛岃緭鍑轰负闆躲
    杈撳嚭锛
    锛1锛塂o_SupplyVoltage锛孊OOL 鍨嬶紝褰 Enable 涓 TRUE 涓 control <>0 鏃讹紝涓篢RUE銆
    锛2锛塒WM_Up锛孶INT 鍨嬶紝姝e悜杈撳嚭锛屽彇鍊艰寖鍥: 0 锝 32767銆
    锛3锛塒WM_Down锛孶INT 鍨嬶紝璐熷悜杈撳嚭锛屽彇鍊艰寖鍥: 0 锝 32767銆
    (4) Do_DirUpValveImpedanceTooHigh锛孊OOL 鍨嬶紝姝e悜鏃讹紝褰 impedance 楂樹簬锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    锛5锛塂o_DirUpValveImpedanceTooLow锛孊OOL 鍨嬶紝姝e悜鏃讹紝褰 impedance 浣庝簬
    锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    锛6锛塂o_DirDownValveImpedanceTooHigh锛孊OOL 鍨嬶紝璐熷悜鏃讹紝褰 impedance 楂樹簬
    锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    锛7锛塂o_DirDownValveImpedanceTooLow锛孊OOL 鍨嬶紝姝e悜鏃讹紝褰 impedance浣庝簬 锛圥AR_PercentDifferenceInImpedance*Impedance锛/100 涓斿欢鏃跺埌PAR_FaultnDelay 锛岃鍊间负 TRUE銆
    7.5 MotionControl 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
          浜嬪疄涓婃湰鍔熻兘鍧楁槸 Motion 鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼
    鍔熻兘鍧楀浘濡備笅锛
    640 (4)_缁撴灉.jpg
    杈撳叆锛
    锛1锛塁ontrol锛孖NT 鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛2锛塅eedBack锛屾瘮渚嬮榾鍙嶉杈撳叆 0~65535锛屽搴旂殑鐢垫祦涓 0~1 瀹夊煿銆
    锛3锛塒AR_DirUpMaxCurrent锛孶INT鍨嬶紝姝e悜杈撳嚭鍏佽鏈澶у笺傚嵆姣斾緥闃鐨勬渶澶у紑鍚
    鐢垫祦銆傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛4锛塒AR_DirUpMinCurrent锛孶INT鍨嬶紝姝e悜杈撳嚭鍏佽鏈灏忓笺傚嵆姣斾緥闃鐨勬渶灏忓紑鍚
    鐢垫祦銆傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛5锛塒AR_DirDownMinCurrent锛孶INT鍨嬶紝璐熷悜杈撳嚭鍏佽鏈灏忓笺傚嵆姣斾緥闃鐨勬渶灏忓紑
    鍚數娴併傜數娴0~1瀹夊煿鐩稿綋浜0~1000銆
    锛6锛塒AR_DirDownMaxCurrent锛孶INT 鍨嬶紝璐熷悜杈撳嚭鍏佽鏈澶у笺傚嵆姣斾緥闃鐨勬渶
    澶у紑鍚數娴併傜數娴 0~1 瀹夊煿鐩稿綋浜 0~1000銆
    锛7锛塒AR_CoilResistance锛孶SINT 鍨嬶紝绾垮湀鐢甸樆鍊笺
    杈撳嚭锛
    锛1锛塐utput锛孖NT 鍨嬨
    7.6 MotionControlVolt 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    浜嬪疄涓婃湰鍔熻兘鍧楁槸 Motion Volt 鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼
    鍔熻兘鍧楀浘濡備笅锛
    640 (5)_缁撴灉.jpg

    杈撳叆锛
    锛1锛塁ontrol锛孖NT 鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛2锛塒AR_DirUpMax锛孶INT 鍨嬶紝姝e悜杈撳嚭鏈澶у间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
    锛3锛塒AR_DirUpMin锛孶INT 鍨嬶紝姝e悜杈撳嚭鏈灏忓间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
    锛4锛塒AR_DirDownMax锛孶INT 鍨嬶紝璐熷悜杈撳嚭鏈澶у间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
    锛5锛塒AR_DirDownMin锛孶INT 鍨嬶紝璐熷悜杈撳嚭鏈灏忓间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
    杈撳嚭锛
    锛1锛塂o_SupplyVoltage锛孊OOL 鍨嬶紝褰 Enable 涓 TRUE 涓 control <>0 鏃讹紝涓
    TRUE銆
    锛2锛塐utput锛孖NT 鍨嬨
    7.7 MotionVolt 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    鏈ā鍧椾篃鐢ㄤ簬鎺у埗姣斾緥闃锛岃緭鍑 PWM 淇″彿锛屾帶鍒朵俊鍙锋潵鑷 joystickfilter 妯″潡
    (-32767 锝32767)銆 杈撳嚭涓 0 锝 32767銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (6)_缁撴灉.jpg
    杈撳叆锛
    锛1锛塁ontrol锛孖NT 鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
           锛2锛塂I_LimitSwitchUp锛孊OOL 鍨嬶紝姝e悜闄愪綅寮鍏筹紝涓 TRUE 鏃舵ā鍧楄緭鍏ヤ负
          PAR_EndattenuationValue*Control/100%
          锛3锛塂I_LimitSwitchDown锛孊OOL 鍨嬶紝璐熷悜闄愪綅寮鍏筹紝涓 TRUE 鏃舵ā鍧楄緭鍏ヤ负
        PAR_EndattenuationValue*Control/100%
         锛4锛塒AR_DirUpAecel锛孶SINT鍨嬶紝姝f柟鍚戣緭鍑哄姞閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿
          杈惧埌鐩稿簲鐨勮緭鍑哄笺
         锛5锛塒AR_DirUpDecel锛孶SINT鍨嬶紝姝f柟鍚戣緭鍑哄噺閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿
         杈撳嚭鍊间负0銆
        锛6锛塒AR_DirDownAccel锛孶SINT鍨嬶紝璐熸柟鍚戣緭鍑哄噺閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃
        闂磋揪鍒扮浉搴旂殑杈撳嚭鍊笺
        锛7锛塒AR_DirDownDecel锛孶SINT 鍨嬶紝璐熸柟鍚戣緭鍑哄姞閫熷害 0~255锛岀浉褰撲簬寤舵椂澶氶暱
        鏃堕棿杈撳嚭鍊间负 0銆
       锛8锛塒AR_DirUpMax锛孶INT 鍨嬶紝姝e悜杈撳嚭鏈澶у间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
       锛9锛塒AR_DirUpMin锛孶INT 鍨嬶紝姝e悜杈撳嚭鏈灏忓间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
      锛10锛塒AR_DirDownMax锛孶INT 鍨嬶紝璐熷悜杈撳嚭鏈澶у间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
      锛11锛塒AR_DirDownMin锛孶INT 鍨嬶紝璐熷悜杈撳嚭鏈灏忓间负 PWM 鐨勭櫨鍒嗘瘮锛0~100%
      锛12锛塒AR_EndattenuationValue锛孶INT 鍨嬶紝闄愪綅鍙傛暟锛屽彇鍊艰寖鍥: 0 锝100 %
      锛13锛塃NABLE锛孊OOL 鍨嬶紝浣胯兘銆備娇鑳藉紑鍏筹紝涓 FALSE 鏃讹紝 DO_SupplyVoltage
       涓 FALSE锛岃緭鍑轰负闆躲
    杈撳嚭锛
    锛1锛塂o_SupplyVoltage锛孊OOL 鍨嬶紝褰 Enable 涓 TRUE 涓 control <>0 鏃讹紝涓
    TRUE銆
    锛2锛塒WM_Out锛孶INT 鍨嬶紝杈撳嚭涓 0 锝 32767銆
    7.8 Smooth 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
         浜嬪疄涓婃湰鍔熻兘鍧楁槸 Motion 鍔熻兘鍧楃殑涓涓瓙鍔熻兘鍧椼
    鍔熻兘鍧楀涓嬪浘锛
    640 (7)_缁撴灉.jpg
    杈撳叆锛
    锛1锛塁ontrol锛孖NT 鍨嬶紝杈撳叆鐨勬帶鍒朵俊鍙枫傚彇鍊艰寖鍥达紝 -32767 锝 32767銆
    锛2锛塒AR_DirUpAecel锛孶SINT鍨嬶紝姝f柟鍚戣緭鍑哄姞閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿
    杈惧埌鐩稿簲鐨勮緭鍑哄笺
    锛3锛塒AR_DirUpDecel锛孶SINT鍨嬶紝姝f柟鍚戣緭鍑哄噺閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃堕棿
    杈撳嚭鍊间负0銆
    锛4锛塒AR_DirDownAccel锛孶SINT鍨嬶紝璐熸柟鍚戣緭鍑哄噺閫熷害0~255锛岀浉褰撲簬寤舵椂澶氶暱鏃
    闂磋揪鍒扮浉搴旂殑杈撳嚭鍊笺
    锛5锛塒AR_DirDownDecel锛孶SINT 鍨嬶紝璐熸柟鍚戣緭鍑哄姞閫熷害 0~255锛岀浉褰撲簬寤舵椂澶氶暱
    鏃堕棿杈撳嚭鍊间负 0銆
    杈撳嚭锛
    锛1锛塐utput锛孖NT 鍨嬨
    涓銆佹爣鍑嗗簱鍑芥暟 Standard Library
    鏍囧噯搴撳嚱鏁板氨鏄 STANDARD.LIB 涓殑涓浜涘父鐢ㄧ殑鍑芥暟銆
    1. 1 鍙岀ǔ鍔熻兘鍧 Bistable Function Blocks
    1.1.1 SR 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
         鏈姛鑳藉潡鏄鍙橀噺杩涜缃綅涓庡浣嶃備篃灏辨槸璇寸瓑鍚屼笌 PLC 涓殑 SET 涓 RESET 鍛戒护銆
    褰 SET1 涓 TRUE 鏄垯杈撳嚭 Q1 缃綅锛屽间负 TRUE 骞朵繚鎸併傚綋 RESET 涓 TRUE 鏃跺浣嶏紝鍊
    涓 FALSE 骞朵繚鎸併傛敞鎰忥細褰 SET1 涓 RESET 鍚屾椂涓 TRUE 鏃惰緭鍑轰负 FALSE銆傦紙RS 鍔熻兘鍧
    姝ゆ椂涓 TRUE锛
    鍔熻兘鍧楀涓嬪浘锛
    640 (8)_缁撴灉.jpg
    杈撳叆锛 SET1锛孊OOL 鍨
    RESET锛孊OOL 鍨
    杈撳嚭锛 Q1锛孊OOL 鍨
    1.1.2 RS 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
         鏈姛鑳藉潡鐨勪富瑕佸姛鑳藉悓 SR 鍧椼備篃鏄敤鏉ュ疄鐜扮疆浣嶄笌澶嶄綅鐨勫姛鑳姐傚綋 SET 涓 TRUE 鏄
    鍒欒緭鍑 Q1 缃綅锛屽间负 TRUE 骞朵繚鎸併傚綋 RESET1 涓 TRUE 鏃跺浣嶏紝鍊间负 FALSE 骞朵繚鎸併
    娉ㄦ剰锛氬綋 SET 涓 RESET1 鍚屾椂涓虹湡鏃惰緭鍑轰负 TRUE銆傦紙SR 鍔熻兘鍧楁鏃朵负 FALSE锛
    鍔熻兘鍧楀涓嬪浘锛
    640 (9)_缁撴灉.jpg
    杈撳叆锛 SET锛孊OOL 鍨
    RESET1锛孊OOL 鍨
    杈撳嚭锛 Q1锛孊OOL 鍨
    1.1.3 SEMA 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
        鏈姛鑳藉潡鐨勪富瑕佸姛鑳藉悓SR鍧椼備篃鏄敤鏉ュ疄鐜扮疆浣嶄笌澶嶄綅鐨勫姛鑳姐傚綋CLAIM涓篢RUE鏃惰緭鍑轰负TRUE銆傚綋RELEASE涓篢RUE鏃惰緭鍑轰负FALSE銆傚綋涓よ呭悓鏄负TRUE鏄緭鍑轰负FALSE銆傛湰
    鍔熻兘鍧椾笌SR浠ュ強RS鍔熻兘鍧楃殑鏈澶х殑涓嶅悓灏辨槸鏈姛鑳藉潡鏄悓杩囦竴涓唴閮ㄥ彉閲廥鏉ヤ紶閫掑肩殑銆
    璇彞濡備笅锛
    BUSY := X;
    IF CLAIM THEN X:=TRUE;
    ELSE IF RELEASE THEN BUSY := FALSE; X:= FALSE;
    END_IF
    鍔熻兘鍧楀涓嬪浘锛
    640 (10)_缁撴灉.jpg
    杈撳叆锛 CLAIM锛孊OOL 鍨
    RELEASE锛孊OOL 鍨
    杈撳嚭锛 BUSY锛孊OOL 鍨
    1. 2 璁℃暟鍣ㄥ姛鑳藉潡 Counter
    1.2.1 CTD 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
        鏈姛鑳藉潡鏄嚜鍑忚鏁板櫒銆備篃灏辨槸璇村綋淇″彿鐢变綆鐢甸鍙樹负楂樼數棰戞椂杩涜鑷噺璁版暟銆傚叾涓
    CD 鏄緭鍏ヤ俊鍙凤紝LOAD 鏄垵濮嬪寲淇″彿锛屼篃灏辨槸璇村綋 LOAD 杈撳叆涓 TRUE 鏃跺姛鑳藉潡寮濮嬪伐
    浣溿侾V 鏄垵濮嬪寲璁版暟鍊硷紝涔熷氨涓婇氳繃 PV 鏉ュ垵濮嬪寲 CV 鐨勫笺傚綋姣忔湁涓涓緭鍏ヤ俊鍙锋椂锛屽垯
    CV 鍑忎竴锛岀洿鍒 CV 鍑忓埌 0 鏃惰緭鍑 Q 鏈夎緭鍑轰负 TRUE銆
    鍔熻兘鍧楀涓嬪浘
    640 (11)_缁撴灉.jpg
    杈撳叆锛
    CD,BOOL鍨
    LOAD锛孊OOL 鍨
    PV锛孖NT 鍨
    杈撳嚭锛歈锛孊OOL 鍨
    CV锛孖NT 鍨
    1.2.2 CTU 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    鏈姛鑳藉潡鏄嚜鍔犺鏁板櫒銆備篃灏辨槸璇村綋淇″彿鐢变綆鐢甸鍙樹负楂樼數棰戞椂杩涜鍔犱竴璁版暟銆傚叾涓
    CU 鏄緭鍏ヤ俊鍙凤紝RESET 鏄浣嶄俊鍙凤紝涔熷氨鏄褰 LOAD 杈撳叆涓 TRUE 鏃跺姛鑳藉潡澶嶄綅銆侰V
    鏄綋鏃惰鏁板笺傚綋姣忔湁涓涓緭鍏ヤ俊鍙锋椂锛屽垯 CV 鍔犱竴锛岀洿鍒 CV 鍔犲埌 CV=PV 鏃惰緭鍑 Q 鏈夎緭
    鍑轰负 TRUE銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (12)_缁撴灉.jpg
    杈撳叆锛 CU,BOOL鍨
    RESET锛孊OOL 鍨
    PV锛孖NT 鍨
    杈撳嚭锛歈锛孊OOL 鍨
    CV锛孖NT 鍨
    1.2.3 CTUD 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
         鏈姛鑳藉潡鏄竴涓彲浠ヨ繘琛岃嚜鍑忎篃鍙互杩涜鑷姞鐨勫姛鑳藉潡锛屼篃灏辨槸璇村畠鏁村悎浜嗗墠闈袱涓姛
    鑳藉潡鐨勫姛鑳姐傚綋杈撳叆鐢 CU銆丷ESET 鍙 PV锛屼篃灏辨槸璇村綋 RESET 鏈変竴涓俊鍙凤紝鍒 CV 浼氳鍒濆鍖栦负 0锛屾鏃跺姛鑳藉潡鏄敤浣滀负鑷姞璁℃暟鍣紝瀵 CU 杩涜璁版暟銆傚綋 CV=PV 鏃跺湪 QU 绔湁杈撳嚭銆傚姛鑳藉悓 CTU 鍔熻兘鍧椼
    褰 LOAD 鏈変竴涓俊鍙锋椂锛屽垯 CV 浼氳鍒濆鍖栦负 PV锛屾鏃舵湰鍔熻兘鍧椾細琚敤浣滀负涓涓噺
    璁℃暟鍣ㄣ傚綋鏈夎緭鍏ユ椂鍒 CV 鍑忎竴锛屽綋 CV=0 鏄 QD 鏈夎緭鍑恒
    鍔熻兘鍧楀涓嬪浘锛
    640 (13)_缁撴灉.jpg 杈撳叆锛
    CU,BOOL鍨
    CD锛孊OOL 鍨
    RESET锛孊OOL 鍨
    LOAD锛孊OOL 鍨
    PV锛孖NT 鍨
    杈撳嚭锛歈U锛孊OOL 鍨
    QD锛孊OOL 鍨
    CV锛孖NT 鍨
    1.3 瀛楃涓叉搷浣滃嚱鏁 String Functions
    1.3.1 CONCAT 鍑芥暟
    鍔熻兘鎻忚堪锛
        杩欐槸涓涓覆杩炴帴鍑芥暟銆傚畠鐨勪富瑕佸姛鑳藉氨鏄妸涓や釜杈撳叆涓茶繛鎴愪竴涓覆銆
    鍑芥暟鍧楀涓嬪浘锛
    640 (14)_缁撴灉.jpg
    杈撳叆锛歋TR1锛孲TRING 鍨
    STR2锛孲TRING 鍨
    杈撳嚭锛氱敱浜庡姛鑳藉潡涓庡嚱鏁扮殑鍖哄埆锛屽嚱鏁扮殑杈撳嚭鍗宠繑鍥炲兼槸鐢ㄦ埛鑷繁瀹氫箟鐨勫彉閲忥紝鏄 STRING
    鍨嬨
    1.3.2 DELETE 鍑芥暟
    鍔熻兘鎻忚堪
    鏈嚱鏁版槸浠庣粰瀹氱殑涓蹭腑鍒犻櫎缁欏畾浣嶇疆寮濮嬬殑瀛楃涓层係TR 鏄緭鍏ヤ覆锛孡EN 鏄鍒犻櫎鐨
    闀垮害锛孭OS 鏄紑濮嬬殑浣嶇疆銆
    鍑芥暟鍧楀涓嬪浘锛
    640 (15)_缁撴灉.jpg
    杈撳叆锛歋TR,STRING鍨
    LEN锛孖NT 鍨
    POS锛孖NT 鍨
    杈撳嚭锛氬畬鎴愭搷浣滃悗鐨勪覆锛孲TRING 鍨
    1.3.3 FIND 鍑芥暟
    鍔熻兘鎻忚堪锛
    鏈嚱鏁板氨鏄湪缁欏畾鐨勪覆涓煡鎵炬墍瑕佹煡鐨勪覆鐨勪綅缃傜粰鍑虹涓竴涓瓧绗︾殑浣嶇疆銆
    鍑芥暟鍧楀涓嬪浘锛
    640 (16)_缁撴灉.jpg
    杈撳叆锛歋TR1锛孲TRING鍨
    STR2锛孲TRING 鍨
    杈撳嚭锛歋TR2 棣栧瓧绗﹀湪 STR1 涓殑浣嶇疆銆侷NT 鍨
    1.3.4 INSERT 鍑芥暟
    鍔熻兘鎻忚堪锛
    鏈嚱鏁板氨鏄湪涓茬殑缁欏畾鐨勪綅缃腑鎻掑叆涓涓覆銆係TR2 涓叉彃鍏 STR1 涓殑 POS 浣嶇疆銆
    鍑芥暟鍧楀涓嬪浘锛
    640 (17)_缁撴灉.jpg
    杈撳叆锛歋TR1锛孲TRING鍨
    STR2锛孲TRING 鍨
    POS锛孖NT 鍨
    杈撳嚭锛氬畬鎴愭搷浣滃悗鐨勪覆锛孲TRING 鍨
    1.3.5 LEFT 鍑芥暟
         鍔熻兘鎻忚堪锛
      浠庣粰瀹氱殑涓茬殑宸﹀紑濮嬪彇瀛楃涓 SIZE 浣嶃
    鍑芥暟鍧楀涓嬪浘锛
    640 (18)_缁撴灉.jpg
    杈撳叆锛歋TR锛孲TRING 鍨
    SIZE锛孖NT 鍨
    杈撳嚭锛氬畬鎴愭搷浣滃悗鐨勪覆锛孲TRING 鍨
    1.3.6 LEN 鍑芥暟
    鍔熻兘鎻忚堪锛
        璁$畻瀛楃涓茬殑闀垮害銆
    鍑芥暟鍧楀涓嬪浘锛
    640 (19)_缁撴灉.jpg
    杈撳叆锛歋TR,STRING鍨
    杈撳嚭锛氱粰瀹氱殑瀛楃涓茬殑闀垮害锛孖NT 鍨
    1.3.7 MID 鍑芥暟
    鍔熻兘鎻忚堪锛
    鍙栫粰瀹氱殑瀛楃涓茬殑绗 POS 浣嶅紑濮嬬殑 LEN 浣嶃
    鍑芥暟鍧楀涓嬪浘锛
    640 (20)_缁撴灉.jpg
    杈撳叆; STR,STRING鍨
    LEN锛孖NT 鍨
    POS锛孖NT 鍨
    杈撳嚭锛氬畬鎴愭搷浣滃悗鐨勪覆锛孲TRING 鍨
    1.3.8 REPLACE 鍑芥暟
    鍔熻兘鎻忚堪锛
    鎶 STR1 涓 P 浣嶅紑濮嬬殑 L 浣嶆浛鎹㈡垚 STR2銆
    鍑芥暟鍧楀涓嬪浘锛
    640 (21)_缁撴灉.jpg
    杈撳叆锛歋TR1,TRING鍨
    STR2锛孲TRING 鍨
    L锛孖NT 鍨
    P锛孖NT 鍨
    杈撳嚭锛氬畬鎴愭搷浣滃悗鐨勪覆锛孲TRING 鍨
    1.3.9 RIGHT 鍑芥暟
    鍔熻兘鎻忚堪锛
    浠庣粰瀹氱殑涓茬殑鍙冲紑濮嬪彇瀛楃涓 SIZE 浣嶃
    鍑芥暟鍧楀涓嬪浘锛
    640 (22)_缁撴灉.jpg
    杈撳叆锛歋TR,STRING鍨
    SIZE锛孖NT 鍨
    杈撳嚭锛氬畬鎴愭搷浣滃悗鐨勪覆锛孲TRING 鍨
    1.4 瀹氭椂鍣ㄥ姛鑳藉潡 Timer
    1.4.1 RTC 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    褰撹緭鍏ヤ负 TRUE 鏃讹紝鍒欐妸 PDT 鐨勬椂闂翠粯缁 CDT 鍚屾椂 CDT 寮濮嬭鏃讹紝杈撳嚭 Q 涓 TRUE銆
    褰撹緭鍏 EN 涓哄亣鏄 CDT 涓洪粯璁ゆ椂闂淬
    鍔熻兘鍧楀涓嬪浘锛
    640 (23)_缁撴灉.jpg
    杈撳叆锛欵N,BOOL鍨
    PDT锛孌T 鍨
    杈撳嚭锛歈锛孊OOL 鍨
    CDT锛孌T 鍨
    1.4.2 TOF 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    褰撹緭鍏 IN 鐢遍珮鐢甸鍙樹负浣庣數棰戞椂寮濮嬭鏃讹紝褰 ET 璁版椂杈惧埌缁欏畾鐨勬椂闂 PT 鏃讹紝杈撳嚭鐢
    楂樼數棰戝彉涓轰綆鐢甸銆
    鍔熻兘鍧楀涓嬪浘锛

    640 (24)_缁撴灉.jpg
    杈撳叆锛欼N锛孊OOL 鍨
    PT锛孴IME 鍨
    杈撳嚭锛歈锛孊OOL 鍨
    ET锛孴IME 鍨
    1.4.3 TON 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    褰撹緭鍏 IN 鐢变綆鐢甸鍙樹负楂樼數棰戞椂寮濮嬭鏃讹紝褰 ET 璁版椂杈惧埌缁欏畾鐨勬椂闂 PT 鏃讹紝杈撳嚭鐢
    浣庣數棰戝彉楂樹綆鐢甸銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (25)_缁撴灉.jpg
    杈撳叆锛欼N锛孊OOL 鍨
    PT锛孴IME 鍨
    杈撳嚭锛歈锛孊OOL 鍨
    ET锛孴IME 鍨
    1.4.4 TP 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    浣胯緭鍏ョ殑淇″彿 IN 淇濇寔 PT 鏃堕棿锛屼篃灏辨槸璇村綋鏈夎緭鍏ユ槸杈撳嚭 Q 灏变负 TRUE锛屽悓鏃朵繚鎸侊紝
    姝ゆ椂 ET 寮濮嬭鏃讹紝褰 ET=PT 鏄紝杈撳嚭鍙樹负 FALSE锛屽悓鏃朵繚鎸併
    鍔熻兘鍧楀涓嬪浘锛
    640 (26)_缁撴灉.jpg
    杈撳叆锛欼N, BOOL鍨
    PT锛孴IME 鍨
    杈撳嚭锛歈锛孊OOL 鍨
    ET锛孴IME 鍨
    1.5 瑙﹀彂淇濇寔鍔熻兘鍧 Trigger
    1.5.1 F_TRIG 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    杈撳叆姣忔湁涓涓敱楂樼數棰戝悜浣庣數棰戠殑璺冲彉鏃惰緭鍑 Q 灏辨湁涓涓緭鍑 TRUE銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (27)_缁撴灉.jpg
    杈撳叆锛欳LK,BOOL鍨
    杈撳嚭锛歈锛孊OOL 鍨
    1.5.2 R_TRIG 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    杈撳叆姣忔湁涓涓敱浣庣數棰戝悜楂樼數棰戠殑璺冲彉鏃惰緭鍑 Q 灏辨湁涓涓緭鍑 TRUE銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (28)_缁撴灉.jpg
      杈撳叆锛欳LK,BOOL鍨
      杈撳嚭锛歈锛孊OOL 鍨

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

    浣跨敤閬撳叿 涓炬姤

    璇ョ敤鎴蜂粠鏈鍒

    鍙戣〃浜 2020-6-14 12:25:07 | 鏄剧ず鍏ㄩ儴妤煎眰
    浣犲ソ锛屾垜鐨3.5
    搴撻噷闈㈡病鎵惧埌杩欎釜搴撳摕
    鎵撹祻榧撳姳涓涓嬶紒
    +10
    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2020-11-28 04:04 , Processed in 0.245452 second(s), 65 queries .

    閰峰痉缃

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

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