CoDeSys鐨勪粖鐢燂紝鏈潵-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 3151|鍥炲: 1

CoDeSys鐨勪粖鐢燂紝鏈潵

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2015-5-13 09:47:41 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡

    20150113175233998.png
    銆銆鑷粠涓婁竴鏈熲淐ANopen涓汉涔嬫墍瑙佲濆彂琛ㄤ箣鍚庯紝寰楀埌澶у寰堝鍙嶅搷锛岃阿璋㈠ぇ瀹讹紝缁忚繃澶氭棩鐨勯厺閰匡紝绗簩绡嘋oDeSys鐨勬枃绔犲嚭鐐変簡锛屽師璁″垝鍐欏啓鈥淐oDeSys鍜孋ANopen鈥濓紝鎵х瑪鏃舵兂鎯筹紝CoDeSys鍜孋ANopen涔熸病鏈変粈涔堝繀鐒惰仈缁滐紝CoDeSys鑳藉杩愮敤CANopen锛宻ercos锛孍therCat銆備簬鏄彧鍐欎簡CoDeSys鐩稿叧鐨勯儴鍒嗐傛閫佹媿鐮栥
    銆銆: )
    銆銆宸ヤ綔浠ュ強缃戜笂鐪嬪埌涓嶅皯浜鸿锛孋oDeSys鍜岃タ闂ㄥ瓙step7锛屽湪寰峰浗閮藉睘浜庤鑼冭绋嬶紝鐗涢肩殑灏忔湅鍙嬮兘鑳藉鐢ㄥ叾缂栫▼锛屼笉鐭ョ湡鍋囷紝缃俊鏃犻涓嶈捣娴紝澶氬皯鏈変簺渚濇嵁锛岀湅鐪嬪浗鍐呮竻涓鑹茬殑鏃ョ郴缂栫▼锛屾垜浠兘鍚﹂渶姹傛崲鎹㈣剳瀛愶紝鎹㈡崲鎬濈储鏂瑰紡浜嗭紵CoDeSys绫荤殑缂栫▼鑳藉惁鎶佃揪杩欎釜鐩殑锛
    銆銆璇锋潈涓旀姳鐫鑷垱鐨勬兂娉曠湅鐪嬩笅鏂囷紝鑳藉惁鑳藉彇寰椾綘闇姹傜殑淇℃伅銆
    銆銆鍐欎綔鐨勫姩韬偣鏄粰閿鍞汉鍛樼湅鐨勶紝浼间箮鏈夊叴鑷寸殑鏇村鏄妧鏈汉鍛橈紝閿鍞簡瑙d簡杩欎簺姒傚康锛屾垨璁哥湡鐨勮兘鎴愪负鈥滃拷鎮犲ぇ绁炰粰鈥濓紝澶氬崠浜у搧锛屽璧氶摱瀛愶紝涓汉鐨勪竴鐐规祬瑙併傚簾璇濆皯璇达紝寮鍚綘鐨勫涔犳柟寮忓惂銆
    銆銆CoDeSys鏄叏鐞冩渶钁楀悕鐨凱LC鍐呮牳杞欢鐮斿彂鍘傚寰峰浗鐨3S锛圫MART锛孲OFTWARE锛孲OLUTIONS锛夊叕鍙稿嚭鐨勪竴娆句笌鍒堕犲晢鏃犲叧鐨処EC 61131-1缂栫▼杞欢銆侰oDeSys 鏀寔瀹屽ソ鐗堟湰鐨処EC61131瑙勮寖鐨勭紪绋嬬幆澧冿紝鏀寔瑙勮寖鐨勫叚绉嶇紪绋嬭█璇傛槸涓涓鑼冪殑杞欢骞冲彴锛岃寰堝纭欢鍘傚鏀寔锛屽彲缂栫▼瓒呰秺150瀹禣EM娑堣垂鐨勮嚜鍔ㄨ缃侰oDeSys鎻愪緵浜嗚澶氱粍鍚堜骇鍝佺殑鎵╁睍锛岃濡傚悇绉嶄笉鍚岃寖鐣寸殑鎬荤嚎閰嶇疆绋嬪簭銆佸畬鏁寸殑鐩祴鍖栧拰杩愬姩鎺у埗绯荤粺銆
    銆銆CoDeSys鏄竴绉嶅姛鐢ㄥ己澶х殑PLC杞欢缂栫▼宸ュ叿锛屽畠鏀寔IEC61131-3瑙勮寖IL 銆丼T銆 FBD 銆丩D銆 CFC銆 SFC鍏PLC缂栫▼瑷璇紝鐢ㄦ埛鑳藉鍦ㄥ悓涓椤圭洰褰撻夋嫨涓嶅悓鐨勮█璇紪杈戝瓙绋嬪簭锛屽姛鐢ㄦā鍧楃瓑銆
    銆銆CoDeSys鏄彲缂栫▼閫昏緫鎺у埗PLC鐨勫畬濂藉紑鍙戠幆澧冿紙Controlled Developement System鐨勭缉鍐欙級锛屽湪PLC绋嬪簭鍛樼紪绋嬫椂锛孋oDeSys涓哄己澶х殑IEC瑷璇彁渚涗簡涓涓畝鍗曠殑鍔炴硶锛岀郴缁熺殑缂栬緫鍣ㄥ拰璋冭瘯鍣ㄧ殑鍔熺敤鏄爲绔嬪湪楂樼骇缂栫▼瑷璇殑鍩虹涓婏紙濡俈isual C  锛夈
    銆銆寰甯稿浗鍐匬LC鐢ㄦ埛杩愮敤鐨勭増鏈涓篊oDeSys V2.3锛 鏈鏂扮殑鐗堟湰鏄疌oDeSys V3锛堢洰鍓嶆渶鏂扮増鏈负V3.5锛夈俈3 鍦ㄨ蒋浠舵灦鏋勪笂鏈変簡寰堝ぇ鐨勬敼鍠勶紝鏈濆畨鍏ㄨ蒋浠剁殑鏂瑰悜灞曞紑锛岀洰鍓嶆鍦ㄧ敵璇稵UV鍏充簬EN 61508鐨凷IL璁よ瘉銆
    銆銆HOLLSYS锛堝拰鍒╂椂G3 PLC锛夛紝Kinco锛堟繁鍦虫绉慒1 PLC锛夛紝ABB AC500绯诲垪锛孖FM锛孍PEC锛孯exroth锛學ago锛孭arker锛孊eckhoff锛孎esto锛屾柦鑰愬痉绛塒LC鍘傚閮芥槸杩愮敤CoDeSys骞冲彴寮鍙戣嚜宸辩殑缂栫▼杞欢鐨勩傚綋鐒朵簡锛岃繕鏈夊緢澶氬叾浠栧叕鍙搞
    銆銆鍙﹀锛孋oDeSys涔熸彁渚涜Е鎽稿睆鍔熺敤锛圴isualization锛夛紝浣嗚繖涓嶆槸浠栫殑寮洪」锛屽熀鏈兘鏄噰鐢∣PC 宸ユ帶鏈虹殑璁″垝锛孉BB锛屽嶇閮芥湁寰堝ソ鐨勮鍒掞紝閮芥槸闈㈠悜涓嶅樊閽辩殑瀹㈡埛銆
    銆銆3S绔炰簤鑰
    銆銆CoDeSys鐨勫叾浠栫珵浜夊鎵嬭繕鏈塊W銆乮nfoteam銆両SAGRAF銆傚惉璇磇nfoteam锛堝浗鍐呯О涓鏂规闃燂級涔熸尯鐗涚殑锛屼笉澶簡瑙o紝鎯宠璇碖W锛屽悓灞炰簬寰峰浗浼佷笟锛屼富瑕佹槸浜у搧涓簃ultiprog銆
    銆銆KW鐨勪富瑕佸鎴锋湁鑿插凹鍏嬫柉鐨凙utomationWorx銆佸瘜澹數鏈虹殑D300Win銆 鐮斿崕鐨凪ultiprog锛岃嫗绫冲嫆鐨凱LC鍜屼己鏈嶇郴鍒楋紝涓夎彵搴旇涔熸槸瀹冪殑澶у鎴凤紝浣嗘槸缂栫▼鏂瑰紡鍗存槸渚濈収鏃ヨ嚜宸辩殑涔犳皵鏉ョ殑銆
    銆銆CoDeSys妗嗘灦缁勬垚
    銆銆涓ら儴鍒嗭細
    銆銆1銆丆oDeSys IDE銆
    銆銆鍗矯oDeSys闆嗘垚寮鍙戠幆澧冿紝濂戝悎IEC61131缂栫▼瑙勮寖锛岃缃簬PC鏈轰笂锛岃繍杞簬Windows鎴栬匧inux涓嬨傜敱鏈缁堝簲鐢ㄧ敤鎴锋墍杩愮敤鐨勫紑鍙戝伐鍏枫
    銆銆2銆丆oDeSys Runtime銆
    銆銆鍗崇‖浠跺钩鍙扮郴缁熴傞渶姹傝澶囧埗閫犲晢涓3S鍏徃鍏卞悓瀹屾垚锛3S鍏徃闇姹傝瘎浠风‖浠跺紑鍙戝晢鎵璁捐鐨勭‖浠剁郴缁燂紝骞朵负鍏跺畾鍒禖oDeSys Runtime妗嗘灦锛屽鎴烽渶姹備负姝ゅ悜3S浠樿垂銆傜劧鍚庣‖浠跺強绯荤粺寮鍙戝晢闇姹備緷鎹湰绯荤粺鐨勫鍥磋緭鍏ヨ緭鍏ョ瓑閰嶇疆锛岀紪鍐欑浉搴旂殑椹卞姩锛屽苟浠ュ簱鎴栬匬LC Configure鎺ュ彛鐨勬柟寮忔彁渚涚粰CoDeSys ID寮鍙戠幆澧冭皟鐢ㄣ傚疄璺典笂灏辨槸鏋勬垚涓濂桾arget瑁呯疆鍖呫傛澶栵紝CodeSys杩樹細瀵规瘡涓繍鐢ㄥ叾CoDeSys Runtime鐨勮澶囪创鏍囷紝璁惧渚涚粰鍟嗛渶姹備负姣忎釜3S鏍囩墝浠樿垂锛屼綔涓哄叾瀛﹂棶浜ф潈鐨勪竴閮ㄥ垎銆
    銆銆3銆佹渶缁堢敤鎴(搴旂敤寮鍙戝晢)鑳藉涓嬭浇閫氱敤鐨凜oDeSys IDE銆
    銆銆閲岄潰鎻愪緵鍩烘湰鐨処EC61131缂栫▼鐜锛屼絾鏄叧浜庝竴涓粏鑷寸殑纭欢PLC鎴栬匟MI锛岄渶姹傝缃笌璇ョ‖浠剁浉瀵瑰簲鐨凾argets鍖呫傝繖涓 Targets鍖呯殑鍏ュ彛鏂囦欢鏄*.tnf鏂囦欢锛屾湁鍏舵潵鎸囧畾锛
    銆銆1銆乼argets(*.tar)鏂囦欢锛屽搴 CoDeSys IDE鐨凾arget Setting椤.
    銆銆2銆丳lcConf鏂囦欢澶逛笅鐨*.cfg鏂囦欢锛屽搴擟oDeSys IDE鐨凱LC Configuration椤广傚叾瑁呯疆閫斿緞鐢盜nstallTarget缁勪欢绋嬪簭鐨処nstallation閫夐」鎸囧畾銆傚弽鏄犲湪CoDeSys IDE涓婂氨鏄細Project\uOptions\uDirectories\uTarget\uConfiguration files锛 **\*\uPlcConf\銆
    銆銆3銆丩ib鏂囦欢澶逛笅鐨勮*.lib鏂囦欢锛屾彁渚涘簳灞傜殑CoDeSys Runtime鐨勯┍鍔ㄦ帴鍙c傚搴擟oDeSys IDE鐨凩ibrary Manager銆傚叾瑁呯疆閫斿緞鐢盜nstallTarget缁勪欢绋嬪簭鐨処nstallation閫夐」鎸囧畾銆傚弽鏄犲湪CoDeSys IDE涓婂氨鏄細Project\uOptions\uDirectories\uTarget\uLibraries锛 **\*\uLibs\銆
    銆銆
    20150113175443107.png
    銆銆
    20150113175454779.png
    銆銆涓婂浘锛屽氨鏄缃畉arget鐨勮繃绋嬶紝涔熷氨鏄瘡涓狾EM鍘傚瑁呯疆鑷繁纭欢鐨勮繃绋嬨
    銆銆CoDeSys搴曞眰杩愯浆鍘熺悊
    銆銆
    20150113175524482.png
    銆銆Codesys runtime鏄爲绔嬪湪OS涓婄殑锛屽父瑙佺殑OS鏈墂ince锛寃indows锛宭inux锛寁xworks銆傛瀯寤哄湪OS鐨勪紭鍔垮氨鍦ㄤ簬绯荤粺鐨勬墿灞曟ф洿寮猴紝PC鐨勬洿澶氬姛鐢ㄩ兘鑳藉鍦≒LC涓婂畬鎴愩
    銆銆control task琚搷浣滅郴缁熸瘡闅斾竴娈垫椂闂达紙鍏稿瀷鏄1ms锛夎皟鐢ㄤ竴娆°
    銆銆IEC task琚唴寤虹殑鐪嬮棬鐙楃洃鎺э紝鐩戣PLC鐨勫疄璺靛伐浣滃懆鏈熻兘鍚﹁秴鍑洪瀹氭椂闂达紝鍋囧瓒呭嚭鍒橧EC task浠诲姟涓锛屽悜绯荤粺鎶ュ憡閿欒銆
    銆銆璇村埌杩欓噷璁茶PLCOPEN鐨処EC 61131-3瑙勮寖锛堣繖涓狪EC缁嗚嚧鍚嶅瓧锛岀綉涓婄幇鏌ョ殑锛屾柟鍗氬+鎺у埗鐨勫緢濂斤級銆侷EC 61131-3澶氫换鍔℃搷浣滅郴缁燂紝涔熸病鏌ュ埌缁嗚嚧濡備綍瀹屾垚锛岃嚜宸变箣鍓嶅仛杩囧祵鍏ュ紡寮鍙戯紝浜嗚ВOS浠ュ強RTOS锛岃嚜浠ヤ负鍜孯TOS鐩镐技锛岀儹鎯呴珮鐨勬湅鍙嬭兘澶熺綉涓婄湅鐪婻TOS锛岄噸鐐规槸RTOS鐨勪紭鐐规槸浠涔堬紵娆ф床鐨勪骇鍝侀兘寰堟敞閲嶆蹇碉紝姒傚康浜嗚В浜嗭紝灏辫兘澶熻浣犺嚜鐢卞彂鎸ャ傝繖閲屽氨澶氭彃涓鍙ワ紝鏃ョ郴PLC鍦ㄥ仛澶у瀷椤圭洰鏃讹紝杩樻槸鍜屼綆绔疨LC涓鏍凤紝缂栫▼涔犳皵鐩镐技姹囩紪锛岀紪绋嬩笂鎯宠瀹屾垚妗嗘灦鐨勬蹇靛崄鍒嗛毦锛屽洜鑰屽湪娆ф床姣旇緝闅炬帹琛屻傚線甯告棩绯讳篃鍦ㄦ敼杩涳紝鍙備笌浜哠T缂栫▼锛岃繍鐢ㄤ簡鍔熺敤鍧楋紝涔熺畻鏄棩鑷繁鐨勫Ε鍗忓惂銆
    銆銆
    20150113175553107.png
    銆銆杩欓噷鏈夊嚑涓蹇碉細
    銆銆浼樺厛绾э紝鏁板艰秺灏忎紭鍏堢骇瓒婇珮锛屼緷鎹换鍔$殑瀹炴椂鎬э紝璁惧畾浼樺厛绾
    銆銆浠诲姟绫诲瀷
    銆銆寰幆锛氬懆鏈熸ф墽琛屼换鍔
    銆銆鑷敱杩愯浆锛氬彧闇鍚姩绋嬪簭灏卞缃换鍔★紝CPU闂叉殗灏辫繍杞task銆
    銆銆Event瑙﹀彂鍨嬶細瑙﹀彂浣嶇殑涓婂崌娌胯皟鐢ㄧ▼搴忋傚閮ㄤ簨鎯呰Е鍙戝姛鐢紝鏈畾鍒剁殑鍘傚姝ら夐」涓嶈兘杩愮敤
    銆銆鐪嬮棬鐙楋紙鏃╂湡鍗曠墖鏈轰笂鐨勪竴涓蹇碉紝绾虹粐绋嬪簭杩涘叆姝诲惊鐜紝鎻愬嚭浜嗗畾鏃跺杺鐙楃殑姒傚康锛屽叾瀹炶川灏辨槸涓涓噺娉曞畾鏃跺櫒锛
    銆銆璇磋MCU濡備綍杩愮敤watchdog鍚с
    銆銆while(1)
    銆銆{
    銆銆//鐢ㄦ埛鑷繁鍐欑殑绋嬪簭
    銆銆Watchdog = 10ms; //watchdog timer鍚庡彴渚濈収tick鍋氬噺娉曪紝鍋囧timer涓0锛屽氨瑙﹀彂涓涓‖浠朵腑缂锛岄氱煡鐢ㄦ埛绋嬪簭鍦ㄥ崟浣嶆椂闂村唴娌℃墽琛屽畬锛屾鏌ラ敊璇傛甯稿垯姣忔鍠傜嫍锛岃缃畉imer涓10ms
    銆銆}
    銆銆CoDeSys鐨剋atchdog瀹氭椂鐩戣PLC鐨勫疄璺靛伐浣滃懆鏈熻兘鍚﹁秴鍑洪瀹氭椂闂达紝閬垮厤PLC鍦ㄦ墽琛岀▼搴忕殑杩囩▼涓繘鍏ユ寰幆锛屾垨鑰匬LC鎵ц闈為瀹氱▼搴忔瀯鎴愮郴缁熺槴鐥傚綋浠诲姟瓒呮椂锛屼换鍔″浣嶏紝杩涘叆鍒濆鐘舵侊紝缁х画鎵ц銆
    銆銆瀵规瘮涓涓婣B control logix鐨勪换鍔″畬鎴
    銆銆control logix椤圭洰鍒嗕负浠诲姟(task)锛岀▼搴(program)鍜屼緥绋(routine)銆
    銆銆浠诲姟(task):姣忎釜control logix鎺у埗鍣ㄦ渶澶32涓换鍔★紝浠呮湁涓涓猚ontinuous浠诲姟锛屽叾浠栦负Periodic鎴栬卐vent浠诲姟銆
    銆銆浠诲姟鍛藉悕鍖呮嫭浠诲姟鍔熺敤锛屼紭鍏堢骇鍜屾墽琛屽懆鏈
    銆銆浠诲姟鐨勪笁绉嶇被鍨嬶細
    銆銆1. 杩炵画鍨嬩换鍔★紝鎸囩殑鏄惊鐜線澶嶈繛缁墽琛岀殑浠诲姟锛屼竴涓」鐩彧鍏佽瀹氫箟1涓紝浜﹁兘澶熶笉瀹氫箟锛屽悓绛変簬codesys涓殑PLC_PRG(POU)銆
    銆銆2. 鍛ㄦ湡鍨嬩换鍔★紝瀹氭椂涓紑鎵ц鐨勯昏緫绋嬪簭锛岄渶瀹氫箟鍛ㄦ湡鏃堕棿锛岃瀹氫紭鍏堢骇鍒紝鏈澶氳兘澶熷畾涔31涓
    銆銆3. 浜嬫儏瑙﹀彂鍨嬩换鍔★紝浜嬫儏瑙﹀彂鎯硅捣鐨勪换鍔¤皟搴︼紝浜嬫儏瑙﹀彂鑳藉鏄閮ㄨ緭鍏ョ偣鎯硅捣(濂藉儚PLC5/SLC)锛屼篃鑳藉鐢眂onsumed tag鎯硅捣鎴栬呯洿鎺ユ寚浠よ皟鐢ㄦ児璧凤紝杩樿兘澶熺敱杩愬姩鎺у埗鐘舵佹児璧凤紝闇姹傝瀹氫紭鍏堢骇鍒紝鏈澶氬畾涔31涓
    銆銆Control logix涓殑producer/consumer鐨勬蹇靛崄鍒嗗ソ锛 浣撳線甯稿叾缁勭綉鎵嶅共涓娿傛瘮濡傛煇涓涓ā鍧楁槸闊宠鐨勬秷璐硅咃紝浜х敓闊宠瀵勫瓨鍦ㄩ煶璁潡涓紝鍏朵粬闇姹傛鍙橀噺鐨勫姛鐢ㄥ潡锛屽畾涔変竴涓煶璁痗onsumer鍗冲彲銆傛湁鍏村懗鐨勬湅鍙嬭兘澶熻嚜宸辩湅鐪嬬浉鍏宠祫鏂欍
    銆銆CoDeSys鐨勭紪绋嬪伐鍏
    銆銆IL 銆丼T銆 FBD 銆丩D銆 CFC銆 SFC鍏瑷璇紝鎴戜釜浜烘瘮杈冮挓鐖盨T锛孋FC銆
    銆銆CodesysV2.3杩樻槸寮鸿皟杩囩▼缂栫▼锛屽埌浜哣3.5鍒欏己璋冮潰鍚戝璞★紝C  鐨勫奖瀛愭洿澶氫簡銆
    銆銆瑷褰掓浼狅紝搴旂敤鑰呬篃涓嶉渶姹傚叧鎬閭d箞澶氭妧宸э紝鑳藉畬鎴愬姛鐢紝骞朵笖浠g爜鍏锋湁鍙淮鎶ゆу氨鏄竴涓悎鏍肩殑宸ョ▼甯堛
    銆銆1.楂樼骇瑷璇腑鐨剆truct锛寀nion銆
    銆銆Stuct鍦ㄨタ闂ㄥ瓙SCL瑷璇腑琚О涓篣DT锛坲ser defined type锛夛紝AB RSLogix 5000涓篃琚О涓篣DT
    銆銆TYPE TRAFFIC :
    銆銆(RED锛 YELLOW:=1锛 GREEN:=10);
    銆銆END_TYPE
    銆銆TYPE STRUCT1 :
    銆銆STRUCT
    銆銆P1:INT;
    銆銆P2:INT;
    銆銆P3:INT;
    銆銆END_STRUCT
    銆銆END_TYPE
    銆銆2.鎸囬拡锛宑锛宑  涓殑椤剁骇鍒╁櫒锛屽湪codesys涓篃鑳藉杩愮敤
    銆銆Example in ST:
    銆銆ptOINTER TO INT;
    銆銆var_int1:INT;
    銆銆var_int2:INT;
    銆銆pt := ADR(var_int1);
    銆銆var_int2:=pt^;
    銆銆3.FC锛孎B鐨勬蹇
    銆銆
    20150113175640310.png
    銆銆
    20150113175656592.png
    銆銆
    20150113175716951.png
    銆銆
    20150113175725889.png
    銆銆
    20150113175741779.png
    銆銆涓婅堪鏄疌oDeSys闃愭槑涔︾殑渚嬬▼锛屼笉鐭ラ亾鐪嬪嚭鏈変粈涔堜笉鍚岋紵
    銆銆FC鍦ㄧ▼搴忎腑鐩存帴璋冪敤鍗冲彲锛孎B鍒欓渶姹傚厛瀹氫箟瀹炰緥锛坕nstance锛夛紝Instance: FUB銆傝繖閲岀殑Instance灏辨槸C  涓殑瀵硅薄瀹炰緥銆傛庢牱浜嗚В杩欎釜瀹炰緥鍛紵涓婁釜鏈鍌荤殑楂樼骇瑷璇殑渚嬪瓙鍚с
    銆銆class Student
    銆銆{
    銆銆int age;
    銆銆int sex;
    銆銆int grade;
    銆銆void DoWork(void);
    銆銆};
    銆銆Student tony锛 jany;
    銆銆tony.age = 10;
    銆銆tony.sex = male;
    銆銆tony.grade = 3;
    銆銆tony.DoWork();
    銆銆jany.age = 9;
    銆銆jany.sex = female;
    銆銆jany.grade = 3;
    銆銆jany.DoWork();
    銆銆杩欓噷鐨凞oWork灏辩浉浼糉B锛岃兘澶熺湅鍒癋B甯︽湁鑷繁鐙珛鐨勬暟鎹潡锛屾瘮濡備緥涓殑age锛宻ex锛実rade銆
    銆銆瀵规瘮瑗块棬瀛怱300/S400鐨凢C銆丗B
    銆銆1.FC涓嶅叿澶囪嚜宸辩殑瀛樺偍鍖猴紝FB鏈夎嚜宸辩殑瀛樺偍鍖-鑳屾櫙DB銆
    銆銆2.FC鍜孎B閮芥湁鑷繁鐨凾EMP鍙橀噺锛屽瓨鍌ㄥ湪绯荤粺鐨勬湰鍦皊tack涓娿傚綋FC鍜孎B璋冪敤缁堜簡锛孴EMP鍙橀噺浼氶噴鏀俱
    銆銆3.FB鏈夐潤鎬佸彉閲忥紝FC娌℃湁銆傞潤鎬佸彉閲忓湪鑳屾櫙DB涓紝FB璋冪敤缁堜簡锛岄潤鎬佸彉閲忎緷鐒舵湁鏁堛
    銆銆瑗块棬瀛300涓紝DB鍒嗕负鑳屾櫙DB鍜屽叡浜獶B锛岃儗鏅疍B鍜孎B鐩稿叧鑱斻
    銆銆鏅疍B鍜屽叡浜獶B娌℃湁瀹炶川鍖哄埆锛屽畠浠殑鏁版嵁閮借兘澶熻浠讳綍涓涓狣B锛孎C鎴栬匜B璇诲啓銆傚畠浠殑鍖哄埆鍦ㄤ簬杩愮敤鐩殑锛氳儗鏅疍B涓篎B鎻愪緵鏁版嵁锛屽叾鏁版嵁鏍煎紡鍜孎B鍙橀噺澹版槑鍒嗘锛涘叡浜獶B鐩殑涓虹敤鎴风▼搴忔彁渚涗竴涓彲淇濈鐨勬暟鎹尯銆
    銆銆
    20150113175808123.png
    銆銆鍋囧瀵笴姣旇緝鐔熶範锛岃兘澶熻繖鏍蜂簡瑙o細FC鍜孎B鍍廋涓殑鍑芥暟锛屽彧涓嶈繃FB鑳藉鐢熸垚闈欐佸彉閲忥紝鍦ㄤ笅娆″嚱鏁拌皟鐢ㄦ椂鏁版嵁鑳藉淇濈锛岃孎C鐨勫彉閲忓彧鍦ㄨ皟鐢ㄦ湡鍐呮湁鏁堬紝涓嬫璋冪敤鍙堥噸鏂版敼鎹€
    銆銆姣忔璋冪敤FC鐨処/O鍖哄煙蹇呴渶姹傝嚜宸辨瘡娆℃墜鍔ㄨ緭鍏ワ紝鑰孎B灏变笉瑕侊紝鐪佸幓涓嶅皯鐪佷簨锛屽亣濡傚湪涓婁綅鏈烘帶鍒剁洿鎺ヨ緭鍏B鎺у埗鍦板潃灏卞彲!
    銆銆鐪嬪埌杩欓噷锛屽ぇ瀹跺啀鎬濈储涓涓嬶紝寰风郴PLC鐨勭紪绋嬫濇兂鍥虹劧瀹屾垚鏂瑰紡涓嶅悓锛屼絾寮鸿皟鐨勬蹇甸兘涓鏍凤紝涓瀹氳浜嗚В杩欎簺姒傚康锛屾墠骞茬啛缁冨簲鐢ㄣ
    銆銆4.PLC_PRG
    銆銆PLC_PRG鏄竴涓瀹氫箟鐨凱OU(program of unit)锛屾瘡涓伐绋嬪繀闇鍖呭惈杩欎釜鐗瑰畾鐨勭▼搴忥紝杩欎釜POU鍦ㄦ瘡涓猚ycle涓皟鐢ㄤ竴娆°傚叾瀹炶川灏辨槸涓涓猣reewheeling绋嬪簭銆
    銆銆鍋囧杩愮敤浜嗗浠诲姟锛岃兘澶熶笉鍖呭惈PLC_PRG锛屼緷鐓т换鍔¢厤缃〃鎵ц鐗瑰畾绋嬪簭銆
    銆銆5.lib搴撶殑杩愮敤
    銆銆Lib鐨勮繍鐢ㄨ〃鐜颁簡codesys楂樼骇瑷璇殑鐗规э紝鏀寔math.lib锛宻tring.lib锛宑anopen.lib锛岃兘澶熻繍鐢ㄨ嚜瀹氫箟鐨刲ib
    銆銆
    20150113175825967.png
    銆銆鐢ㄦ埛鑷繁瀹屾垚鐨刲ib搴擄紝鍖呭惈涓ょ锛欼nternal lib锛孍xternal lib锛屾湁浠涔堝尯鍒憿锛
    銆銆鍐呴儴鏄畬鏁村簲鐢–oDeSys瀹屾垚鐨勮嚜瀹氫箟lib搴撱傚閮ㄥ簱鍒欓渶姹傚簲鐢ㄧ浉鍏崇殑缂栬瘧閾惧幓缂栬瘧锛屾洿澶氳搴曞眰寮鍙戣呮墍閲囩敤锛岃兘澶熺洿鎺ュ簲鐢∣S搴曞眰鐨凙PI涓缂栫▼锛屾ц兘鏁堢巼鏇撮珮銆
    銆銆
    20150113175910076.png
    銆銆6.濂界敤鐨刢ase璇彞
    銆銆CASE INT1 OF
    銆銆1锛 5:
    銆銆BOOL1 := TRUE;
    銆銆BOOL3 := FALSE;
    銆銆2:
    銆銆BOOL2 := FALSE;
    銆銆BOOL3 := TRUE;
    銆銆10..20:
    銆銆BOOL1 := TRUE;
    銆銆BOOL3:= TRUE;
    銆銆ELSE
    銆銆BOOL1 := NOT BOOL1;
    銆銆BOOL2 := BOOL1 OR BOOL2;
    銆銆END_CASE;
    銆銆case璇彞鏄垜姣旇緝鍠滄鐨勫姛鐢紝鑳藉瀹屾垚鎵嬪姩鑷姩锛岃兘澶熷畬鎴愬宸ヤ綅銆
    銆銆K5 PLC娌℃湁鏃ョ郴鐨凷TL锛屼篃娌℃湁瑗块棬瀛愮殑SCR鎸囦护锛岃兘澶熺粡杩囧叾浠栨柟寮忓畬鎴愮被case鍔炴硶锛屽ぇ瀹朵篃鑳藉鎬濈储涓嬨
    銆銆鏇村CoDeSys鐨勮繍鐢ㄧ粏鑺傚彲鍙傝僀oDeSys闃愭槑涔︹淐oDeSys_V23_E.pdf鈥
    銆銆鑳芥兂鍒扮殑涔熷氨杩欎簺锛屾殏鏃跺啓鍒拌繖閲屽惂锛屾枃涓洿澶氬己璋冪殑鏄蹇碉紝缁嗚嚧缂栫▼瀹屾垚鍜屾妧宸цЕ鍙婂緢灏戯紝涓汉瀹炴垬涔熶笉鏄緢澶氾紝璁よ瘑涔熸湁鑲ゆ祬锛屽ぇ瀹剁湅鍚庢湁浠涔堝ソ鐨勬兂娉曪紝涔熻鍛婄煡锛岃阿璋!
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

    璇ョ敤鎴蜂粠鏈鍒

    鍙戣〃浜 2015-9-10 10:24:56 | 鏄剧ず鍏ㄩ儴妤煎眰
    鎵浠ヨ涓嶈姳閽卞畾鍒秗untime鐨勮瘽锛屽氨娌″姙娉曡嚜宸辨悶涓涓祵鍏ュ紡骞冲彴杩愯codesys鍚楋紝鍙兘鍦╬c涓婅嚜宸辩紪绋嬬劧鍚巗imulation锛
    鎴戝codesys涓嶅お浜嗚В锛屽師鏉ヤ互涓哄彲浠ヨ嚜宸辩敤宓屽叆寮忓钩鍙版惌寤轰竴涓蒋PLC杩愯鐨勫憿
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2025-1-23 09:26 , Processed in 0.184783 second(s), 65 queries .

    閰峰痉缃

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

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