Switching to Do-more Saves Time
Almost 14 years ago, I converted the controls in my 80KW hydro electric plant, located in the mountains of western North Carolina, from custom micro-controller cards I developed while at Georgia Tech to the DirectLOGIC DL205 PLC with a D2-260 CPU.
In 2013, it was time to make some upgrades to the plant by adding features such as the ability to control the system over the Internet, improve monitoring, start data logging, and tighten up the code. After working with the Productivity3000 and CLICK series products, DirectSOFT suddenly seemed painful when it came to working with floating numbers, more modular code, time synching, email imports into Google Docs, etc. After reviewing my options, I decided to switch to the Do-more PLC using the H2-DM1E CPU.
Converting the Old program
The first hurdle was converting the old code. The existing program controlled three hydroelectric turbines. The code worked with REAL numbers (metering) and had several stages for controlling each turbine and several more for sensor processing and HMI logic. This made for lots of similar looking code in one big file.
With some of the code, like reading analog to discrete modules, CTRIO cards, and Modbus devices, I knew the conversion would be intuitive with newer instructions, so deleting that code was not a factor.
As it turns out, the Do-more CPU supports most DL205 modules, so no work is required to get data into the PLC from any of those. The SCALE box makes analog to discrete data processing a snap. And the communications interfaces just work, no headaches there.
The problem was the control logic; proven and tweaked over years, I was not looking forward to the down time that would be spent recreating that.
About 90% of the ladder logic for this application was the same from the DirectLOGIC program to the Do-more program, so I was able to start with that much code in the new system before making the necessary changes.
Most LD and OUT sequences were replaced by MOVE instructions and while it would be possible to use all “DL compatible memory”, I also converted 90% of the data storage to the new 32-bit integer or floating point formats during the conversion. Any code I could not convert directly, I simply put in a comment block, disabled the rung, and rewrote with Do-more instructions.
Octal is a Thing of the Past
The Do-more PLC does away with Octal addressing. With the legacy PLCs having to use OCTAL and BCD was difficult. With Do-more, this is fairly simple to fix. First, I imported my I/O point addresses into Do-more. I found this is best done via a spreadsheet because I/O point numbering is now in decimal. This means X10 (OCT) needs to be converted to X8 (DEC). While all the existing I/O modules still work, the I/O points are now numbered in decimal.
Another tip/great conversion tool was provided by Host Engineering: transfer DL compatible memory to a type called DLV (V2200 = DLV2200) (old = new system). This is not to be confused with new V/Variable memory, which reduces the complexity of indexed addressing by an order of magnitude.
Because my project uses some OptiMate operator interface panels that are supported by DLV memory, there was no need to reconfigure the keypads at all. Remote master devices now read the DLV block in the Do-more CPU; no porting required, just change the Vs to DLVs and you are done.
Stress Less with Do-more Math
The MOVE and MATH blocks in Do-more know all about strong typed memory (decimal and floating). All the old LD ten things on to the stack and then OUT them to memory are replaced by the MOVE (or a MathBox) instruction. This cleaned up tons of code and frees the program from needing to be stack-based or having to do base conversions.
The only issue is supporting older hardware; the TOBCD instruction simplifies this problem – it works just like MOVE but the result is a BCD number. For example, the new system stores water pressure as a REAL; to display this on the OptiMate panels in 16-bit BCD requires simply using the TOBCD instruction to convert the REAL number to BCD and store it in the display memory.
The new internal system structures in Do-more are object oriented. Accessing data like Time and Date is easy now referencing the $Now structure. For example, $Now.Hour is the current hour. This makes code development fast and bug free. There are structures for everything, so for the most part the days of needing to know the special V register number to get system data are gone.
Using the CTRIO modules is basically the same as in DirectLOGIC. All I/O modules are located by the Do-more CPU on power-up. They are all configured in Do-more. You can find them under PLC -> System Configuration. The Module Configuration submenu is where you can find your CTRIO card. I renamed mine to be RPM_CTRIO, and once you start to configure it, you will be in the familiar CTRIO configuration interface. “Where is my CTRIO Data?” Each channel is named on the card; I called mine “Turbine#_RPM” (where # is 1,2,3). If you select a floating point result, the contacts looks like ($Turbine1_RPM.freg1 < 1790). Everything is context sensitive so as soon as you hit the “.” the rest of the structure pops up. I got this part up and running in less than an hour.
Data Casting Sall
Creating “programs” is like having a pool of processes in one box. This is very nice and provides excellent logic isolation. I put the control of each turbine in its own program, the HMI interface in another, System Logging in another, etc. To start a program you just use the RUN block and specify the program name and that process is enabled. Once in the program, additional features become available; for example, instead of using FirstScan, one can use the program structure to do things such as [program name].FirstRun or .FirstScan, allowing each program to behave like a unique PLC.
Data Casting is another tricky but powerful feature. In my DL260 system I was manipulating bit fields using the B1400.0 to hit bit 0 of V1400. Doing the conversion requires one to use DLV1400:0. In this case, I used the DirectLOGIC compatible memory so my external devices should not need to be reconfigured.
Constants are another cool feature. Good programming practices suggest that using hard coded constants is a no-no since changing these requires knowledge of everywhere they are used. Do-more provides a way to name constants, which cleans up code nicely and eliminates having to store constants in pre-initialized memory.
Timers in Do-more are light years ahead of the old stuff. Timing from mS to Days is simple and uses just one timer type. In keeping with the structure’s model, the new timers do away with archaic concepts like Tx and TAx or, Tx as the timer and Tx as a done bit. The new Timers support a Tx.Done or Tx.Acc. This is really nice since it is easy to see the intent of the code and it is not necessary to create documentation for both the Tx and TAx items.
Network operations like time servers, email and string formatting are all nice, and help bring the DL205 hardware into the fold with modern PLCs. Note the documentation says most of these features only work on the built-in Ethernet port, although ECOM100 cards should still work for accessing other systems.
Other neat features are script processing and string handling. The STRPRINT box allows you to generate strings with embedded variables which can be used to send email messages etc. I did learn the hard way there are short strings SSx and long strings SLx.
Simulator and Trend Monitoring
The Do-more system includes a simulator which is pretty cool. Even more valuable is the new trend monitoring. This is invaluable when you are doing PID work, but it can also monitor any system variable or state. It provides fantastic insight into how the system is actually running, and I used it to calibrate CTRIO constants, find bugs, you name it.
You do lose a serial port on the new cards. This is especially important if you are talking RS-485 on port 2. The good news is you pick up a USB interface to the PLC; this is nice if you don’t have Ethernet in your plant. And you can always add more serial or Ethernet port modules.
The development system is remarkably stable. After 30 hours of use, it has remained rock solid. The documentation database can be a little slow sometimes making large changes (2-5 seconds), but otherwise is very solid.
So how do I feel about spending the $400 to upgrade? I decided I did not want to be behind the curve on the technology front and this was a good fit between the CLICK and Productivity3000 series, which I like a lot. After having made the investment, and been through the process, I see the CPU module as basically free. Code development is so much faster andcleaner, saving me hours. My productivity is way up, totally justifying the investment. And now I feel very confident using Do-more in future applications.
By, Doug Armstrong
Disclaimer: AutomationDirect does not guarantee the products described in this article are suitable for your particular application, nor do we assume any responsibility for your product/system design, installation, or operation.
Originally Posted: Sept. 24, 2013