0% found this document useful (0 votes)
289 views

CCW Basics and The Micro 830

This document provides instructions for several labs using Connected Components Workbench (CCW) and the Micro830 programmable logic controller. The first lab describes how to connect the Micro830 controller to CCW via USB and create a new project. The second lab demonstrates how to program a basic motor start/stop ladder logic routine in CCW, including adding contacts and coils, assigning variable names, and modifying contact properties. It also provides instructions for adding alias names to I/O variables to aid in programming and troubleshooting.

Uploaded by

Ravi Negi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views

CCW Basics and The Micro 830

This document provides instructions for several labs using Connected Components Workbench (CCW) and the Micro830 programmable logic controller. The first lab describes how to connect the Micro830 controller to CCW via USB and create a new project. The second lab demonstrates how to program a basic motor start/stop ladder logic routine in CCW, including adding contacts and coils, assigning variable names, and modifying contact properties. It also provides instructions for adding alias names to I/O variables to aid in programming and troubleshooting.

Uploaded by

Ravi Negi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 52

CCW Basics and the Micro 830

2011 6.2
CCW Basics and the Micro830
Hands-On Labs

Training Lab Manual


DOCUMENT CONVENTIONS_____________________________________________________7

CONNECTED COMPONENT WORKBENCH AND THE MICRO800______________________________8

LAB 1: CONNECTING TO THE MICRO 830__________________________________________8

LAB 2: BASIC LADDER WITH CONNECTED COMPONENTS WORKBENCH___________________12

LAB 3 TIPS, TOOLS AND VIEWS IN CCW__________________________________________21

LAB 4 : PROGRAMMING INSTRUCTION BLOCKS_____________________________________31

LAB 5: PLUG-IN MODULES____________________________________________________37

LAB 6: HELP!______________________________________________________________41

LAB 7: PROGRAMMING USING FUNCTION BLOCK DIAGRAMS___________________________44

LAB 8: STRUCTURED TEXT PROGRAMMING________________________________________48

LAB 9: USER DEFINED FUNCTION BLOCKS________________________________________51

Extra Task – If you finish early________________________________________________55

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 5 of 55
Document Conventions

Throughout this workbook, we have used the following conventions to help guide you through the
lab materials.
This style or symbol: Indicates:
Words shown in bold italics Any item or button that you must click on, or a menu name
(e.g., RSLogix 5000 or OK) from which you must choose an option or command. This will
be an actual name of an item that you see on your screen or
in an example.
Words shown in bold italics, An item that you must type in the specified field. This is
enclosed in single quotes information that you must supply based on your application
(e.g., 'Controller1') (e.g., a variable).
Note: When you type the text in the field, remember that you
do not need to type the quotes; simply type the words that
are contained within them (e.g., Controller1).
The text that appears inside of this gray box is supplemental
information regarding the lab materials, but not information
that is required reading in order for you to complete the lab
exercises. The text that follows this symbol may provide you
with helpful hints that can make it easier for you to use this
product. Most often, authors use this “Tip Text” style for
important information they want their students to see.

Note: If the mouse button is not specified in the text, you should click on the left mouse button...

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 7 of 55
Connected Component Workbench
and the Micro800
This lab contains material about a new series of Programmable Controllers (Micro 800) and the
software used to program it. (Connected Components Workbench known as CCW). The lab will
give you objectives, such as to enter a rung of logic, followed by detailed instructions.

CCW is the programming environment for the Micro 800 Series of programmable controllers, PF4
drives, and the Panel View Component operator interface.

Lab 1: Connecting to the Micro 830

In this classroom we are running VMWare images. When using images like this we need to
make sure that all Serial, USB, and Ethernet devices that might be needed are connected to
the “image” and not to the “host” computer.
1. Verify that the Micro830 is connected via USB cable to the PC.

2. Click on VM (found in the center and top of the screen), select Removable Devices and verify
that 2080-LC30 is checked:

3. If 2080-LC30 is not checked, click on Connect (Disconnect from Host):

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 8 of 55
4. Once the Micro830 is “connected”, you should get the following screen. Select No, not this
time and click Next:

5. Click Next again to Install the software automatically (Recommended):

6. Then click Finish

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 9 of 55
7. You are now ready to start the Connected Components Workbench software.

Connecting to the Micro 830 with CCW


8. Click on the CCW icon on your computer desktop or select CCW from Start/Programs/Rockwell
Automation/CCW/Connected Component Workbench to open CCW.

