1、“ “ Indicates dialog box buttons, tabs, menus etc.Bold Indicates important topics Indicates start/explanation of student activity 5.3.3 Solution StepsWe will be writing some very simple and basic code to run in Program2 in the Sxx_ReactorApp application as an introduction to using the POU editor fun
2、ctions. NOTE! The editor must be in on off-line mode!5.3.3.1 Declare Variables Open Program2 in application Sxx_ReactorApp.1. Make sure that Control Builder M is in offline mode2. Expand the Applications object and select Program2 located under your Sxx_ReactorApp object. You can open the POU for th
3、is program either by double-clicking Program2 or right-clicking and selecting “Editor” from the context menu.3. Locate the available panes, tabs, and menu items to allow you to navigate in the editor window. Declare 4 BoolIO variables called SW1, SW2, SW3, and LAMP1 with no attributes.4. Make sure y
4、ou are selected to the “Variables” tab in the declaration (upper) pane in the POU editor and enter the names of the variable in the “Name” column.5. Place your cursor in the DataType column and press and select the data type “BoolIO”.6. Also try selecting the “Insert” Icon on the upper right corner
5、of the POU editor window.7. Delete the retain attributes which by default will be added when creating variables. Select the entire “Attributes” column by clicking on the column header and delete all entries by pressing the “delete” key on the keyboard.8. Or mark with the mouse and right click, selec
6、t “Clear”9. Check the POU for errors. In the tab “check” the 0 Errors, 0 warnings10. Save 5.3.3.2 Writing Logic The logic must valuate three Digital Inputs and set a Digital Output according to the logic diagram below:11. Type the following line directly in the Code Pane area in the editor.Lamp1.Val
7、ue := (SW1.Value AND SW2.Value) OR SW3.Value; 12. The already defined variables can be marked from a list using keyboard Ctrl J The following keyboard code can be used:Ctrl j, arrow down, select SW1, Enter, .(dot), arrow down, select Value, Enter.Arrow down can be replaced by typing the first letter
8、 in the item of the list13. Select the keyboard . (dot) behind the SW1 and the Value will be browsed14. Select the Check Icon in the tool bar: You should get 0 Errors and 0 Warnings.15. Save and close the POU editor.16. Select “Test Mode”. 17. Click the “Continue” button for the On Line Change analy
9、sis dialog and observe that Control Builder enters the “Test” mode18. Check the Message Pane in Control Builder. 19. Take Control Builder to the Off-line mode by pressing the “Stop Test Mode” icon on the toolbar.5.3.3.3 Connecting Variables to IO Channels Connect the three switches on the DI810 modu
10、le to the SW1, SW2, and SW3 variable you created in Program220. Open up the hardware structure in the Control Builder and double click on the DI810 module in the tree:21. Connect the three switches on the DI810 module to the SW1, SW2, and SW3 variables you created in “Program2”. Use the icons in the
11、 upper right corner of the editor to choose variables. Open the tree to view the variables, select the + 22. Save and close the editor when finished.23. Select DO81024. Connect the first channel on the DO810 module to the Lamp1 variable you created in Program2. Check for errors and then save and clo
12、se the editor when finished.25. Download and Go Online. Select “Continue”5.3.3.4 Viewing Code in Online Mode Check Control Builder is in the On-Line mode and open the POU editor for Program 2 and observe the logic is in on-line mode. 26. Manipulate the three switches and observe the light on the IO
13、panel while looking at your logic.27. . Right click on the variable in the Declaration Pane to get information about the variable and also to open the I/O editor. on 28. For information right click at a variable29. Read the information regarding to I/O address and Application30. Select the hardware
14、tab “Status” to view the connections 5.3.3.5 Changing the Online View of Structured Text (ST)31. Select Tools Setup from the program editor menu bar.32. Select radio button for Function Diagram, Select “OK”33. View the logic on-line in the Function Diagram language.34. View the logic on-line in the
15、Ladder language.35. Change a switch at the panel.36. Change the view back to Text.Forcing IO37. Open the hardware editor screen for the DI810 module by right-clicking the SW1 variable in the program editor and selecting “I/O Editor” from the context menu.38. Select the “Status”, and force one or more variables. Observe the resulting changes in your Program2 editors code pane as you force and release forces on variables.
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1