Bugged Out

May 19, 1999

Y2K is still with us. Sure, the hype has subsided since we first heard all those predictions of what would happen once computers ticked over to the new year: electricity shutting off, banking systems imploding, production lines seizing, the ensuing collapse of polite society. Ironically, it may have been these nightmare scenarios that finally impelled governments and businesses to fix their systems. And if we're to believe their reports anyway, they are, or will shortly be, ready for the new millennium.

Still, this bug haunts us. The truth is that, even today, after all the hype, someone can purchase a digital device that is fully Y2K compliant and unwittingly program into it a Y2K glitch.

This I discovered at a adult-ed class I've been taking. It's on programmable logic controllers--PLCs for short. PLCs are used for controlling and coordinating assembly lines, or anything else that can be automated. (Our instructor, for instance, employs them at the steel plant where he works.) In use for about 30 years, PLCs are the missing link between today's digital computers and yesterday's bulky electro-mechanical relays.

Newer PLCs are basically black boxes, each slightly smaller than a loaf of bread, with some inputs for wires and some like-sized outputs. What we learn each Tuesday night is how to "program" that box so that certain combinations of digital signals sent to the inputs cause certain combinations of signals to come out the other end. (potential real-life application: An assembly shop painting widgets in one of four possible colors. The paint must be applied in precise four-second bursts, followed by a one-second cleaner spray. ) We hook up the PLCs--DirectLogic205 models made by Automationdirect.com --to old 486's and use PC-based software to write these programs. Once finished, we download the programs on to the tiny memories inside these boxes.

Pretty simple, right? You'd figure that something this elementary would be free from millennial concern. But here's exactly where Y2K gets interesting, right where you'd least expect trouble. During a break in class, I decided to ferret out any potential Y2K glitches on my PLC. I rifled through its collection of preprogrammed instructions--clocks and timers and accumulators and such. There I found the option to set the date. Sure enough, just like all those newspaper stories claimed, only two numbers could designate the year. I could type in "99" but not "1999." The documentation noted that only one 16-bit memory location (Y7774, if you must know) was allotted to hold the year. Hence, only 100 numbers could be recognized, 0 through 99.

That in itself is not a bug per se, depending on how the PLC was built. And the engineers at Automationdirect.com were thinking ahead. I set mine for 11:59 p.m., Dec 31, 1999. A minute later it flipped to "00." No problem there. I set it ahead another three months to see if it recognized the leap year. It displayed that day correctly. Color me impressed.

But there was a potential pitfall--one so small I almost missed it entirely. Later that evening, the instructor mentioned a feature called Data View, which showed the binary contents of individual memory locations. Hmmm. I opened Data View to spy on Y7774, entered "99," and noted the row of 16 0's and 1's it spewed back. Then I changed the date to "00." And there it was--the tiny glitch that's costing so many millions in repairs and causing so much apocalyptic fever: The Data View showed nothing but a line of 0's. As far as this PLC was concerned, "00" equals zero. In its logical world, "00" would always be 99 increments less than "99," not one increment greater. It wouldn't take a great leap of imagination to envision some chucklehead somewhere, still blissfully unaware of Y2K, programming a PLC to compare a date periodically stored in a memory register, with the current one. Maybe that program, devised to insure regular maintenance, would shut down an assembly line if those two binary numbers were more than two increments apart. Maybe it would reject cases of food more than 30 days old. It would work fine until Dec. 31, 1999. After that . . . well, you know the punch line.

Sure, it's not very likely, what with all the Y2K hoopla informing every keyboard-pounding bozo of such dangers. But it's there, in the realm of possibility. The thing is, you can still order one of these DL205s. In fact, this product is, by legal definition, fully Y2K compliant . What that means, company spokesperson Joan Welty explains, is that no internal calculations of the PLC itself are dependent on that two-digit date. That's not to say, however, that any programs written for these PLCs are free from Y2K glitches. Nor are there any safeguards to prevent what old electricians call "a short between the ears"--in this case, some PLC programmer haplessly coding in a date-dependent error. And Automationdirect.com has no plans to offer a version with a four-digit date function.

And that's my take on Y2K. The well-surveyed banks and power companies I don't sweat. It's the thousands of back-alley shops using equipment and software even older than what can be found at your local vo-tech. It's the PLCs and embedded processors that shortsighted managers have signed off as ready for the new millennium. How many of these devices are out there? Who knows? And would their programmers still be around then to correct the mistakes? These errors may not shut the lights off. They may not have any immediate affect on our daily lives. But come the new year, they'll be running on faulty data, and corrupting things in subtle ways that even our best consultants can't divine.

--Joab Jackson



[ The archive || [E-mail]