You will see the following window briefly while the software opens showing that CCW
is built on Microsoft Visual Studio.

Then CCW will open..

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 10 of 55
9. Begin a new project by clicking on Catalog and expanding the Controllers folder in the Device
Toolbox, which is located on the right-hand side of the Workbench screen.

10. Double click on 2080-LC30-16QWB

11. A new Micro830 project based on this controller has now been created. The Micro830 should
show up in the Project Organizer on the left-hand side of the Workbench screen

End of Lab1: Connecting to the Micro830 with CCW

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 11 of 55
12.

Lab 2: Basic ladder with Connected Components Workbench


CCW may look a little different from other editors and programming tools you are used to, but the
fundamentals are similar. This lab includes instructions for editing some simple programs, and
shows the features of the software.

The first part of this section will explain how to enter a basic motor start/stop rung as shown below.
Detailed instructions follow on how to enter this rung.

Variables and aliases


The red illuminated push button, located in the top row on the demo case will be used as the stop
button. Its variable name is _IO_EM_DI_00 which means I/O embedded digital input 00. The
alias for this variable, displayed under the variable name is DI0, which matches the label on the
demo

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 12 of 55
Programming in Ladder Diagram
13. Select Programs in the Project Organizer

14. Right click and select New LD: Ladder Diagram

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 13 of 55
15. Double click on your new program, and a blank ladder, with one rung will open in the main
workspace window.

16. Look at the lower right Toolbox window and you should see it is now populated with familiar
ladder elements.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 14 of 55
17. Drag a Direct Contact (N.O) from the Toolbox to the new rung, and drop it on the empty rung.

18. When the Variable Selector opens, click on the I/O –Micro830 tab

19. Assign the variable name _IO_EM_DI_00 to the new contact.

20. Now drop a Direct Coil to represent the motor starter coil on the rung to the right of the contact.

21. When the Variable Selector opens, click on the I/O Micro 830 tab, and assign it the variable
name of _IO_EM_DO_00.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 15 of 55
22. Follow the same procedure again for the start button in this circuit. Assign it the variable name
of _IO_EM_DI_01.

23. To create the “seal in contact” of the motor starter, start by dragging over a branch and
dropping it around the start button you just created.

24. Now create the drag over a Direct Contact .

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 16 of 55
25. Assign the variable _IO_EM_DO_00, to the new contact, which is the address of the coil.

Alias names
It will probably be helpful to be able to use real world names to aid the programming and
troubleshooting process. We can fill in the Alias values for all of the I/O in this table.

When assigning I/O references to contacts and coils, the variable name
(_IO_EM_DI_00) must be used. The alias is actually a symbol, or label used as
an aid in programming and troubleshooting.

26. Double click on Global Variables in the Project organizer tree to see the variable table.

27. Fill in the Alias names as shown below in the Variable table

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 17 of 55
Changing properties of the ladder elements

Look at the above ladder. It looks like we may have a small mistake that needs to be corrected. On
the demo case, the red push button DI0 is wired to the input of the Micro 830 using its “normally
open” contacts. In order for this simple program to work, we will need to change the Direct Contact
to a Reverse Contact. (normally open to normally closed)

28. To make this change right click on the _IO_EM_DI_00 contact and select properties.

29. Then using the drop down at the end of the Modifier line in the Properties window change to
ClosedContact.

Now the program should work!

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 18 of 55
Build, Save, Download, and Debug functions
You must perform a “Build” operation before you can download to the controller.

30. To initiate a “Build” operation to verify, and compile the program, click on the Build icon in the
toolbar. You will find “Build” in other menu locations, but the toolbar icon is conveniently
located.

31. After the Build is complete, with no errors shown in the Output pane, the Download button will
be available. Save, then Download your new program by clicking on the Download button.

If your controller is in “Remote” then the controller must be stopped to download…. You know what
to do.

32. Next click on the Debug (play) icon, next to the Build icon, to view your program in a “monitor
mode” environment.

Notice that the program shows individual contact status and power flow. The reverse contact of DI0
is closed so its status and the possible paths to the right are highlighted.
33. If you push DI0 and DI1, opening DI0 and closing DI1 you will see just the closed contact status
without powerflow.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 19 of 55
34. Push the “start” button and you should see the following

The output is on, and DI1 has been closed, and opened.

35. Push the “Stop Debugging” icon to return to program mode.

