Skip to main content

MA - Programmable Control 2014

Page 1

technology hAndbook

Programmable

Control

A look into the products, technologies And solutions shAping the mArket

Digital

Supplement to

MACHINE DESIGN • SYSTEMS • TECHNOLOGY


MORE TOUCH. MORE PC. MORE POWER. www.br-automation.com/multitouch

< Automation Panel | Panel PC | Automation PC < Multi-touch | Single-touch < Widescreen | 4:3 < Landscape | Portrait < Support arm | Cabinet | Stainless steel < Any combination possible < Smart Display Link 3 | 100 m < Intel Core i3 | i5 | i7 < Intel Atom Bay Trail


Ultra Fast aUtomation 1µs rEsPonsE timE www.br-automation.com/reACTION

< Replaces dedicated hardware < Freely programmable < IEC 61131, Function Block Diagram < Reduces CPU load < Reduces machine cycle time

Find out more.

reACTION TECHNOLOGY


Technology handbook

Programmable control

Manufacturers Automation Inc.

M

anufacturers Automation Inc. located in Southern Ontario, supplies all of Canada and the United States with industrial automation products. We have been in business for over 32 years and with the industry continuing to change and adapt to today’s market, we have always kept the attitude of “Can we Help You?”. Having this outlook as our goal of helping customers first, allows us to offer a personal and unique customer service experience. Ask us any questions about the products, pricing, applications and our knowledgeably staff will give you the best answers necessary for your success. A selection of the advanced technologies we distribute include: Cellular Ethernet, RFID (radio frequency identification), Industrial Computing, Industrial Video IP Solutions, Industrial Network Connectivity and Advanced Industrial Wireless solutions. We also have the must needed products for system integrator’s such as sensor, signal lighting, motor controllers, power supplies, mounting systems, cables, LED displays, solid state relays, and much more Industry moguls we work with include: Moxa, Balluff, IMO PC, Carlo Gavazzi, Patlite, Weidmuller, Sprecher + Schuh, SSAC, and Adaptive Displays. A brief summary of what each of these suppliers offer can be found below. Moxa offers advanced device networking products for industries such as device servers, industrial ethernet switches, WIFI, cellular, and industrial IP surveillance. Moxa industrial products are rugged and suited for harsh environments. Balluff Sensors is a leading manufacturer of sensors (inductive, photoelectric, capacitive and magnetic) as well as linear position transducers, and RFID Systems. IMO PC is a global industrial manufacturer that specialize in cost effective power supplies, panel, automation, drives, electronics and renewable energy products. Carlo Gavazzi manufactures a broad range of products for industrial automation, energy and renewable energy, and building automation. PATLITE specializes in innovative LED status indicating lights, sound alarms, visual and audible communication network system and solutions; all which enhance the safety, security and comfort of workplaces and communities.

4 MA • Technology Handbook Programmable Control

Weidmuller provides practical solutions for maximum safety and efficiency in machine construction, materials handling, energy generation and process technology through their products which include: remote I/O, power supplies, relays, analogue signal conditioning, surge protection and PLC Interface Units. Sprecher + Schuh offers a wide range of low-voltage industrial control products, including contactors, a variety of relays, starters, push buttons, switches, terminals and controllers. (All tested for performance and far exceeding industry standards.) SSAC designs and manufactures electronic controls for commercial appliances, heating, ventilation, air conditioning and refrigeration equipment, vending equipment, pumping equipment, elevators, and more. Adaptive Display Solutions manufacturers a wide selection of indoor and outdoor LED display signs that can be used for monitoring production in industrial applications, restaurant signage, and school signs. Manufacturers Automation Inc., has received numerous awards from these above companies, most recently including, #1 Distributor of Moxa products in Canada, Outstanding Sales Performance from Balluff, and Outstanding Distributor of the Year from Carlo Gavazzi. To contact Manufacturers Automation Inc. for information and all your Industrial Automation needs please call us toll free at: 1-800-387-6268 or visit our website at: www.manuauto.com Can we Help You?

Manufacturers Automation Inc. 1600 King Street North, St. Jacobs, ON NOB 2N0 Toll free: 1-800-387-6268 email: sales@manuauto.com

www.manuauto.com


Technology handbook

Programmable control

Unitronics expands SAMBA™ series, introducing a new model with a 4.3” HMI panel.

S

