«For Classroom Use Only! Important User Information This documentation, whether, illustrative, printed, “online” or electronic (hereinafter ...»
Note: The Tag Name and Address do not have to match, but it is good programming practice.
8. Click in the Controller field and select PLC-1. This is the controller name defined on the Communication tab.
9. Optionally, enter the tag description.
14. Select the _IO_EM_DO_09 tag and select OK.
15. Type “Motor_Ind” in the Tag Name field.
16. Click in the Controller field and select PLC-1and optionally, enter a description.
18. Save the application by selecting the Save icon ( ) from the toolbar.
Create the Motor Control Screen New applications open with the first screen created. Each screen is created with a default name, Screen_NN, where NN is a number from 1 to 99. The first screen is named Screen_1. You can rename the screen using a maximum of 50 characters.
This is what the Motor Control screen will look like when the following sections are complete.
1. Right-click 1- Screen 1 and select Rename.
3. If the screen tab is not open already, double click the screen icon next to the newly named screen to open it for
editing. It should look similar to this:
Verify the screen border is highlighted (in red) indicating the screen is selected. You can modify screen properties as long as nothing on the screen is selected.
Note: The Properties Window can also be activated by right-clicking on the object, in this case the screen, and selecting Properties. If you wanted to see the Properties of a push button, right-click on that button and select Properties.
5. Set the Horizontal Grid Spacing and Vertical Grid Spacing to 5.
Note: From the Properties Window, the Screen Name can also be edited, among other basic settings. Feel free to take the time to explore.
1. From the Toolbox, locate Momentary Push Button, and drag-and-drop it onto the middle of your screen.
Note: The “Toolbox” is context sensitive. It changes the selection of objects for HMI development versus the controller program development.
2. Double-click the button to open the States editor.
Each row is a state with a default value, text, and other format options. Move the scroll bar to see additional options. It
should look similar to the one shown below:
3. Edit State 1:
Click in the Caption Text field and type “START MOTOR”
4. Edit State 2:
Click in the Text field and type “MOTOR STARTED” Select green as the Background Color Select black as the Caption Text Color.
Check the Caption Font Bold checkbox.
5. Click row 1 so that this is the state displayed on the screen in CCW.
7. Make sure the button is still selected and go to the Properties window. (ViewProperties)
8. Configure the following properties as shown below:
Height: 60 Left: 0 Top: 180 Width: 80 Note: The Top and Left parameters determine the location of the object. The Height and Width parameters determine the size of the object.
The Start Motor button is complete. Next, create the Stop Motor button by using a copy and paste operation.
11. Verify the Start Motor push button is selected.
10. Click the Copy icon ( ) on the toolbar or press the Ctrl+C keys on your keyboard.
11. Click the Paste icon ( ) on the toolbar or press the Ctrl+ keys.
12. Move the pasted button to the right of the original push button.
13. Double click the new button to open the States editor.
14. Edit state 1:
Replace the Caption Text with “STOP MOTOR” Select red as the Background Color Select white as the Caption Text Color Double check the Caption Font Bold checkbox is checked.
15. Edit State 2:
Replace the Caption Text with “MOTOR STOPPED” Select red as the Background Color Select white as the Caption Text Color Double check the Caption Font Bold checkbox is checked.
16. Click row 1 so that this is the state displayed on the screen in CCW.
17. Click OK when done.
18. Make sure the button is still selected and go to the Properties window.
1. From the Toolbox, scroll down to the Advanced section, and find the Goto Config button. Click and drag it to the center of the screen.
2. Make sure the button is still selected and go to the Properties window.
3. We will use the default colors for the object.
6. Save the application by selecting the Save icon ( ) from the toolbar.
Create a Multistate Indicator The Multistate indicator will show whether the motor is running or stopped. You will be creating the indicator.
1. From the Toolbox, locate the Multistate Indicator object listed in the Display section.
2. Drag the object into the center of the screen.
3. Double-click the object to open the States editor. The indicator is created with five states. This lab only uses two.
1. From the Toolbox, locate the Numeric Entry object.
2. Drag the object into the space above the Multistate Indicator.
3. Make sure the button is still selected and go to the Properties window.
4. Configure the following properties as shown below:
Height: 60 Left: 100 Top: 15 Width: 110 Write Tag: Motor_On_Time_ms
6. Save the application by selecting the Save icon ( ) from the toolbar.
Generate a Report In this section, you will learn how to generate a report. It provides detailed information about the PanelView Component application.
1. Go to the Settings tab of the PanelView Component. If it is not open, double click the Motor Starter icon in the Project Organizer.
2. Click the Generate Report button.
3. A pop up window will appear with the results of the report.
5. Give the file a name and save it to the desktop.
6. Once the file has been saved, locate it on the desktop. Open the file and view the report in the preferred format.
Notice the report provides images of all the screens in the application, a list of tags used, all the settings configured for the controller, as well as data usage and much more.
74 of 88 Validate and Transfer the Application to the Terminal Before you run an application on the PanelView Component, it is strongly recommended that you validate the application for errors and warnings. The application does not need to be error-free to run, however, it is good practice to fix both errors and warnings to ensure expected system behavior.
1. Right-click on the MotorStarter icon in the Project Organizer and select Validate.
2. The Validation Results window opens.
3. Correct any errors if desired, and close the Validation Window.
4. Re-validate the application after the errors have been fixed.
Warnings still may exist, however they can be ignored as they are not functionality errors. Move onto the next step.
5. Right-click on the MotorStarter icon.
6. Select Download
8. The Output window will show the progress of the download. Ensure the application downloads successfully before moving forward.
9. Turn to your PanelView Component terminal. It should be on the Main screen.
10. Select the File Manager button.
11. Scroll through the list of applications using the arrow keys to find the MotorStarter application you created.
12. Select Run. If prompted with a warning, select Yes (F1).
13. The application will load. Select the START MOTOR button, and let the motor run. Notice the Multistate Indicator you created now says “Running”.
14. Select the STOP MOTOR button.
15. Select the Numeric Input button you created, enter “5000” into the keypad, and press Enter.
16. Select the START MOTOR button again. Watch the motor run for 5 seconds then stop. Feel free to explore some more.
25. To exit the application, select the CONFIG SCREEN button. This will bring you back to the File Manager screen.
In this section of the lab, you will learn about User Defined Function Blocks (UDFBs) - how to create one using Structured Text and how to password protect it using Connected Components Workbench Developer Edition.
A User Defined Function Block is a user defined program that can be packaged into an Instruction Block and reused within your Micro800 project. A UDFB can be written in Ladder, Function Block, or Structured Text.
You will be creating a UDFB to calculate the volume of a cylinder based on an inputted radius and height value.
1. In your current project, right click User-Defined Function Blocks and select Add New ST: Structured Text.
5. Create the following variables. Take careful note to properly configure the Direction property. This property defines whether the variable is an Input, Output, or standard Variable.
7. Add the following line of code to the program.
Volume := 3.14 * Radius * Radius * Height;
8. You have completed creating your UDFB.
9. Save your program.
11. Open the Local Variables for the Tank_Volume program, and create the following variables. Notice the Data Type for the variable Calc_Tank_Volume is the Calc_Volume UDFB you created.
15. Save your project.
16. Build and download your program to your Micro850 controller.
17. Once your download is complete, press the F5 key to enter Debug Mode.
18. Open the Local Variables of your Tank_Volume program, and set the value of Radius to 5, and Height to 10.
Now that you have proved out the functionality of your UDFB, you may want to password protect it, especially if you are trying to prevent disclosure of any proprietary algorithms you may have used. Starting with version 6.0 of Connected Components Workbench – Developer Edition, you may password protect individual UDFBs and programs so that the logic cannot be viewed without knowing the password.
23. Right click on the Calc_Volume UDFB and select Password.
24. Enter from one to eight alpha-numeric characters into the New Password field, then re-type it in the Confirm Password field and click OK.
25. Notice that the Calc_Volume UDFB now has a padlock showing on its icon to indicate that it has been password protected.
Note that although you need Developer Edition to add or remove password protection for programs and UDFBs, you may still enter passwords using Standard Edition in order to access password-protected files.
Congratulations!! You have now completed the Basic PLC Programming with Micro800™ Controller Family lab!