End of Lab2: Basic Ladder programming with CCW

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 20 of 55
Lab 3 Tips, tools and views in CCW
You have already seen how the Toolbox displays ladder tools when you are programming in ladder.
Latter in the lab this toolbox will display Function Block, or Structured Text elements when we
programming in those languages.
CCW has more ways that can be used to modify the layout of the screen, or change how data is
entered.

Faster editing
As you have seen, each time you drop a contact or other element on the ladder, you are prompted
to select its address, as shown below.

You might be able to work faster if you don’t have to stop…just keep drawing the ladder, and add
the addresses latter. There is a quick edit mode that will allow you to do that.
Variable Selector Manual Mode
36. Turn on Manual Variable Selector Mode by holding down the Control key while you push R.
(Control R)

37. Add some more contacts to the right of the start button as shown below. Notice that you are not
stopped each time and prompted to enter the variable name. You may have to scroll left and
right to see them all.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 21 of 55
Linking program elements to variable names in Manual Variable Selector Mode

38. Use your mouse to hover over the contact until a blue box appears.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 22 of 55
39. Now select any previously configured address from the drop down list and apply it to your
contact. The Manual / Auto status should be displayed in the lower left of your screen.

Scrolling left and right or up and down across a ladder can be annoying. But
all of the windows are really valuable. There are several ways to modify your
view, and reduce the amount scrolling.

Docking
One way to customize the view is by docking the windows in different locations. Let’s try one to see
if its helpful in this situation.

40. Click and hold, on the title bar of the Toolbox window. Drag it to the left, and notice that the
docking arrows appear. Re-dock the Toolbox on the bottom left, below the Project Organizer so
that your screen looks like this:

This might be helpful but the Device Toolbox is still taking up the right side of the screen, and its not
really needed at this time, while editing ladder. You only need it when adding hardware to the
project.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 23 of 55
Tabbed Document view
Sometimes its helpful to put some windows away that are not constantly in use while
programming. You can easily put them “behind” your ladder diagram by using the tabbed
document view.

41. Right click on the title bar of the Device Toolbox to display some other choices.

42. Select Tabbed Document.

Now the Device Toolbox has been moved to a tab in the main window, allowing you to easily switch
between tabs.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 24 of 55
43. Select the ladder tab, and you will see that the editing space is now much larger. The seldom
used Device Toolbox is easily accessible the next time we need to add a controller, drive, or
operator interface to the project.

Auto Hide
44. Move your mouse cursor towards the Toolbox in the lower left window, and hover over the push
pin icon. You will see the tool tip for Auto Hide.

45. Click the push pin to select Auto hide for the Device Toolbox.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 25 of 55
46. To open the Toolbox, hover over the Toolbox icon on the left side.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 26 of 55
There is one more option that may be useful. You decide how you want your screen to look.
Floating toolbars
Windows can be set to float, making them always available yet able to be moved out of the way so
they don’t hide important information.

47. Click the icon to undock the Toolbox.

48. Right click in the Toolbox title bar and select the Floating option this time.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 27 of 55
Changing your view summary
All of the windows have the option to be:

 Hidden (window becomes accessible only from the View dialog)

 Auto Hidden (with the push pin)

 Floating

 Docked

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 28 of 55
49. Re-dock the Toolbox, so it is easy to use, while learning this new software!

50. Resize the Toolbox after it is docked so that you can see Pointer at the top of the list, and Block
at the bottom, without scrolling.

Now that the view is better, lets do some more programming. Those extra contacts we put in
need to be deleted.
51. Left click to select the contact which will display a green box.

52. Then right click and select “Delete” from the menu.

53. Or simply using the Delete key on the computer keyboard.

54. Delete the other contacts as well so that your program looks like this:

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 29 of 55
End of Lab 3: Tips, tools and views in CCW

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 30 of 55
Lab 4 : Programming Instruction Blocks
In this section you will add a counter to the logic, that will count up each time the DO0
output energizes.
You will be adding the following rung to your program:

Detailed steps to add the counter logic


As you can see from the above rung, two new variables will need to be created for the preset
value(PV) and the counter value(CV). Although these could be added using the Auto
Variable mode as the ladder is entered, this time we will pre enter the variables, which
always makes the programming itself a little easier.

Creating variables to be used to hold the preset value, and counter (accumulated) value.

55. Double click on Local Variables for your ladder to open the variable editor
In the name field enter StartCountPV as the name of the new variable. This will be used for the
preset of the counter.
56. Change the Data Type to DINT for StartCountPV

57. Set the Initial Value of the StartCountPV to 5. The counter will have a preset value of 5 in this
lab.