amba, an all-in-one, palm-size controller, fills a growing niche—OEMs on a tight budget who need compact controllers for simple machine control, but still want the competitive advantage of a modern, color-touch HMI panel. The first model of Samba was released this spring; now, only few months after that launch, Unitronics is expanding the series with 4.3” HMI panel model. The beautiful HMI with 3.5” or 4.3” QVGA 16-bit touchscreen enables data entry and the display of variable data, including color Trend graphs and alarm screens. Samba supports 24 user-designed screens, and up to 40 images per application. The integrated PLC offers a broad range of features, including 2 auto-tuned PID loops, timebased RTC control, data logging, recipes and more. The internal memory holds 0.5 MB of application logic, plus an additional 512K for fonts and 0.5 MB for images. Onboard I/O offers digital, analog, and high-speed functionality. The flat fascia and IP66/IP65/NEMA4X environment rating make Samba an excellent fit for the food and pharmaceutical industries; it’s a great fit wherever spray or wipe down requirements apply. Both Samba units come supplied with a built-in programming port (RS232 for the 3.5” model and USB for the 4.3” model); an additional RS485 serial, Ethernet, or CANbus port can be added. Samba supports GPRS/GSM, email and SMS, as well as industrial TCP/IP protocols, MODBUS, DF1 slave, CANopen, and J1939; it can also be adapted to any 3rd-party protocol. Unitronics’ free VisiLogic software provides a single, simple environment for hardware and communications configuration, Ladder application development, and HMI design, including a free library of industrial images. Free utilities include remote PC access and data export. Unitronics even offers free technical support for all of their products and supports an active user forum.

6 MA • Technology Handbook Programmable Control

Samba offers all the functionality system integrators need for small applications, reduces space and wiring requirements, and eliminates the need to set up Panel-PLC communication. The result is a product with an unbeatable price-performance ratio. About Unitronics Unitronics (R”G) Ltd. is an Israeli company with international presence that has been producing PLCs, automation software and accessory devices since 1989. The very first all-in-one controller—HMI+ PLC + onboard I/Os—was released by Unitronics nearly 25 years ago. An early pioneer of this market, Unitronics continues to be a global trendsetter in developing and manufacturing all-inone controllers with a price/performance profile that boosts competitive advantage. Unitronics’ OPLC controllers combine full-function PLCs and HMI operating panels into single, compact units. These HMI + PLC devices are programmed in a single, user-friendly environment. Our clients save I/O points, wiring, space, and programming time; elements that translate directly into costefficiency. Unitronics supports a global network of distributors, as well as a US subsidiary.

Unitronics Inc. 1 batterymarch Park Quincy, MA 02169 USA Tel.: 617-657-6596, Fax: 617-657-6598 Toll free: 866-666-6033 email: usa.sales@unitronics.com

www.unitronics.com


Still using text display ?

It's SAMBA time! PLC HMI I/O

IN ONE UNIT

PLC with 3.5” Starting at color-touchscreen HMI $385

PLC with 4.3” Starting at color-touchscreen HMI $427

PLC features

HMI features

Communication features

• I/O options: Digital, Analog, including High-speed

• 3.5" Color-touch, 4.3" Color-touch, 320 x 240 pixels (QVGA) 480 x 272 pixels

• SMS and e-mail

• Auto-tune PID, 2 independent loops • Recipe programs and data logging via Data Tables

• HMI graphs

• TCP/IP via Ethernet, MODBUS, CANbus, DF1 Slave

• Troubleshoot via the HMI panel

• Remote Access utilities

usa.sales@unitronics.com w w w. u n i t r o n i c s . c om

Unitronics, Inc. 1 Batterymarch Park Quincy, MA 02169 USA Tel: 617-657-6596, Toll Free: 866-666-6033


Technology handbook

Programmable control

<design>

objecT-orienTed

how an uPdaTe To a Plc Programming sTandard

will benefiT auTomaTion sofTware Programmers

By Andy BUrleIgH

W

ith the release of Edition 3 of the IEC 61131-3 PLC programming standard as defined by PLCopen, automation software programmers now have advanced object-oriented design capabilities at their disposal. This greatly expands the programmer’s options in terms of automation programming and future-forward concepts for advanced machine functionality that can be implemented as a result. The powerful, modular Function Block POU (Program Organization Unit) type has been extended with new functionalities that expand the possibilities of software implementation. Programmers already designing in object-oriented environments have class and interface constructs that aid in design, reuse and maintenance of object-oriented programs. Now these constructs are available to the IEC programmer, as well. New keywords in the standard that relate to object orientation are: “interface,” “implements,” “extends,” “property” and “method.” In this article, we will consider the Function Block (FB) as a simple class definition, which includes properties and methods. The Function Block (IEC 61131-3 Edition 2) The IEC 61131-3 standard relies heavily upon the FB POU type for modularity of design. An IEC FB is a smart user-defined type. It wraps the data required for a functional element together with its programmed logical sequencing in a reusable, “instantiable” package.

