codesys编程手册(下)-(第2部分-共2部分)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

乎ᑣ㸼92㸼.NO.ᦣ䗄˖WAGO-I/O-PRO32໛⊼˖55-5ᰃ55-6ᰃ55-7ᰃ55-8ᰃ55-9ᰃ55-10ᰃ55-11ᰃ55-12ᰃ55-13ᰃ55-14৺55-15ᰃ55-16ᰃ55-17ᰃ56-1STᣛҸᰃ56-2ᰃ56-3ᰃ56-4ᰃ56-5ᰃ56-6ᰃ56-7ᰃ56-8ᰃ56-9ᰃ56-10ᰃ57-1೒ᔶ䇁㿔৺57-2ᰃ57-3৺57-4ᰃ57-5৺57-6ᰃ೼㞾⬅ⱘFBDЁ57-7৺57-8ᰃ೼㞾⬅ⱘFBDЁ57-9৺57-10ᰃWAGO-I/O-SYSTEM759WAGO-I/O-PRO32乎ᑣ㸼93㸼.NO.ᦣ䗄˖WAGO-I/O-PRO32໛⊼˖57-11৺57-12ᰃ57-13৺57-14ᰃ೼㞾⬅ⱘFBDЁ58-1೒ᔶᠻ㸠᥻ࠊ(䏇䕀੠䖨ಲ)ᰃ58-2ᰃ58-3ᰃ58-4ᰃ58-5ᰃ58-6ᰃ58-7ᰃ58-8ᰃ59-1ࡼ࡯↡㒓ᰃ59-2ᰃ60-1LD䖲᥹ܗӊᰃ60-2ᰃ61-1㾺⚍ᰃ61-2ᰃ61-3ᰃ61-4ᰃ61-5৺61-6৺61-7৺61-8৺62-1㒓೜ᰃ62-2ᰃ62-3ᰃ62-4ᰃ62-5৺62-6৺62-7৺62-8৺WAGO-I/O-SYSTEM759WAGO-I/O-PRO32乎ᑣ㸼9462-9৺䱣খ᭄ᠻ㸠乍Ⳃ˖ᦣ䗄˖WAGOI/OPRO322.1.1Փ⫼೑ᆊ⡍᳝ᄫヺՓ⫼’$’Ϣ’#’ˈ೼೒ᔶ䇁㿔Ёϡᖙ⫼’!’៪’|’˄ܼ೒ൟ࣪˅DŽ2.1.2ᷛ䆚ヺⱘ᳔໻䭓ᑺ≵᳝䰤ࠊ2.1.5⊼䞞ⱘ᳔໻䭓ᑺ≵᳝䰤ࠊ2.2.3.1ᣕ㓁ᯊ䯈ⱘ㣗ೈ2^32↿⾦=49,71໽2.3.1TIMEব䞣ⱘ㣗ೈTIME_OF_DAYব䞣ⱘ㣗ೈDATE_AND_TIMEব䞣ⱘ㣗ೈ1970-01-01-00:00.2106-02-06-06:28:151970-01-01ü2106-02-062.3.3᭄㒘ϟᷛⱘ᳔໻᭄㒧ᵘܗ㋴ⱘ᳔໻᭄↣ϾໄᯢЁব䞣ⱘ᳔໻᭄3≵᳝䰤ࠊ≵᳝䰤ࠊ2.3.3.1ᵮВؐⱘ᳔໻᭄ϡᬃᣕ2.3.3.2ᄫヺІব䞣ⱘ咬䅸᳔໻䭓ᑺᄫヺІব䞣ܕ䆌ⱘ᳔໻䭓ᑺ80ᄫヺ255ᄫヺ2.4.1.1ㄝ㑻ⱘ᳔໻᭄䘏䕥៪⠽⧚᯴ᇘ4⠽⧚᯴ᇘ2.4.1.2᳔໻ϟ᳔᭄ᷛ໻ϟᷛ㣗ೈ᳔໻㒧ᵘԧㄝ㑻364KB≵᳝䰤ࠊ2.4.3↣ϾໄᯢЁব䞣ⱘ᳔໻᭄≵᳝䰤ࠊ2.5POUᠻ㸠ᯊ䯈ⱘֵᙃϡᬃᣕ2.5.1.1ࡳ㛑㸼䖒ⱘᮍ⊩ৡᄫ2.5.1.5ᠽሩࡳ㛑ⱘ᳔໻䕧᭄ܹ≵᳝䰤ࠊ2.5.2.3.3䅵᳔఼᭄ᇣؐ䅵᳔఼᭄໻ؐ-32768+327672.5.3⿟ᑣᆍ䞣䰤ࠊ32KB2.6.2ऩℹऴ⫼ᯊ䯈㊒ᑺ↣ϾSFCⱘ᳔໻ℹ᭄1ms≵᳝䰤ࠊ2.6.3↣ℹ੠↣ϾSFCⱘ᳔໻䕀ᤶ᭄≵᳝䰤ࠊ2.6.4ࡼ԰ᠻ㸠ᴎࠊㅔऩℹЁ↣Ͼᕾ⦃ᠻ㸠ϔϾࡼ԰ˈᔧIEC-StepsЁⱘℹ㹿▔⌏ᯊˈࡼ԰ḍ᥂ࡼ԰᥻ࠊഫⱘ䇗⫼㒧ᵰᴹᠻ㸠2.6.4.2↣ϾℹЁⱘࡼ԰ഫⱘ᳔໻᭄↣ϾIEC_StepЁࡼ԰ഫⱘ᳔໻᭄110WAGO-I/O-SYSTEM759WAGO-I/O-PRO32乎ᑣ㸼95乍Ⳃ˖ᦣ䗄˖WAGOI/OPRO322.6.5ℹ⢊ᗕⱘ೒ᔶᰒ⼎Ӵ䗕ᮁᓔᯊ䯈䲚Ё੠ߚᬷ㒧ᵘⱘ᳔໻ᆑᑺℹব៤㪱㡆೼ϔϾ᥻ࠊᕾ⦃ݙ≵᳝䰤ࠊ2.7.1RESOURCEᑧⳂᔩϡᬃᣕ2.7.2ӏࡵḍ᥂ⳂᷛˈӏࡵᬃᣕӬܜ៪䴲Ӭܜ䇗ᑺˈ䗮䖛џӊ៪ᅮᯊ఼㾺থˈৃҹߚ䜡Ӭܜ㑻˄0-31˅DŽ3.3.2.3CASE䗝ᢽⱘ᳔໻᭄≵᳝䰤ࠊ3.3.2.4FORᕾ⦃Ёⱘ᳔㒜᥻ࠊব䞣ؐϞ䰤ؐⱘৢ䴶ϔℹ4.1.1೒ᔶ㸼⼎⊩෎ѢFBD㒧ᵘⱘ㔥㒰ᢧᠥ䰤ࠊ᠔᳝೒ᔶҙĀᷥൟā㸼䖒ᓣܕ䆌ᏺ໮ϾЁ䯈㒧ᵰDŽे䰸њ䌟ؐ㒧ᵰˈϡ㛑ᇚ䕧ߎ㒓ߚ↉DŽ೼ぎ䯆FBDЁⱘ㔥㒰ᢧᠥ≵᳝䰤ࠊDŽ4.1.3䖨ಲᕾ⦃ⱘ䌟ؐ乎ᑣ೼෎ѢFBDⱘ㒧ᵘЁˈᢧᠥϡᬃᣕᰒᗻᕾ⦃DŽ೼䱤ᗻᕾ⦃Ёˈ䌟ؐ乎ᑣ⬅⫼᠋ᅮНDŽ೼ぎ䯆FBЁᬃᣕᰒᗻᕾ⦃DŽ䌟ؐ乎ᑣ⬅⫼᠋ᅮН˗ডПˈ⫼᠋ৃᅮН䌟ؐ乎ᑣ˄ҢᎺࠄেˈҢϞࠄϟ˅៪᭄᥂⌕䌟ؐ乎ᑣ˄Ң䕧ܹࠄ䕧ߎ˅DŽWAGO-I/O-SYSTEM759WAGO-I/O-PRO32乎ᑣ㸼96WAGO-I/O-SYSTEM759WAGO-I/O-PRO32খ㗗᭛⤂9721খ㗗᭛⤂21.1㣅᭛R.W.Lewis“ProgrammingindustrialcontrolsystemsusingIEC1131-3”TheinstitutionofElectricalEngineers,LondonISBN0-8529695-0-3;PleasenoteUPDATEDIN1997Dr.Monari,Prof.BonfattiandDr.Sampieri“IEC1131-3ProgrammingMethodology”SoftwareengineeringmethodsforindustrialautomatedsystemsISBN2-9511585-0-521.2ᖋ᭛Hans-JoachimAdam,MathiasAdam“SPS”ProgrammiereninAnweisungslistenachIEC1131-3ElektorVerlag,AachenISBN3-89576-048-XKarl-HeinzJohn,MichaelTiegelkamp“SPS-ProgrammierungmitIEC1131-3KonzepteundProgrammiersprachen,AnforderungenanProgrammiersysteme,EntscheidungshilfenSpringerVerlagBerlinHeidelberg1997ISBN3-540-62639-5WAGO-I/O-SYSTEM759WAGO-I/O-PRO32খ㗗᭛⤂98PeterNeumann,EberhardE.Grötsch,ChristophLubkoll,RenéSimon“SPSStandard:IEC61131”ProgrammierunginverteiltenAutomatisierungssystemenR.OldenbourgVerlagMünchenWien1998,ISBN3-486-27005-2VDE-Schriftenreihe-Normenverständlich“IEC61131-3-Wozu?”I.Rolle(Hrsg.)A.Lehmann,H.-P.Otto,L.Trapp,H.WegmannVDE-Verlag,BerlinISBN3-8007-2309-3PeterWratil“ModerneProgrammiertechnikfürAutomatisierungssysteme”EN61131(IEC1131)verstehenundanwendenVogelVerlagWürzburg1996ISBN3-8023-1575-821.3㔥ഔᴃ䇁㸼9922ᴃ䇁㸼㒱ᇍഄഔ(AbsoluteAddress)Փ⫼⡍⅞ᄫヺІᴹ㸼⼎ऩ⣀ⱘݙᄬऩܗ˖㄀ϔϾᄫヺ˖ⱒߚো˄%˅㄀ѠϾᄫヺ˖ഄഔऎ˄I=䕧ܹഄഔऎˈQ=䕧ߎഄഔऎˈM=ݙᄬഄഔऎ˅㄀ϝϾᄫヺ˖ݙᄬ䭓ᑺ˄X=ԡˈB=ᄫ㡖ˈW=ᄫˈD=ঠᄫ˅᳔ৢᄫヺ˖ഄഔ՟བ˖%IX4.15䜡㕂˄Configuration˅1ϾPLC㋏㒳ⱘ᳔催㑻߿ˈࣙ৿1Ͼ៪㢹ᑆϾ䌘⑤DŽ᭄᥂㉏ൟ˄Datatype˅⫼ѢᅮНব䞣ⱘⳌ݇ሲᗻˈ՟བ᭄ؐ㣗ೈϢԡⱘ䭓ᑺDŽໄᯢഫ˄Declarationblock˅POUЁব䞣ⱘໄᯢ䚼ߚࣙ৿᠔ໄᯢⱘব䞣߫㸼DŽᇐߎ᭄᥂㉏ൟ˄Deriveddatatypes˅ᰃ෎Ѣ෎ᴀ᭄᥂㉏ൟⱘ㞾ᅮН᭄᥂㉏ൟDŽ෎ᴀ᭄᥂㉏ൟ˄Elementarydatatypes˅ヺড়IEC61131-3ᷛޚⱘ乘ᅮН෎ᴀ᭄᥂㉏ൟDŽՓ㛑䕧ܹ˄ENInput˅೼Փ⫼ẃᔶ೒LD៪ࡳ㛑ഫ೒FBD㓪⿟ᯊˈ⫼ѢPOUⱘՓ㛑䕧ܹッDŽᔧՓ㛑䕧ܹッⱘ᭄ؐЎTRUEᯊˈ䆹POUᠻ㸠DŽWAGO-I/O-SYSTEM759WAGO-I/O-PRO32ᴃ䇁㸼100FBࡳ㛑ഫ˄FunctionBlock˅ⱘ㓽ݭFBD⿟ᑣ䆒䅵䇁㿔-ࡳ㛑ഫ೒˄FunctionBlockDiagram˅ⱘ㓽ݭࡳ㛑ഫᅲ՟˄FBinstance˅ᰃࡳ㛑ഫⱘ㒧ᵘ᭄᥂ഫⱘ໡ࠊˈҢ㗠ܕ䆌ᇍᏆ㒣߯ᓎⱘ㒧ᵘ˄՟བˈᷛޚࡳ㛑ഫ˅ҹϡৠⱘখ᭄䖯㸠໮⃵Փ⫼DŽ᭄᥂ഫݙ䚼ᄬټⴔࡳ㛑ഫⱘݙ䚼᭄ؐϢ⢊ᗕDŽඳ˄Field˅Ⳍৠ᭄᥂㉏ൟⱘϔ㋏߫ܗ㋴DŽᷛ䆚˄Flag˅⠽⧚ഄഔᄬټऎFUNࡳ㛑˄Function˅ⱘ㓽ݭFunctionࡳ㛑POUˈⳌৠⱘ䕧ܹؐᘏᰃ៤⫳Ⳍৠⱘ㒧ᵰ˄԰Ў䖨ಲؐ˅ˈ↣⃵䇗⫼ৢϡֱᄬЎሔ䚼ব䞣DŽFunctionblockࡳ㛑ഫPOUˈᠻ㸠ᯊӮᕫࠄϔϾ៪໮Ͼ᭄ؐˈৃҹ԰ЎϔϾሔ䚼ব䞣˄“ݙᄬ”˅ֱᄬDŽFunctionblockdiagram(㓽ݭЎFBD)෎Ѣ㔥㒰೒ᔶˈࣙᣀࡳ㛑੠ࡳ㛑ഫⱘ⿟ᑣ䆒䅵䇁㿔DŽPOUⱘ䘏䕥Ϣ䖤ㅫҹഫ˄Block˅ⱘᮍᓣ㸼⼎DŽIEC61131-3WAGO-I/O-SYSTEM759WAGO-I/O-PRO32ᴃ䇁㸼101Ң1993ᑈᓔྟⱘ݋᳝PLCࡳ㛑ⱘ⦄ҷ㋏㒳ⱘ೑䰙ᷛޚˈᰃ෎Ѣϔ⾡㒧ᵘ࣪ⱘ䕃ӊ῵ᓣˈᅗᅮНњϔ㋏߫催ᗻ㛑ⱘ㓪⿟䇁㿔⫼Ѣ৘⾡㞾ࡼ࣪ӏࡵDŽIL⿟ᑣ䆒䅵䇁㿔-䇁হ㸼˄InstructionList˅ⱘ㓽ݭInstructionlist˄㓽ݭЎIL˅ᑨ⫼ᑓ⊯ⱘ෎Ѣ᭛ᴀ䇁㿔ⱘPLC⿟ᑣ䆒䅵䇁㿔ˈ䖥ԐѢ∛㓪䇁㿔(ϢStep5/Step7㉏Ԑ)I/OperipheryϔϾ㡖⚍Ёᏺ⠽⧚䖛⿟᯴ڣഄഔⱘ䕧ܹ䕧ߎ῵ᵓDŽLadderDiagram˄㓽ݭЎLD˅෎Ѣ೒ᔶⱘ⿟ᑣ䆒䅵䇁㿔ˈ݊ॳ⧚ᰃ⫼㾺⚍੠㒓೜ⱘ⬉ᄤಲ䏃ᴹ㸼⼎䖲᥹DŽLD⿟ᑣ䆒䅵䇁㿔-ẃᔶ೒˄LadderDiagram˅ⱘ㓽ݭPLCৃ㓪⿟䘏䕥᥻ࠊ఼˄ProgrammableLogicController˅㓽ݭDŽPOULibraryϔ㒘POUⱘ䲚ড়ˈ⫼Ѣ㓪⿟Ҏਬᇍ᥻ࠊ⿟ᑣⱘ߯ᓎDŽPROG⿟ᑣ˄PROGRAM˅ⱘ㓽ݭDŽProgram⿟ᑣᰃ᳔催ㄝ㑻ⱘPOUˈ೼⿟ᑣЁৃҹ䇗⫼ࡳ㛑੠ࡳ㛑ഫDŽ⿟ᑣⱘᠻ㸠ᯊ䯈ḍ᥂ӏࡵᴹ⹂ᅮDŽWAGO-I/O-SYSTEM759WAGO-I/O-PRO32ᴃ䇁㸼102ProgrammableFieldbusControllerৃ㓪⿟⦄എᘏ㒓᥻ࠊ఼-WAGOᏺPLCࡳ㛑ⱘ⦄എᘏ㒓䗖䜡఼ˈ⫼Ѣ-ֵোⱘ乘໘⧚-䇈ᯢ⦄എᘏ㒓ᬙ䱰ᚙމϟⱘডᑨ-ߚᏗᓣᱎ㛑䆒໛ProgrammableLogicController˄㓽ݭЎPLC˅⫼ѢᎹϮ㞾ࡼ㋏㒳Ё᥻ࠊǃ䇗㡖ǃⲥ㾚ǃৃ㾚࣪ҹঞ᭄᥂䞛䲚੠᭄᥂໘⧚ⱘ䚼ӊDŽProjectࣙᣀϔϾ᥻ࠊ⿟ᑣⱘ᠔᳝ᇍ䈵˄POUǃ᭄᥂㉏ൟǃৃ㾚ᗻ࣪ܗ㋴ǃ䌘⑤Ϣᑧ᭛ӊ˅DŽ䌘⑤˄Resource˅䜡㕂䇁㿔ܗ㋴ˈ䌘⑤ᰃ⬅ӏࡵ੠⿟ᑣߚ䜡ⱘDŽSequentialFlowDiagram˄㓽ݭЎSFD˅乎ᑣ⌕⿟೒⿟ᑣ䆒䅵䇁㿔ˈ೼⿟ᑣЁᦣ䗄ϡৠࡼ԰ⱘᯊ䯈乎ᑣDŽSFC乎ᑣ⌕⿟೒˄SequentialFlowChart˅ⱘ㓽ݭDŽST㒧ᵘ࣪᭛ᴀ˄StructuredText˅ⱘ㓽ݭDŽᷛޚࡳ㛑ഫ˄StandardFunctionblocks˅⬅IEC1131-3ᅮНⱘ⒵䎇᥻ࠊ㋏㒳Џ㽕᥻ࠊ㽕∖ⱘࡳ㛑ഫDŽWAGO-I/O-SYSTEM759WAGO-I/O-PRO32ᴃ䇁㸼103ℹ˄Step˅೼SFC⿟ᑣЁ⫼Ѣࣙ৿ᣛҸⱘऎඳDŽᔧ䆹ℹ㹿▔⌏ᯊˈ݊ᣛҸ㹿ᠻ㸠DŽStructuredText˄㓽ݭЎST˅ࣙ৿ϔ㋏߫ᣛҸˈᠻ㸠ᮍᓣ㉏Ԑᷛޚ䇁㿔˄՟བPascal˅ⱘ⿟ᑣ䆒䅵䇁㿔DŽ՟བ߸ᮁ䇁হ(IF...THEN...ELSE)៪ᕾ⦃䇁হ(WHILE...DO)DŽӏࡵ˄Task˅⫼ѢᅮН⿟ᑣ੠ࡳ㛑ഫⱘᠻ㸠DŽ䕀ᤶ˄Transition˅ձ᥂䕀ᤶ⢊ᗕˈҢϔϾSFCℹ䕀ᤶࠄϟϔℹDŽ䕀ᤶᴵӊ˄Transitionconditions˅೼SFC⿟ᑣЁᠻ㸠ϟϔℹⱘᴵӊ(Ꮧᇨؐ)DŽব䞣˄Variable˅䗮䖛ব䞣ໄᯢˈҹᶤϔϾ᭄᥂㉏ൟ᠔ᅮНⱘࣙ৿᭄ؐⱘ᭄᥂ᄬټऎDŽৃҹ㒭ব䞣ߚ䜡⠽⧚ഄഔ˄䕧ܹǃ䕧ߎǃᷛᖫヺ˅DŽব

1 / 95
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功