58. Next add StartCountCV for the counter variable on accumulator of the counter.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 31 of 55
5

59. Select the to return to your ladder.

60. Drag a new Rung from the Toolbox to the ladder editing window.

61. Drag a “Block” instruction from the Toolbox to the new rung

Blocks?

All special functions, like timers, counters, math and comparisons are known as
“Instruction Blocks”. First the block must be dropped on the ladder, then the specific
type of block will be assigned.

62. Double click on the block to open the Instruction Block Selector window

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 32 of 55
63. Program blocks are accessed from this selector. Scroll up and down the list to view the rich
instruction set in this “simple”, Micro 830.

64. Type “ct” as shown in the name field as shown below and the available counters will be filtered
and displayed.

65. Double click on CTU to add the up counter to the rung as shown.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 33 of 55
The block has several variables associated with it. Note the yellow triangles indicating a portion
of the program that must be completed.

66. The counter needs to count each time the DO0 energizes. Add a contact of DO0,
(_IO_EM_DO_00) to the CU “count up” line as shown.

67. Micro 800s use a reset input to reset the counter to zero. In this lab you will use DI 2, the green
button, to reset the counter. Click on the top of the RESET box to link _IO_EM_DI_02 to
RESET.

68. Click on the top of the PV input block to open the Variable Selector. If you had not already
created this variable, you would have had to do it now.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 34 of 55
69. Click OK

70. Double click on the CV output block, and select the variable StartCountCV and the counter
value will be held in this variable. (Again, you created this variable at the top of this section)

Q?

Q is the symbol for outputs in IEC61131 languages like CCW.


For the CTU counter, Q will become true when PV > CV

71. Add a coil to turn on the D I2 (_IO_EM_DO_01) light as shown. The completed rung should
look like this.

Testing the program

72. Build, save, and download to your controller.

73. Go to Debug to monitor your program using the “play” button on the menu above.

74. Verify rung 1 as follows: Push DI 1 which will energize DO0.


Turn Off DO 0 off by push using DI 0.

75. Each time DO0 transitions from Off to On, the counter will count up by 1. Verify this by checking
the CountStartsCV value.
When the CV is equal to or greater than the PV, the output of the counter block will turn on.

76. Reset the counter value to zero using DI 2.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 35 of 55
77. Take CCW out of debug by pushing the square “stop” icon located next to the debug icon in
the CCW toolbar.

In this section of the lab you have:


 Entered a simple ladder diagram including a relay and timer
 Created variables
 Learned how to use the debug monitor mode function.

Experimented with rearranging the view by docking, floating, hiding, or adding tabs

End of Lab 4: Instruction Bocks

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 36 of 55
Lab 5: Plug-In Modules

Plug-Ins are a new type of hardware for the Micro 800 family. These modules can customize the
personality of the Micro, by adding I/O or communication options without changing the footprint of
the unit, like traditional expansion I/O would.

The Micro 830 in the demo box is equipped with a serial communications plug-in on the left, and an
analog input plug-in on the right. Both must be configured in CCW before use.

RIUP

Warning

Plug ins are NOT to be Removed and Inserted under power


unless specifically noted !

Micro 800 Plug-In Modules

Category Catalog Number Description Controller Support

2-ch Analog Input, 0-20mA,


2080-IF2 Micro810,Micro830,Micro850
0-10V,non-isolated 12-bit

4-ch Analog Input, 0-20mA,


Analog I/O 2080-IF4 Micro810,Micro830,Micro850
0-10V,non-isolated 12-bit

2-ch Analog Output, 0-20mA,


2080-OF2 Micro810,Micro830,Micro850
0-10V,non-isolated 12-bit

2080-TC2 2-ch TC, non-isolated, 1C Micro810,Micro830,Micro850

Specialty 2080-RTD2 2-ch RTD, non-isolated, 0.5C Micro810,Micro830,Micro850

2080-TRIMPOT6 6-ch Trimpot Analog Input Micro810,Micro830,Micro850

RS232/485 isolated serial


Communications 2080-SERIALISOL Micro810,Micro830,Micro850
port

Project, Data Log, Recipe


2080-MEMBAK-
Backup Memory Backup and High Accuracy Micro830,Micro850
RTC
RTC

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 37 of 55
Hardware configuration
78. Right click on the Micro 830 in the Project Organizer and select Open from the dropdown

The following screen will be displayed showing a graphic view of the hardware configuration for this
project.

From this view the controller can be changed from Run to Program, and you can go offline or
online, and make changes to the hardware configuration.
Adding the 2080-SERIAL-ISOL plug-in module