8 MA • Technology Handbook Programmable Control

The FB is similar to a user-defined data structure: a data structure is defined when it is necessary to create a new data type, and a FB is defined when it is necessary to define data and logic for control of a new component, device or process. A user-defined data structure collects data elements of various types together into an application, component or algorithmically significant type. The structure is a useful designer’s tool — it modularizes the software and syntactically imparts necessary information to other designers working on the software system. By reviewing the data type definitions for an application module, we begin to develop an understanding of the module’s functionality. The FB is an extension of a user-defined data structure. The data structure defines memory for holding actual values without any inherent access control, and contains no algorithm to evaluate and affect the data. The FB incorporates access control over its defined data by clear specification using the IEC keywords: VAR_INPUT, VAR_ OUTPUT and VAR. These key terms unambiguously determine access control of the FB’s variable memory by other programs in the control solution. Data declared as VAR_INPUT can be written from outside of the FB and not written inside the FB. Data declared as VAR_OUTPUT can be read by other programs in the control solution and written only by the FB. Data declared as VAR is internal and can only be written by the FB, and as a general programming practice should not be read from outside of the defining FB.


Technology handbook

Programmable control The VAR_INPUT data is used to pass necessary status information and command values so that the user-created FB can properly apply its internal algorithms. The VAR_OUTPUT data is used to provide the necessary feedback and status information so that callers of the FB can determine if code has been executed successfully. The FB will also contain PLC code to respond to input conditions and thereby modify the internal (VAR) and status (VAR_OUTPUT) data. The FB expresses more meaning to the designer, implementer and maintainer of the PLC system than is possible with a data structure definition alone. The input and output data specifies the formal interface of the FB, and provides us with more information regarding the preconditions, commands and status of functional elements of the control context. Reviewing and understanding the formal interface is required to effectively use FB; however, detailed analysis of the logic inside the block is not required. The FB element is a powerful programmer’s tool because, not only can it be reused infinitely within a solution, but single FBs and collections of FBs can be exported or packaged as libraries and shared between programmers and solutions. As a modular element that encapsulates code and data, the FB does fulfill some of the behaviours central to objects in object-oriented programming paradigms. The Function Block as a Class (IEC 61131-3 Edition 3) While the FB POU type does encapsulate the data and logic of an “object,” the Edition 2 IEC FB has no formal specification for data attributes and method behaviours as can be found in modern objectoriented languages. For instance, the formal interface of the FB in Figure 1 consists only of input (VAR_INPUT) and output (VAR_OUTPUT) data. All of the input data is lumped together, even though the cylinder FB has two data values (simulation flag and timeout value) and six separate functional uses — two extension commands, two retract commands, one centre command and a timed opening command. From a usage point of view, the programmer must take care to use the input data correctly, and it is not always clear which input value set(s) should be used together. In many cases, the more complex control components are, the more logical actions of the FB become unclear. This is particularly true if the logical behaviours and data sets of a component are many or varied. In complex solutions, it is easy for the FB interface to become very large, with long lists of formal inputs and outputs. The Edition 2 FB syntax, in some situations, does not assist a programmer learning a new software system. Since there is no syntax to indicate which formal inputs serve as commands and which as parameters, and no formal syntax to specify logical behaviour, the code is not self-documenting. Edition 3 of the IEC standard addresses this concern. Although a FB POU type is implemented in the familiar way, new syntax is available to clearly specify the data (property) and behaviours (method) of a class, and furthermore the data associated with a given method can be unambiguously specified. Properties – Data members of a class A property is a data item that is declared as a member of a class. This could be the move timeout value for a cylinder or a motor, a set point or status information. Properties can be defined so that they are only internally accessible to a class object, readable from outside of the

Figure 1 in this example, all of the input data is lumped together, even though the cylinder Function Block has two data values and six separate functional uses.

Figure 2 each property is equipped with accessors immediately as a function of the ieC object model.

Figure 3 the method has access to all class member variables, which are retentive between code scans.

Figure 4 methods are called in code by using the dot “.” operator after the Function Block instance name in structured text, or after the Function Block name in the graphical languages.

Programmable Control Technology Handbook • MA 9


Technology handbook

