T31505 Solution 53RevCd1文档格式.docx

上传人:b****3 文档编号:18412855 上传时间:2022-12-16 格式:DOCX 页数:15 大小:501.60KB
下载 相关 举报
T31505 Solution 53RevCd1文档格式.docx_第1页
第1页 / 共15页
T31505 Solution 53RevCd1文档格式.docx_第2页
第2页 / 共15页
T31505 Solution 53RevCd1文档格式.docx_第3页
第3页 / 共15页
T31505 Solution 53RevCd1文档格式.docx_第4页
第4页 / 共15页
T31505 Solution 53RevCd1文档格式.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

T31505 Solution 53RevCd1文档格式.docx

《T31505 Solution 53RevCd1文档格式.docx》由会员分享,可在线阅读,更多相关《T31505 Solution 53RevCd1文档格式.docx(15页珍藏版)》请在冰豆网上搜索。

T31505 Solution 53RevCd1文档格式.docx

““Indicatesdialogboxbuttons,tabs,menusetc.

BoldIndicatesimportanttopics

Indicatesstart/explanationofstudentactivity

5.3.3

SolutionSteps

WewillbewritingsomeverysimpleandbasiccodetoruninProgram2intheSxx_ReactorAppapplicationasanintroductiontousingthePOUeditorfunctions.

NOTE!

Theeditormustbeinonoff-linemode!

5.3.3.1DeclareVariables

☞OpenProgram2inapplicationSxx_ReactorApp.

1.MakesurethatControlBuilderMisinofflinemode

2.ExpandtheApplicationsobjectandselectProgram2locatedunderyourSxx_ReactorAppobject.YoucanopenthePOUforthisprogrameitherbydouble-clickingProgram2orright-clickingandselecting“Editor”fromthecontextmenu.

3.

Locatetheavailablepanes,tabs,andmenuitemstoallowyoutonavigateintheeditorwindow.

Declare4BoolIOvariablescalledSW1,SW2,SW3,andLAMP1withnoattributes.

4.Makesureyouareselectedtothe“Variables”tabinthedeclaration(upper)paneinthePOUeditorandenterthenamesofthevariableinthe“Name”column.

5.PlaceyourcursorintheDataTypecolumnandpress<

CTRL-J>

andselectthedatatype“BoolIO”.

6.Alsotryselectingthe“Insert…”IconontheupperrightcornerofthePOUeditorwindow.

7.

Deletetheretainattributeswhichbydefaultwillbeaddedwhencreatingvariables.

Selecttheentire“Attributes”columnbyclickingonthecolumnheaderanddeleteallentriesbypressingthe“delete”keyonthekeyboard.

8.Ormarkwiththemouseandrightclick,select“Clear”

9.

CheckthePOUforerrors.Inthetab“check”the0Errors,0warnings

10.Save

5.3.3.2

WritingLogic

☞ThelogicmustvaluatethreeDigitalInputsandsetaDigitalOutputaccordingtothelogicdiagrambelow:

11.TypethefollowinglinedirectlyintheCodePaneareaintheeditor.

Lamp1.Value:

=(SW1.ValueANDSW2.Value)ORSW3.Value;

12.

ThealreadydefinedvariablescanbemarkedfromalistusingkeyboardCtrlJ

Thefollowingkeyboardcodecanbeused:

Ctrlj,arrowdown,selectSW1,Enter,

.(dot),arrowdown,selectValue,Enter.

Arrowdowncanbereplacedbytypingthefirstletterintheitemofthelist

13.Selectthekeyboard.(dot)behindtheSW1andtheValuewillbebrowsed

14.Selectthe‘Check’Iconinthetoolbar:

Youshouldget0Errorsand0Warnings.

15.SaveandclosethePOUeditor.

16.

Select“TestMode”.

17.Clickthe“Continue”buttonfortheOnLineChangeanalysisdialogandobservethatControlBuilderentersthe“Test”mode

18.ChecktheMessagePaneinControlBuilder.

19.

TakeControlBuildertotheOff-linemodebypressingthe“StopTestMode”icononthetoolbar.

5.3.3.3ConnectingVariablestoIOChannels

☞ConnectthethreeswitchesontheDI810moduletotheSW1,SW2,andSW3variableyoucreatedinProgram2

20.OpenupthehardwarestructureintheControlBuilderanddoubleclickontheDI810moduleinthetree:

21.

ConnectthethreeswitchesontheDI810moduletotheSW1,SW2,andSW3variablesyoucreatedin“Program2”.Usetheiconsintheupperrightcorneroftheeditortochoosevariables.Openthetreetoviewthevariables,selectthe+

22.

Saveandclosetheeditorwhenfinished.

23.SelectDO810

24.ConnectthefirstchannelontheDO810moduletotheLamp1variableyoucreatedinProgram2.Checkforerrorsandthensaveandclosetheeditorwhenfinished.

25.DownloadandGoOnline.Select“Continue”

5.3.3.4

ViewingCodeinOnlineMode

☞CheckControlBuilderisintheOn-LinemodeandopenthePOUeditorforProgram2andobservethelogicisinon-linemode.

26.

ManipulatethethreeswitchesandobservethelightontheIOpanelwhilelookingatyourlogic.

27..

RightclickonthevariableintheDeclarationPanetogetinformationaboutthevariableandalsotoopentheI/Oeditor.on

28.

Forinformationrightclickatavariable

29.ReadtheinformationregardingtoI/OaddressandApplication

30.Selectthehardwaretab“Status”toviewtheconnections

5.3.3.5

ChangingtheOnlineViewofStructuredText(ST)

31.SelectTools>

Setupfromtheprogrameditormenubar.

32.SelectradiobuttonforFunctionDiagram,Select“OK”

33.Viewthelogicon-lineintheFunctionDiagramlanguage.

34.Viewthelogicon-lineintheLadderlanguage.

35.Changeaswitchatthepanel.

36.ChangetheviewbacktoText.

ForcingIO

37.OpenthehardwareeditorscreenfortheDI810modulebyright-clickingtheSW1variableintheprogrameditorandselecting“I/OEditor”fromthecontextmenu.

38.Selectthe“Status”,andforceoneormorevariables.ObservetheresultingchangesinyourProgram2editor’scodepaneasyouforceandreleaseforcesonvariables.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1