Right click here

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 38 of 55
79. Right click on the left plug-in, as shown above, and select the communications
2080-SERIALISOL plug-in module from the drop down. This will be used for Modbus RTU
communications to the drive latter on.

80. Now add the 2080-IF4 analog input in the right slot as shown. It needs to be configured as
“Voltage” because it is wired to the ANALOG INPUT pot on the demo, which provides a 0-
10VDC input.

81. Open the Global Variables list from the Project Organizer and you will see that the I/O for the
analog plug-in has been added to the bottom of the list.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 39 of 55
82. Note that the main window now has a tab for Global Variables

End Lab of 5:Plug-In Module configuration

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 40 of 55
Lab 6: Help!

The previous sections on Plug-In modules and program blocks may leave you wanting more information. Fortunately the
interactive Help, installed with CCW provides answers to many of your questions. Make sure you take some time at the
end of this section to more fully explore the Help options.

Using the Search Index


The Micro 800 series is a new product. If you are wondering if there is any pattern to the selection of catalog numbers,
you can look in Help.

83. With CCW open , Click Help, then Index

84. In the Look for: line enter “cat”. You will see catalog numbers filter to the top of the list

85. Click on “understanding” and you can read “About device catalog numbers”

Help for Plug-Ins


86. There were a few fields that were filled in the Plug-Ins lab we might want a little more
information on. This time enter “plug-in” in the Look for: line.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 41 of 55
87. Select “configuring” from the list

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 42 of 55
88. Click on the 2080 IF4 plug-in module from the displayed list to get detailed information on the
configuration parameters of the IF4 plug-in.

89. Take some time and explore Help on your own.


Can you find information on?

 Instruction Blocks

 Details on the embedded I/O

 IPID PID controller

End of Lab 6: Help!

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 43 of 55
Lab 7: Programming using Function Block Diagrams

Eventhough the Micro 830 is a small, inexpensive controller, it has some big system features, such
as Function Block programming.
Creating a new Function Block Diagram
You are going to create a simple FBD program that compares the value of the Analog Input pot to a
preset value. When the value of the pot is greater than or equal to the preset value the red light
DO3 will flash.

90. In the Project Organizer, right click on Programs, click Add, and select New FBD

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 44 of 55
Thinking ahead – adding the variables needed for this program
The comparator and the timer required to blink the light both need variables. These variables could
be added latter, but doing them now will make the programming a little easier.
91. Double click on the FBD Local Variables and add the variables shown below. HiValue will be
used as the output of the comparator, and BlinkerET will be used for the accumulated time of a
timer.

Adding the FBD


92. Double click on Untitled FBD to open the FBD workspace. Notice that the Toolbox now shows
FBD instructions, instead of the ladder elements that were used earlier.

93. Drag a Block in to the work space.

94. Double click on the block and select the Greater Than or Equal To comparator from the list

95. Drop two Variables on the screen and connect them to input 1 and 2 of the >= block as shown

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 45 of 55
Assigning the input blocks to the Plug-In I/O and constant values
96. Left click in the top of the top variable, connected to “i1”, and select the _IO_P2_AI_00 analog
input. (Plug in 2, Analog Input, circuit 00)

There is still a yellow triangle, so there is more work to be done.


97. The lower input variable, connected to “i2” will be a constant value used as the preset of the
comparator. Click in the top of the variable symbol and enter 30000.

98. Add another variable for the output, just as you did for the inputs. Click in the top of the symbol,
and link it to the variable HiValue that you created earlier.

The output HiValue will become true when _IO_P2_AI_00 is greater than or equal to the preset of 30000.

16 bit resolution analog inputs

The range of this analog is input is 0-65535, with 0 = 0 volts, and 65535 = 10 volts.
So the smallest resolution of voltage is 1/65535 X 10V or about .00015 volts/ “count”

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 46 of 55
Adding the flasher

The TONOFF instruction block is an on delay/ off delay timer that is perfect for the flashing light in
this example.
99. Add another Block to your program space to the right of the comparator and define it as a
TONOFF.

100. Set both presets, PT (on delay) and PTOF (off delay) to 1 second using the value of “T#1s”
as shown.

101. Assign the variable you created called BlinkerET to the elapsed time (ET) output.

This language actually supports a mix of Ladder and Function Block. The Q output is connected to
DO3, which is the red light in the bottom row on your demo.
102. To make DO 3 blink, drop a reverse contact from DO3, just like you would do in a ladder
diagram, and use it to connect the Q output of the >= function, and the Input of the TONOFF.