object, writeable from outside of the object and, of course, readable and writeable from outside of the object. Each property is equipped with accessors immediately as a function of the IEC object model. This is an important part of the data-hiding concept in class-based programming. The object always controls the data. These are called the “Get” and “Set” accessors. In modern integrated development environments, the Get and Set templates are created automatically, and the programmer simply fills in a small amount of code to handle the data required in the application. When data is written from outside the object, the Set operation is automatically called and the data can be verified for correctness before it is copied into the internal variables of the object. Likewise, the Get operation is called when outside code attempts to read a value — again, the data can be manipulated before being passed to the calling code. For instance, temperatures can be requested in Celsius or Fahrenheit or speeds in mm/s or m/s, etc., even if the class always internally uses degrees Celsius or inch per minute. Methods – Logical behaviours of a class Methods are the object-oriented construct for implementing the logical behaviour that instantiated objects will provide. In previous editions of the IEC standard, this clear construct did not exist. Only by analysing the formal interface of a FB and using the appropriate input and output data could an object’s behaviour be triggered and monitored. A method in the IEC 3rd Edition standard is very similar to what we know traditionally as an IEC function. A method has a result type, as well as parameters, and can have its own local variables. In keeping with its behaviour as a function, a method does not maintain an internal variable state, and its input, output and internal variables are set to default values with each PLC scan. However, the method has access to all class member variables (those declared within the FB’s VAR, VAR_INPUT and VAR_ OUTPUT data areas), which are retentive between code scans. Methods are called in code by using the dot “.” operator after the FB instance name in structured text, or after the FB name in the graphical languages. A method call in structured text will always end with parentheses, even when no formal inputs are required. Formal inputs to the method are specified within the paren-

10 MA • Technology Handbook Programmable Control

Programmable control

theses, such as in the following example: ObjectInstanceName. MethodName(input1:=value, input2:= value). The formal inputs will appear on the left side of the box in a graphical language. Note that in all languages, the formal inputs must be specified. Representing the data element’s name is not optional; however, an actual value need not be supplied if the programmer intends to use the initialized value of the parameter. For programmers already working in object-oriented languages, the IEC usage of methods and properties will be familiar to implement. For programmers not accustomed to object-based design, a useful exercise is to rethink the most complex FB you have used to date; determine the properties and methods a class version will require; focus on how the usage of the new property and method keywords can make the functional aspects of the class clearer to other programmers; develop some code that implements this as an object and uses the properties and methods; and note how this simplifies working the formal interfaces. If you bring these new features into your comfort zone, objectoriented programming will become a very useful tool in your program development. The recent extensions to the FB POU type as a class implementation incorporate many new features, and here we’ve considered the use and syntax of properties and methods. We’ve seen that the interface and use of a class is clearer in terms of intent when compared to the Edition 2 Function Block: behaviours of an object are handled by named methods; methods clarify the functional uses of an object; careful method design focuses program implementation; data elements are defined as properties; and properties have built-in functionality that improve data consistency. Application code is simplified using these features, which positively impacts design and maintenance. Furthermore, together with additional features, such as interfaces and inheritance, code developed using object-oriented practices becomes increasingly maintainable and future-proof. Programmers who learn about and begin utilizing these concepts in automation programming today will gain a competitive edge over those that rely exclusively on older, more traditional programming languages. Andy Burleigh is an applications specialist with Beckhoff Canada (www.beckhoff.ca/twincat3).


Programmable control

Technology handbook

Why can’t the big boys innovate? By dICK MOrley

T

