|AutomationDirect Live Chat|
Part 4 of 11
Hardware Configuration, Tagnames, and Calculations. Productivity3000
Be More Productive.
Our programming will go quicker if we have our Productivity 3000 hardware configured, and at the same time have a way to easily identify all of our analog and discrete signals. Better yet, lets take our application conditions, and by doing some simple math and scaling calculations, we can put them into units of measure that are easily understood. Before we start the actual programming of our application demo, we need to configure the Productivity 3000 system hardware. With the programming software opened on a personal computer and connected by way of either a USB cable or Ethernet communications, and online with the CPU, open the Hardware Configuration dialog window under the Setup Application Tools tab. Make sure the Productivity 3000 CPU module is in the Stop mode, and then click the Read Configuration button. If any Base or I/O Module Mismatches are reported, click the Yes To All button. After a few moments, the dialog window will report back with all of the attached I/O modules and any other attached hardware. We can now take a look at the P3-550 CPU settings, or any of the I/O module settings by just bringing up the Local Base Group under the PAC Base Groups list. You can also view the LEARN video titled Part 2 How to Configure the Productivity 3000 Programmable Controller for additional details on the Hardware Configuration utility that is built into the Productivity 3000. Lets start our programming by first discussing the various signals we will be using in our application and how we can use Tagnames in our program to reduce programming time. Did I forget to mention that the Productivity 3000 Programmable Automation Controller is a Tagname Based Controller? What does this mean? Well, instead of coded numerical references to the various input and output signals, and internal data registers used in the CPU, we can create descriptive readable names, called Tagnames, to define our I/O points and data variables. Tagnames have the freedom to be defined as any data type. So instead of using different arbitrary blocks of memory for each data type, which wastes memory, we only use what we need. The tagnames can be created and maintained by using the softwares built-in Tagname Database, or created on the fly. Please note that the I/O points are automatically assigned coded numerical names, such as DI-0.1.1.3, which tells us the point for the module is a Discrete Input located in the local base group 0, base 1, slot 1, and is the number 3 input point. We have the ability to rename this I/O point to a descriptive Tagname such as Overflow. If you are use to programming with coded numerical references, such as X42, or V2023, it may take a little getting into using Tagnames, but once you have the hang of it, youll be glad for the convenience, both in programming, and later in troubleshooting your application. Again, we can either use the Tagname Database to create all of the tagnames we will need in our program, thats if we have defined them in our planning stage, or we can create the Tagnames on the fly as we program. Once we have defined and created the various Tagnames within our program, we can then export the Tagnames to make them available for importing later into the C-more Touch Panel program that we will be using in our application. This will both save time, and if you are like me, prevent typos. The file format used in the export is called CSV, or comma separated values, and is a common format that can be opened into a Microsoft Excel spreadsheet, or other similar application. The Tagnames and other details can then be edited, maintained, saved, and imported back into the either the Productivity 3000 or C-more project, which in many cases can be a time saver. OK, lets do our first programming task. It is always easier to work with numbers that have a useful meaning. So lets take the 0 to 10 volt DC analog water level signal from the Ultrasonic Sensor that produces a count range of 0 to 65,535 from the analog input module and convert it to a Process Tank volume shown in gallons. There are some calculations along the way we need to do, and we can make it a little easier by taking advantage of the Productivity 3000s Math Instruction. For reference, the ultrasonic sensor we have selected can measure a distance of 100 to 600 millimeters, or in English units, 3.94 to 23.62 inches. Again, the sensor is mounted through the Process Tanks lid, so keep in mind the Tanks volume relationship to sensor distance is inverted, with the most volume being when the water level is closest to the sensors face, and the sensor is reading the shortest distance. It is also helpful to know that a volume of one gallon equals 231 cubic inches. And, the inside diameter of our 10 gallon process tank measures twelve and one half (12.5) inches. Knowing the height in the process tank that represents one gallon will be useful for our calculations, so we will create our first Tagname, and name it Water underscore Height underscore per underscore Gallon, which is typed into the Result parameter of the Math Instruction described next. Using a standard formula to calculate volume in a cylindrical tank where Volume in cubic inches equals Pi times the tanks radius squared, times the height, and again knowing that one gallon equals 231 cubic inches, we can use the Math Instruction to assign our new Tagname to equal the value 231 divided by Pi times the tanks radius of six and one quarter (6.25) inches squared. Once the Math Instruction is OKd, the programming software is asking us to define the new Tagname. I have assigned it as a Float, 32 Bit Data Type, which is more accuracy then we require, but again the Productivity 3000 only uses memory that has been assigned and does not waste an entire block of memory for one value. Once we have our calculation in the Math Instruction, lets check it by placing the CPU in run mode and taking a look at the result while in Monitor Mode. The result is 1.88236 inches of height per gallon, but for conversational purposes well just say 1.88 inches. As a check, if I measure with a scale between the one gallon graduations on the process tank, I can see to the best of my guesstimate, that this is very close, something like 1.9 inches on my steel scale. In Part 5 we will continue with additional math instructions to calculate where our ultrasonic sensor sees the water level for both the maximum and minimum volumes in our process tank.