When DO3 is NOT on and the contact is closed, the timer will start its on delay cycle. When the
contact opens by DO3 energizing, the timer will start its off delay cycle. As long is HiValue is high,
or on, or a “one”, the DO3 light will blink.

103. Build, Save, and Download your program.

104. Switch to Debug and watch it run while turning the Analog Input pot, up and down.

End of Lab 7: Function Block Diagram Programming

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 47 of 55
Lab 8: Structured Text Programming

Our customers may have a need, or simply prefer to work in one or more languages. Structured
Text is easily programmed in CCW. Here is a simple example that turns lights on or off lights
based, once again, on the Analog Input pot.

Here’s the code that will be entered so you see where we are headed. Detailed instructions follow.

If the value of the pot is less than 2000 DO5 will light. If its between 2000 and 4000, then DO4 will
light.

105. Right click on Programs in the Project Organizer, then Add, a new Structured Text program.

106. Double click in the new ST program in the list and a ST work space will open, and this time
the Toolbox will show ST tools.

107. Enter IF on Line 1, and you should see a pop as follows with reserved words.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 48 of 55
108. Finish selecting or typing IF

109. When you enter the starting underscore of the variable name, you will get the familiar drop
down with the variable names.

110. Select the analog input _IO_P2_AI_00

111. Complete entering the line: < 20000 THEN

Notice how the keywords and values are show in different colors

112. Complete the rest of the code as shown to turn on DO 5.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 49 of 55
113. Enter the code for next section that turns DO4 on as shown below.

114. Build, save, and download your program

115. Verify that your program works correctly

End of Lab 8: Structured Text

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 50 of 55
Lab 9: User Defined Function Blocks
User Define Function Blocks or UDFB allow a customer to create a library of custom routines that
can be used to simplify the programming process.

116. Because there are a limited amount of field devices on the Micro 830 demo, start by
deleting all of the POU (Program Organizational Units) that you have created so far. Then we
can easily reference the same I/O with out worry of a conflict.

117. When you have deleted the old programs from your project you will need to create two new
Programs as shown below.

A_LD_Count will be used to hold an instance of the UDFB created in A_Start_Count.


A_Start_Count is where we will develop our own Program Block.

The program block will work much as the ladder did that was developed earlier. It will count each
time the motor starter starts.
Local Variables will be used in the ladder rather than I/O addresses.

118. Double click on the Local Variables under A_Start_Count and enter the following. Pay
attention to Data Type, Direction, and the Initial Value columns.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 51 of 55
119. From the Control-R mode, create the following ladder. (In Control-R, you will not have to
create the variable names until you are complete)

120. Apply the variable names as shown above to the ladder as you did earlier.

121. Build, Save and Download the project to the controller

The User Defined Function Block is complete. Next you will use it in a program, and relate I/O
references and other variables to the variables inside the block.

Using your UDFB in a ladder program

122. Open the program A_LD_Count by double clicking on it

123. Drag a Rung, and a Block to the workspace from the Toolbox as shown below

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 52 of 55
124. Double click on the block you just created

125. Scroll down to the Name of the UDFB just created, A_Start_Count.

126. Double click on it and this UDFB will now be treated like any other Program Block, such as a
math function or timer.

127. Now the new UDFB has been placed on the ladder diagram. Variable names need to be
linked to the variables that are used inside the block.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 53 of 55
128. Add the contacts and coils that are tied to real world I/O first. Use the addresses as shown
below.

DI 1 is the Start PB
DI 0 is the Stop PB
DI 2 is the Reset PB

Adding the other variables for PV, CV, and the Counter Done.

129. Double click in the PV input box to open the Variable Selector.

130. Enter both the PV, and CV variable names as shown. (If you decide to add another block
latter , you can call them: B_PV, and B_CV.

131. Now add the Variables for the grey colored boxes. Hover over the UDFB, and you will see
that the top one needs linked to the CV, and the bottom will be the “done” bit.

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 54 of 55
132. Build and Download your program.

133. Test your program. The yellow button in the top row should turn on DO 0, turn it off with the
red button.

The yellow light should come on after five “starts” reset it with the green button, DI 2.

End of Lab 9: UDFB

Extra Task – If you finish early

134. Try to use your UDFB in the a new Function Block Diagram program

End of HOTT CCW Basics Labs

HOTT Labs: CCW Basics and the Micro 830: 2011-6.2

Page 55 of 55

You might also like