his column attempts to tackle the lack of innovation in large corporations. There are many ways to approach this problem — using your left brain is one way. We believe we can use deductive reasoning to achieve innovation. This only works for engineering; disruptive innovation is different. But most innovation is based on human intuition — the gut. I recommend that you see the movie Moneyball. I’ve talked about this before in my column, but it’s worth another mention. The short narrative version is that you hire only baseball players who can get on base — not those with high baseball scores, high-priced players or the coach’s nephew. Seldom do all-star teams win. But if the batting average were 300, you can pretty much guarantee that at five times at bat, the player would get on base. That’s all you have to do to win at the end of the day. In the true story, the team won 20 games in a row using low-cost, “on-base” players. In venture capital or with angels, we apply the same principles. Angels, by the way, are people who spend their own money in small sums to get a company started. The Breakfast Club, a small group investing their own money of which I was a part of, utilized the moneyball principle. Our batting average was about 300. This means that we had successes in one-third of the companies we invested in. We had to invest in five companies, each of which had a batting average of 300, to assure success in this statistical run. The only difficult thing with this situation is that if you have a second one that looks good, you must not invest in it. The reader is encouraged to look up the threedoor Monty Hall problem for more information on this theory. The Breakfast Club ran this way, on an intuitive basis, for four decades and over 1,000 business plans. There were enough winners for us. Some examples of single, innovative inventions are the programmable logic controller (PLC) and building management using Andover controls. Many of you know the PLC story: On January 1, 1960, we embarked on the development of the programmable controller and, to our surprise, it took off. We did it mostly to get rid of the problem of continually redesigning and did not consider it an investment. Andover controls was the PLC for building management. We sold the language to the home builder and contractor to eliminate the problem of redesign. An unexpected result from the Modicon PLC was Modbus, the de facto automation communications system. Those were successes, but many adventures were mistakes. We recently felt that indicator lights would be a nice thing to have on the factory floor — no go. We also decided to build large-scale super PLC hardware with easy-to-use software — another bomb. We attacked automated vehicles circa 1965 — too early. We built a rotating floppy disk for the military in 1967. We felt that it was unusable for the commercial market because of memory density and unconventional hardware. The floppy was not a bomb, but for us it was. You win some, you lose some. Some of the lessons we learned were that if there are no bumps in the road, you’re not moving. By this we mean you must maintain

a risk/reward function and allow 70 per cent of your new ideas to fail to have one succeed. Start with five and you have an over 90 per cent chance of having one — but only one — winner out of the five. It takes time. On average, we like to have cash come back to the investors after seven years. We wish for five years, but it seldom happens. Another blocker is what Scientific American calls an “einstellung” — the German word for attitude. The article subscribes to the issue of good being the enemy of better. Conventional wisdom doesn’t necessarily win. I’ll share two examples. I work in a barn with a lot of fluorescent ceiling lights. One of the lights in the far unused corner was blinking, so I decided to fix it — I turned the light off. Another example concerns chess. One of my children played chess reasonably well. A good friend of mine is an excellent chess player. He bet that he could beat my kid five times in a row and if not, we would get a bottle of vodka. We kept getting bottles of vodka. This is how the kid worked it: He played the player, not the game. Using unusual pieces and annoying music helped. He also attempted to remove the opponent’s queen at all costs, especially if he was making the first move. The first move determines the game. Once he removed the queen, the game they were playing was not in the chess books. That means they’re playing each other. Think about that. I also found that technology is irrelevant — what counts is the market and the value to the buyer. It’s annoying to have your operating system continually updated when all it does is make things more complicated for the user. Today, you can go to any modern group of geeks, describe the problem and they will build you a solution. Recognition in the marketplace is the key, along with statistical analysis. Most big companies have a cycle that goes something like this: seek an idea, present it to your boss, the boss can either say yes or no. If he says no, the session is over. If he says yes, it really means a request to his supervisor for a no. Even if it had a 50-50 chance, you will get a no. Any risk that doesn’t get a quick reward penalizes the innovator. But let’s get back to the initial problem presented — large companies have trouble innovating. Being an innovator in a large company usually doesn’t work. Why? They want to solve a problem they think they have. That’s called engineering. Innovation is when you make a problem for the competition. It requires a revolution in thinking and understanding that you have a groove in your brain that says the old ways always work, but how well do they work and are they solving the real problem? Those are important questions. So here’s my advice: start from the bottom; only do five projects; hire smart people; do not micro-manage; take your time; only one can win; repeat next year; and call me in the morning.

Dick Morley is the inventor of the PLC, an author, speaker, automation industry maverick and a selfproclaimed ubergeek. Email him at morley@barn.org. Programmable Control Technology Handbook • MA 11


BROUGHT TO YOU BY

THE SAfETY COMPLIAnCE wORkSHOP DATE: APRIL 29 & 30

LOCATIOn: fOUR POInTS BY SHERATOn MISSISSAUGA, OnT.

Machine safety, the control of hazardous energy, and electrical safety are important concerns for the Canadian manufacturing industry. Get an in-depth understanding of the relevant CSA standards by taking one of these day-long interactive workshops.

CSA Z432 - Safeguarding of Machinery CSA Z460 - Control of Hazardous Energy CSA Z462 - Workplace Electrical Safety

SELECT 2 wORkSHOPS & SAvE MOnEY!

SPACE IS LIMITED!

REGISTER nOw! www.AutomationMag.com/SafetyComplianceWorkshop


Turn static files into dynamic content formats.

Create a flipbook
MA - Programmable Control 2014 by annexbusinessmedia - Issuu