Showing posts with label PLC. Show all posts
Showing posts with label PLC. Show all posts

Average of Analog Input

Saturday, 2 May 2009
Posted by Joe

Description :

This Siemens 200 PLCs's file is going to create a rolling average for the last 100 scans worth of an analog input.

File Details :

File Type: .zip

File Size:2.27 Kb

Download Now

More Info :

Please  Visit  http://plc2u.com/index.php/plc-code/s7200/average-of-analog-input

Label:

Daylight Savings Time for S7-200

Posted by Joe

Description :

This is a sample program how to demonstrate making the PLC adjust the clock for daylight savings time automatically. It is done with an S7-200, but the logic sould be similar for any PLC from any vendor.

It's written with Step 7-MicroWIN/32

File Details :

File Type: .zip

File Size 7.84 Kb

Download Now

More Info:

Please Visit http://plc2u.com/index.php/plc-code/s7200/daylight-savings-time-for-s7-200

Label:

Remanent On-delay Timer for Siemens S7 300/400

Posted by Joe

Remanent On-delay Timer for Siemens S7 300/400

-The attached FC makes standard PLC timers remanent.

-The timers are started, stopped and reset via digital inputs.

-The the remaining time can be monitored in the program.

File Details :

File Type: .zip

File Size 222.35 Kb

Download Now

Please visit us at http://plc2u.com/index.php/plc-code/s7300400/remanent-on-delay-timer-for-siemens-s7-300400

Label:

S7-200 Tips & Tricks Complete 8/2003

Posted by Joe

PLC Sample Code

Description:

Complete archive of Tips and Tricks for S7-200

File details:

File Type: .zip

File Size 25.63 Mb

Download Now

Please visit us at http://plc2u.com/index.php/plc-code/s7200/s7-200-tips-a-tricks-complete

Label:

PLCs Versus Other Types of Controls

Saturday, 25 April 2009
Posted by Joe

A PLC is not the alone best for authoritative a process. Sticking with alone basal relays may be of a account depending aloft your application. Yet, on the added hand, a computer ability be the way to go. The PLC vs. PC agitation has been activity on for a continued time. More generally admitting it doesn't appear bottomward to an "either or" bearings but involves a mix of technologies.

PLC vs Relay

Relay small

When I first started programming PLCs it was still ambiguous if a PLC was all-important over aloof broadcast control. With PLC prices activity down, admeasurement shrinking, and achievement of PLCs convalescent over the years this has become beneath of a battle. Yet the designer has to ask themselves if a PLC is absolutely abstract for their application. Some questions should be asked.

  • Is there a need for flexibility in control logic changes? Will there be frequent control logic changes? Will there be a need for rapid modification? A lot companies believe they will never change a design but more often then not ideas and goals do change and modifications will need to be made. Do you want to do that in hardware (relays) or software (PLC)?
  • Must similar control logic be used on different machines? It's so much easier to download a program then build another panel.
  • Is downtime a concern? Any change or troubleshooting on a relay system means the system might have to go offline. Changes in a PLC can often be made online with no downtime.
  • Are space requirements important? Based on the number of relays a PLC can be a real space saver.
  • Are increased capability and output required? PLCs can be faster then their mechanical counterparts.
  • Are there data collection and communications required? Only possible with a PLC or computer.
  • What are the overall costs? There's a certain price point comparison but in these days it's very low in favor of a PLC.
  • Is there a need for flexibility in control logic changes? Will there be frequent control logic changes? Will there be a need for rapid modification? A lot companies believe they will never change a design but more often then not ideas and goals do change and modifications will need to be made. Do you want to do that in hardware (relays) or software (PLC)?
  • Must similar control logic be used on different machines? It's so much easier to download a program then build another panel.
  • Is there a need for future growth? A PLC can easily accept a new module in a slot or get an expansion base.
  • Is there a need for high reliability? PLCs are seen as more robust over individual components.
  • Is downtime a concern? Any change or troubleshooting on a relay system means the system might have to go offline. Changes in a PLC can often be made online with no downtime.
  • Are space requirements important? Based on the number of relays a PLC can be a real space saver.
  • Are increased capability and output required? PLCs can be faster then their mechanical counterparts.
  • Are there data collection and communications required? Only possible with a PLC or computer.
  • What are the overall costs? There's a certain price point comparison but in these days it's very low in favor of a PLC.

PLC vs. Dedicated Controller

Controller dedicated

A dedicated controller is a single instrument that is dedicated to controlling one parameter such as a title="Acronym for Proportional, Integral, Derivative. Control algorithm that is used to closely control processes such as temperature, mixture, position, and velocity. The proportional portion takes care of the magnitude of the error. The derivative compensates for the rate of error change. The integral takes care of small errors over time.">PID controller measuring a temperature for heating control. They have the advantages of an all in one package, typically with display and buttons. This can be a very good thing to use in simple applications. A PLC these days can compete price wise and functionally with these controllers especially if you more then one controller is needed. PLCs offer a greater degree of flexibility too because the can be programmed to handle all sorts of different scenarios.

PLC vs. PC (Personal Computers)

Computer small

The PLC vs. PC debate has been going on for years and I'm not going to attempt to give the definitive answer. They both have their pros and cons. What often happens is that the two are used for their strengths in different parts of the factory.

 

 PLCPC
Environment The PLC was specifically designed for harsh conditions with electrical noise, magnetic fields, vibration, extreme temperatures or humidity.Common PCs are not designed for harsh environments. Industrial PCs are available but cost more.
Ease of Use By design PLCs are friendlier to technicians since they are in ladder logic and have easy connections. Operating systems like Windows are common. Connecting I/O to the PC is not always as easy.
Flexibility PLCs in rack form are easy to exchange and add parts. They are designed for modularity and expansion.Typical PCs are limited by the number of cards they can accommodate and are not easily expandable.
Speed PLCs execute a single program in sequential order. The have better ability to handle events in real time.PCs, by design, are meant to handle simultaneous tasks. They have difficulty handling real time events.
Reliability A PLC never crashes over long periods of time. ("Never" may not be the right word but its close enough to be true.) A PC locking up and crashing is frequent.
Programming languages Languages are typically fixed to ladder logic, function block or structured text.A PC is very flexible and powerful in what to use for programming.
Data management Memory is limited in its ability to store a lot of data. This is where the PC excels because of it's hard drive. Any long term data storage, history and trending is best done on a PC.
CostJust too hard to compare pricing with so many variables like I/O counts, hardware needed, programming software, etc.

 

Hybrids of PLC/PCs are common now (e.g. WinPLC). This type of hardware tries to mix the two platforms using the strengths of both. So the CPU might be able to run Windows CE or Linux in a rack that can accept common I/O modules.

Off the Shelf vs. Build Your Own

PLC custom board

For some manufacturers the choice these days is coming down to buy a PLC or make your own. The benefits of PLCs have become so widely known that manufacturers looking to cut cost can engineer their own solutions and build them more cost effectively. An example of this is the Divelbiss "PLC on a Chip" with the accompanying EZ LADDER programming software.

Please visit us a http://plc2u.com/index.php/plc-article/plc/plc-vs-other-type-of-control

Label:

Repair PLC

Posted by Joe

PLC Repair Bad Card

It’s inevitable. Left on your board is an old PLC agenda with a chicken post-it agenda on it that artlessly says, “Bad Card”. So you assay it out and abiding abundant article is mysteriously amiss with the cyberbanking audacity of this big-ticket little device. Your aggregation may accept some action for abortion assay and backup parts, but, added generally than not, there’s a chiffonier or drawer about with a lot of bad parts, bashed with cryptic adhesive notes, that you don’t accept the affection to bandy out. As those genitalia get added numerous, adored and cher it makes faculty to analysis into companies that specialize in PLC repair.

Please visit us at  http://plc2u.com/index.php/plc-article/plc/repair-plc

PLC Repair Companies

There are absolutely a few companies whose capital business focus is electronics adjustment including PLC boards. Some of them are alike absolutely PLC accouterments accompanying but best additionally account drives, DCS accessories and added ascendancy devices. Not alone will they adjustment PLC genitalia but they additionally accept a ample accumulation of surplus (new in box) and refurbished genitalia for replacement. This abnormally becomes important in earlier bequest systems. Alike admitting genitalia can be upwards of thirty years old they still abutment aliment on the brand of Allen Bradley PLC-2/PLC-3, Modicon 484/584, Siemens S5/S7 and Texas Instruments 500/505. PLC adjustment companies action the experience, assets and the abstruse libraries of schematics and manuals that would contrarily be adamantine to appear by.

Am I a Candidate?

Basically any aggregation complex in PLCs can account from PLC repair. Mid-size to ample factories are archetypal candidates but arrangement integrators and resellers additionally apprehend the advantages. The charge for bound controls, minimum blow and acid costs accomplish PLC adjustment needful for all sorts of industries from packaging, aliment processing, pharmaceutical, automotive and so on.

If you assignment in an earlier bulb you apperceive how able-bodied a PLC can be alive year afterwards year. You additionally apperceive as a artisan that your accessories will eventually fail. It’s not a amount of “if” but “when” and that’s back you’ll charge adjustment services. One of the problems is that the amount of advance is aloof not account it back it comes to factoring in removing the old system, programming the fresh one, installing hardware, alive out the bugs and acquirements how to use the fresh system. Having a reliable adjustment account ensures that you can accumulate the arrangement active at basal cost.

How Much Can I Save?

First of all, it doesn’t amount annihilation to acquisition out how abundant the accident will be in dollars. The majority of the PLC adjustment companies do not allegation annihilation for ciphering a adjustment cost. You would alone be out the amount of shipping.

Second of all, there are no accuse for time and materials. A archetypal adjustment account has a database of genitalia and their costs. These companies accept been about for awhile and accept accumulated the ability of archetypal genitalia that go bad and accordingly accept a abject amount for repairs.

The basal band is that it should amount you no added the 50% of the amount of new. Greg Carter of Radwell International says, “We alarm an account ‘Beyond Economical Repair’ aback the amount of genitalia and activity beat 45% of affairs new. We try to accomplish adjustment a actual adorable advantage --- 73% of items are angry about in 5 canicule or less.” Aback I asked Willy Williamson of Electrical South about a aphorism of deride he said, “Repairs should about not amount added again 50% of the amount of a fresh archetype of the aforementioned allotment number. If you run into instances area you apperceive a fresh one can be bought for beneath than the quoted adjustment price, allocution to your sales representative.”

If a allotment is accounted as un-repairable, as a aback up, these companies action refurbished or surplus genitalia at cogent savings. Bill Zalot, President of TEK Supply says, “In best cases if a assemblage is un-repairable for any reason, we are able to accommodate a backup for the chump at a amount alone hardly added than adjustment cost.” These surplus or repaired genitalia are additionally acceptable avenues to accomplish abiding you accept a aback up on your shelf for emergency situations.

What about Quality?

Of advance acclimation a allotment may not be as reliable as affairs a cast fresh one. The added acceptable adjustment companies admitting booty a abundant accord of pride in their assignment and ensure a affection repair. A acceptable adjustment aggregation will action a assurance on the allotment or alike the accomplished PLC. It seems the about assurance runs for one year but they can differ. It’s important to pay absorption to the assurance and analyze it to what others are offering. It’s additionally account allurement about their testing and analysis procedures. Make abiding they accept the adeptness to put the allotment in a arbor to absolutely exercise it afore sending it aback to you. How important is this? “We go to abundant lengths to absolutely exercise the PLCs we repair. We use analysis programs to absolutely exercise the memories and functions of the PLC. We absolutely don’t appetite to see it appear aback as a warranty. We additionally adopt to accumulate our barter advancing aback to us with added repairs, and acceptable affection is a above contributor to abiding relationships”, said Willy Williamson of Electrical South.

Label:

User Defined Data Types (UDTs) and OOP

Posted by Joe

For years now, Object Oriented Programming archetype (or OOP) has been a frequently acclimated programming practice, and has of advance begin its way into automated automation as well.

In the beggarly time, best PLC manufacturers accept begin agency to accomplish the programmers activity easier by introducing User Defined Types or UDTs. The name says it all; it is a ‘type’ that you, the programmer, can ascertain all by yourself. This agency that your programming ambiance will not alone accept the approved integers (INT) and Booleans (BOOL), but could additionally accept a ‘VALVE’ blazon or a ‘MOTOR’ type.

I can’t allege for added brands of PLC’s, but the Allen Bradley ControlLogix alternation of PLC’s, calm with RSLogix 5000 programming software, makes it actual accessible to assignment with these UDTs, and back the addition of RSLogix adaptation 17 beforehand this year, it is now alike accessible to adapt your UDTs while online with a active system.

The Controller Organizer has a binder alleged Data Types > User-Defined with all the UDTs in the project.

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

I am of the assessment that every PLC affairs should await heavily on UDTs to advance readability, and if you are an OOP adept, it can be a abundant advice to adapt your classes.

Let’s go over the fundamentals of OOP for a little bit:

  • Classes: Classes define the abstract characteristics and behavior of an object. For example, a simple ‘VALVE’ class would have the characteristics (or attributes) that it can be open or closed (the things it can be), and as far as behavior goes, it could have the methods ‘to open’ and ‘to close’ (the things it can do)
  • Objects: An object is an instance (occurrence) of a class. In our example, there could be a Valve_001 and a Valve_002, which are both instances of the class ‘VALVE’, with the same attributes and methods.

Of course the definition of OOP goes a lot further than this. There is a very understandable explanation here: http://en.wikipedia.org/wiki/Object-oriented_programming#Fundamental_concepts for those who would like to read more. For now, let’s leave it at this, and see how we can apply this to an industrial environment.

If you look at a valve as an object in a typical industrial automation environment, you should note the following:

  • It has inputs and outputs that are specific for the object (proximity switches and solenoids).
  • It can be either ‘open’ or ‘closed’
  • You can tell it to go ‘open’ or ‘close’.
  • It could have an alarm timer, that would tell us if the valve did not open or close in a given time period after a command.
  • It might have interlocks, which allow the valve to open or close under certain conditions.

A UDT for this class, would fit all these backdrop and methods in one simple type. But, as always, we can apprehend added complications of the chic ‘VALVE’ during the ability of a project. To be as adjustable as possible, I awful acclaim the convenance of nesting UDT’s, which will become bright forth the way.

Let’s alpha with defining our class, and accumulate in apperception that it will accept to be calmly attainable for aliment bodies or added programmers.

If we alpha at the I/O end, the best adjustment is to actualize sub-classes alleged VALVE_IN and VALVE_OUT, which will accommodate our I/O.

The afterward archetype uses RSLogix5000 V16. First, actualize the sub-classes. From the File card baddest New Component > Tag. The afterward chat box appears to actualize and adapt the associates of the UDT.

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

As you see, I am accustomed to booty the types I aloof created as the abstracts blazon in this UDT. The absolute advantage of this affection will become bright if you actualize a article alleged Valve001 of the blazon VALVE, and attending at the article in the ‘monitor tags’ window:

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

Wow! Just by creating a new tag of the type VALVE, it gets all these I/O points right away, and referenced in the program:

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

Of course, going further with this concept, everything for a valve can be included in one object. Allow me to skip some steps, and show you a possible final result:

The ‘VALVE’ class is now contained in a UDT called VALVE, which looks like this:

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

As you see, the class VALVE now consists of the sub-classes VALVE_IN, VALVE_OUT, VALVE_TIMER, VALVE_STATUS, etc.

And an instance of this class, the object Valve001, would look like this:

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

While adding stuff to my class, I did not have to re-create the object Valve001. RSLogix updated it for me, so all the properties and methods are available in my program.

Now, let’s say you’re working on this project with a couple hundred valves, and the customer decides to go with a different type of valve, that also has an analog input, that tells us the exact position of the valve. All we have to do is modify our VALVE_IN sub-class to add this to every instance of the type VALVE:

programmable logic controllers,plc,plc control,scada systems,hmi automation,modbus io,ethernet rs485,rs232 ethernet,industrial automation,as511,siemens,allen-bradley

Of course, you would still have to write code to tell your program what to do with that information, but that is also the reason why PLC programmers still have a job.

For somebody that is not familiar with your program, it might be confusing to look at all your UDT’s. We just made eight UDT’s for one simple valve class! But remember, you only have to do this during the design phase. Once you have a solid design for all your classes (and made sure their names are self-explanatory), you will never have to look at your UDT folder again, and creating a new instance will be a breeze.

Please visit us at  http://plc2u.com/index.php/plc-article/plc/user-defined-data-types-udts-and-oop

Label:

How to Symbol Program with Allen Bradley RS Logix 500- Part III

Sunday, 5 April 2009
Posted by Joe

NFPA 79 2002 Edition reference

Table E.1 Device and Component Designations ABE Alarm or Annunciator Bell ABU Alarm or Annunciator Buzzer AH Alarm or Annunciator Horn AM Ammeter AT Autotransformer CAP Capacitor CB Circuit Breaker CI Circuit Interrupter CNC Computerized Numerical Controller CON Contractor COs Cable-Operated (Emergency) Switch CPU Central Processing Unit CR Control Relay CRA Control Relay, Automatic CRH Control Relay, Manual CRL Control Relay, Latch CRM Control Relay, Master CRT Cathode Ray Tube, Monitor or Video Display Unit CRU Control Relay, Unlatch CS Cam Switch CT Current Transformer CTR Counter D Diode DISC Disconnect Switch DISP Display DR Drive EMO Emergency (Machine) Off Device END Encoder ESTOP Emergency Stop FLD Field FLS Flow Switch FS Float Switch FTS Foot Switch FU Fuse GEN Generator GRD, GND Ground GUI Graphical User Interface HM Hour Meter HTR Heating Element IC Integrated Circuit INST Instrument IOL Instantaneous Overload I/O Input/Output Device L Inductor LED Light Emitting Diode LS Limit Switch LT Pilot Light LVDT Linear Variable Differential Transformer M Motor Starter MD Motion Detector MF Motor Starter - Forward MG Motor Generator MR Motor Starter - Reverse MTR Motor OIT Operator Interface Terminal OL Overload Relay PB Pushbutton PBL Pushbutton, Illuminated PC Personal Computer PCB Printed Circuit Board PEC Photoelectric Device PL Plug PLC Programmable Logic Controller POT Potentiometer PRS Proximity Switch PS Pressure Switch PWS Power Supply Q Transistor QTM Thermistor REC Rectifier RECP Receptacle RES Resistor RH Rheostat S Switch SCR Silicon Controlled Rectifier SOL Solenoid SNSR Sensor SS Selector Switch SSL Selector Switch, Illuminated SSR Solid State Relay ST Saturable Transformer SUP Suppressor SYN Synchro or Resolver T Transformer TACH Tachometer Generator TAS Temperature-Actuated Switch TB Terminal Block T/C Thermocouple TR Timer Relay TSDR Transducer TWS Thumbwheel Switch V Electronic Tube VAR Varistor VM Voltmeter VR Voltage Regulator VS Vacuum Switch WLT Worklight WM Wattmeter X Reactor ZSS Zero Speed Switch

Please visit us at  http://plc2u.com/index.php/plc-article/plc/how-to-symbol-program-with-allen-bradley-rs-logix-500

Label:

How to Symbol Program with Allen Bradley RS Logix 500-Part II

Posted by Joe

Your symbols will start to pop up in a quick pick list. Arrow down to find your proximity switch if you can't remember it, or better yet keep typing it all out and press enter when done. Viola! You've just typed your first symbol program.

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens

Other symbols programming tips I can offer is a grouping of symbol names such as STATION 1 could mean S1. If you are state logic programming, you might remember a station more so by its function. Let's say you have a station on some automation that presses a part assembly together. I would call all the internal bits by "PRESS" to indicate all these bits that begin with PRESS have the same functionally with my press station.

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens

The fun doesn't stop there. Can't remember which control relay enables the fast speed index? Just type CR to bring up the list of all your control relays.

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens

How about when you are creating bits that transfer information from your Panel View to your PLC? You could also group all those symbol names together with a PV.

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens I hope you can see based on the samples shown that trying to memorize your program by the address names is pretty tough. Giving each of your symbols a name and you should be able to program faster than before. Group your symbols names to speed up symbol searches. Come up with your own "short hand" that you can remember easily or use the NPFA chart for some ideas.

Label:

How to Symbol Program with Allen Bradley RS Logix 500 - Part I

Posted by Joe

Symbols are used in RS Logix to identify a bit or memory area of a PLC by a name that you can more easily remember. See if you can see the symbols in this screen shot:

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens

If you haven't found them by now, they are the descriptions in GREEN.

AUTO_MODE, RUNNING, POWER_ON, ALL_HOME, INDEX_ON_STAT, etc...

RS Logix makes it extremely easy to use symbols in your program. When you enter a new instruction with a question prompt, you can start typing your symbol name and a pop out window will start narrowing your search down to the symbol you have already created in the database. Notice I said "already created". That means it would be a good idea if you made up all your symbols ahead of time using the spread sheet template downloadable here

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens

That's ok that you can't do them all before you start. Just keep creating them on the fly with terms or "short hand" that you can remember. Here are some tips for common short hand naming that I use myself.

When I am programming a hardware device such as a proximity switch or a photoeye input, I use the NFPA's Table E.1 Device and Component Designations as guidance to name all my hardware I/O. Below is a list of codes at the end of this article. This bascially means if I have a proximity switch connected to I:1.0/14 I could give it the symbol name

PRS_TRANSFER_EXT

programmable logic control,plc,plcs,plc control,automation,scada,hmi,modbus,4-20 mA,ABB,Siemens

PRS comes from the NFPA table which means "Proximity Switch TRANSFER means that this prox is connected to a transfer device of some sort EXT means that the direction the prox is detecting is You aren't required to use the NFPA's component designation, but this will give you some bases to start if you need ideas. More recently I have tried to trim my own symbols to the first two letters so I can drill down my symbol list very quickly in RS Logix. I've changed my own personal preference to PX for Proximity Switch. So if I enter an instruction in a rung, I can just type two letters "PX" at the question mark and low an behold EVERY SINGLE proximity switch on my automation system will come up in my list to choose from.

Label:

PLC programming cables for several brands

Monday, 9 March 2009
Posted by Joe

Most PLC's can be programmed from a PC via a serial cable. Unfortunately, many of these cables have a non standard layout. De cables shown here can be bought from the regular sales channels, but it is often much cheaper to solder them yourself.

Siemens PLC's

Most programming of Siemens S5 PLC's is done using a special RS232 to TTY converter. The S7 series are programmed using a RS232 to MPI bus converter. The easiest thing to do is buy these special cables from your local Siemens supplier. The operator terminals however can be programmed using a normal serial cable. The following cable can be used to program the OP series of operator displays.

programmable logic control,plc

Idec / Izumi PLC's

Idec / Izumi PLC series FA2, FA2J and FA3J all require a special communication adaptor for programming. This communication link adaptor (CLA) is a small box that converts the RS232 electrical signals into a compatible level for the PLC. The cable to connect the PC to a CLA uses a DB25 connector at the PLC side. The layout for a cable with a DB9 connector at the PC side is shown here.

programmable logic control,olc

Z-World microcontrollers

Z-World is an American company specialized in developing microcontroller boards based on the Z180 and Rabbit series micro controllers. Where PLC's are often used in single piece environments, micro controllers are mainly present in the OEM world where multiple controllers are needed. The main difference in programming a PLC is that most microcontrollers, including those from Z-World, are programmed in C. The Z-World programming package runs on a normal PC and the connection with the controller is made using a serial cable. This cable needs a DB9 connector at one and, and a RJ14 plug at the other. The pin out of a programming cable is shown here.

Please visit us at  http://plc2u.com/index.php/plc-article/interfacing/plc-programming-cables-for-several-brands

Label: ,

Mitsubishi PLC cable layouts

Friday, 6 March 2009
Posted by Joe

Melsec PLC's from Mitsubishi can be connected to PC's running Medoc programming software using various cables. Each different I/O module uses a different pin assignment. The signal levels of the A series CPU units are not RS232 compatible and must be converted with a SC-02N or SC-05 converter

The serial cable layout to connect this converter to a PC is shown in this diagram.

plc mitsubishi

If more than one serial port is necessary on an A series melsec PLC, the AJ71C24 or AJ71C21 serial communication modules can be plugged into the system. These modules provide RS232 compatible serial ports, so no signal conversion is necessary to connect these modules with a PC. Both modules are equipped with a DB25 connector.

The cable layout for these two modules is shown below.

plc mitsubishi

The A1SJ71C24-R2 can also be used to connect computers and devices to a melsec series A PLC. This plug-in module contains two serial ports, each with a DB9 connector. The wiring layout is in fact identical to the RS232 null modem cable with loopback handshaking.

Label: ,

Mitsubishi FX2N PLC Communication Cable

Posted by Joe

Here is a configuration of communication cable between Mitsubishi FX2 PLC HMI with a PC.

Here for Mitsubishi FX2N PLC:

Label: ,

Mini PLC with Microcontroller

Posted by Joe

Programmable Logic Controllers (PLC) have been extensively used in industry for the past five-six decades. PLC manufacturers offer different PLCs in terms of functions, program memories, and the number of inputs/outputs (I/O), ranging from a few to thousands of I/Os. The design and implementation of PLCs have long been a secret of the PLC manufacturers. As a microprocessor based technology, the functionality of a PLC is well-known from the end-user (programmer) point of view, but by now no serious work has been reported to describe a microprocessor/microcontroller based implementation of a PLC.

Here's the link : http://host.nigde.edu.tr/muzam/UZAM_PLC_with_PIC16F648A.htm

Download (PDF) :

  • PLC With PIC 16F648A Microcontroller (Part 1)
  • PLC With PIC 16F648A Microcontroller (Part 2)
  • PLC With PIC 16F648A Microcontroller (Part 3)
  • PLC With PIC 16F648A Microcontroller (Part 4)
  • Label:

    The difference between PLC and microcontrollers

    Posted by Joe

    A PLC is a special microcontroller designed for industrial use, that is for controlling machinery or processes. Usually a PLC is programmed using Ladder diagrams and specialized control software. A microcontroller is a microprocessor that can be used for any type of application, but there some for special applications, like a PLC. Here's a link.

    http://en.wikipedia.org/wiki/Microcontroller http://en.wikipedia.org/wiki/Programmable_logic_controller

    Label:

    Ethernet rules closed-loop system

    Tuesday, 10 February 2009
    Posted by Joe

    Ethernet rules closed-loop system by Wesley Cole , John Eidson

    The enterprise tool picks up speed and moves to the plant floor.

    Traditional process control systems have used programmable logic controller (PLC)-based centralized control techniques to implement closed-loop control applications. Packet-based networks with collisions, such as Ethernet, are generally considered too slow and unreliable to safely handle closed-loop control.

    Today, various fieldbus technologies and the ability to inexpensively place significant computation capability at the transducers allow control applications to be implemented using distributed techniques. This distributed function provides increased capacity, relieves computational and communication bottlenecks, and generally provides more flexibility in system design, modification, and expansion.

    In a traditional process control system, the PLC polls the sensors and directs the actuators. The PLC processor, based on the control algorithm's execution characteristics, determines the time behavior of the system. In a distributed system, the time behavior is determined by the time behaviors of the application execution characteristics on the local processors, the local protocol stacks, and the communication network. A distributed system provides true multiprocessing and therefore the potential for improving computational throughput and synchronization characteristics of the system.

    In implementing distributed systems, the process control industry has developed a wide range of communication networks. The computer industry has also provided a range of networks for the general distributed computing environment, with Ethernet being the most pervasive at the present time. Traditionally, Ethernet has not been used in control environments; it is found within the enterprise levels of process control and is increasingly being coupled to lower-level control functions. Advertisements for field-level products using Ethernet are beginning to appear in trade publications.

    The use of general computer networks in field-level control will require some modification of techniques normally used in real-time systems. The computer industry has developed a number of distributed system techniques that will be useful in control. In particular, there is an increasing amount of literature on the use of real-time clocks in distributed systems.

    Clocks are found at the PLC level of current process control systems. However, time synchronization at the device level is generally limited to timers and time ticks distributed over the network from a PLC. Let's explore the use of true real-time clocks at all levels of distributed closed-loop control systems.

    Event or data driven?

    In an event-driven system, it is important that the occurrence of an event be made visible in a reliable and timely manner. The order of events and their time relationship to the real world must be preserved. For events, time accuracy and distribution latency are the prime timing considerations. Alarms, state machines, and device commands are typical control structures using event mechanisms.

    In a data-driven system, such as continuous closed-loop control, the real-world time relationship of successive data points must be preserved. Distribution latency (delay) must be such that the response times and stability requirements of the loop are not left unmet. The system throughput must be adequate to process and distribute the data.

    In distributed control systems, each node must explicitly deal with synchronization issues. Messages without time stamps, when passed between nodes, can implement order, but not time specification. If time specification is to be imposed, then at least some of the nodes must have access to a clock. For closed-loop control, it is imperative that control algorithms are provided with the correct sampling time information for each of the control variables.

    Provide the time

    There are several ways to provide the sampling time information required by control algorithms like the widely used proportional-integral-derivative (PID) algorithm.

    Polling of the sensors by the node implementing the control algorithm is commonly used today. The polling is normally periodic as seen by the polling node. The time error in polled systems is the departure from strictly periodic time, termed time jitter, inherent in various components of the system.

    The main sources of this jitter are the communication protocol stack and the operating systems of the nodes. In the case of the protocol stack, this jitter results from queuing processes and parsing protocol headers.

    Operating system time jitter arises from internal operations such as context switching and servicing software-maintained timers and clocks. With a carrier-sense multiple access (CSMA) protocol stack, such as Ethernet or LonTalk, this jitter can be important and is usually not known by the algorithm. However, even in non-CSMA stacks, such as controller area network (CAN) or Foundation fieldbus, care must be taken that operating system and application code jitter is negligible, as this jitter can be comparable to the jitter in a CSMA network.

    Since there is no way to measure this jitter for each packet, there is no way to correct for jitter in simple, polled systems. A common variation on this theme is for a central node to distribute "ticks," which other nodes use to synchronize sampling. These ticks are subject to the same jitter problems as polling. In polled systems, control algorithm computations can only assume that the data was sampled at the poll times.

    Another alternative is to make the entire distributed system operate synchronously. This has been done by running all the communications and computations on an enforced time-slice schedule. When run using a CSMA protocol stack, such a system can eliminate collision jitter, since by definition there is no contention for the network.

    This type of setup uses synchronized clocks to enforce the schedule so data can be time stamped. Time-slice systems based on token rings or their equivalent, rather than on synchronized clocks, will have uncorrected time jitter comparable to polled systems.

    The alternative presented here is to provide all nodes in the distributed system with accurately synchronized clocks. With such clocks, sensor data can be time stamped and control algorithms can use these time stamps to correct for the sample timing errors resulting from computational, operating system, and protocol stack jitter and delay. The accuracy of these clocks will determine the effectiveness of the corrections. To be effective, nodes must have hardware support for generating time stamps based on appropriate transducer control signals. Such systems can use CSMA protocols provided the clock synchronization is adequate.

    As a side benefit, time stamps provide a method for detecting and correcting for missing or out-of-order data. Both missing and out-of-order data are possible in networked distributed systems, especially if routers are present. However, when CSMA networks are used under the same conditions (number of nodes and network traffic) as other fieldbus networks, the occurrence of missing and out-of-order data can be made rare and can be corrected in the control algorithm.

    Synchronize your clocks

    There are a number of techniques in use for synchronizing the clocks in a distributed system. A central time server is one possibility, but it introduces delays and excessive message traffic. For systems with more than a few nodes, a better choice is for each node to have a local clock participating in a synchronization protocol among the nodes.

    The computer industry uses protocols such as the network time protocol (NTP) for clock synchronization among PCs and workstations. NTP is based on message exchange and produces accuracy on the order of a few milliseconds over Ethernet networks. To attain better accuracy, some sort of hardware assistance is required. Systems exist that produce accuracy of 10 microseconds.

    We have experimented with clock synchronization based on hardware-assisted detection and recognition of special network packets for both Ethernet and LonTalk protocols. Synchronization accuracy is measured by recording the differences in the time stamps marking the occurrence of a series of mutually visible events as determined by the local clocks in two nodes.

    Figure 1 is a histogram of these differences for two nodes communicating using the Ethernet protocol and demonstrates synchronization accuracy on the order of 20 nanoseconds. Figure 2 is a histogram of these differences for two nodes communicating using the LonTalk protocol and demonstrates synchronization accuracy on the order of 100 nanoseconds.

    In both cases, this synchronization was obtained with one packet per second devoted to the synchronization algorithm. Except during the start-up phase of the algorithm, the number of synchronization packets per second is independent of the number of clocks being synchronized. The accuracy differences between the Ethernet and LonTalk implementations are due primarily to the differences in the network bit rates-10 Mbps for Ethernet and 1.2 Mbps for LonTalk.

    The key benefit of this clock synchronization method is increased accuracy. While millisecond accuracy obtainable by conventional methods is adequate for many closed-loop control and monitoring applications, the submicrosecond accuracy reported here allows faster systems to be controlled in a networked environment.

    Ethernet clocks the process

    A simple control system was built to test the feasibility of implementing synchronized clocks and CSMA networks. The system is illustrated in Figure 3.

    Both the tachometer and controller electronics were implemented using Motorola 68331 microprocessors. The communication mechanism is the unacknowledged datagram protocol on a 10base-T Ethernet. Each node contains a clock synchronized as described earlier.

    The controller is a standard PID with trial coefficients determined by the Ziegler-Nichols frequency response method. The system was not stable using these initial values and was manually altered to produce a marginally stable one. Using marginal stability enabled testing under conditions that maximized the chances of observing deviations introduced by sampling jitter and network degradation.

    The system was operated both in a polled mode in which the controller requested samples and in a push mode in which the tachometer controlled the sampling time. The data was always time stamped based on the local clock in the tachometer. The controller could be configured to either use or ignore the time stamps when computing its output.

    As expected from previous analysis, it was difficult, but not impossible, to induce noticeable degradation in the system. During the collection of the data, the packet load on the Ethernet was 25% of capacity as measured by a local-area network analyzer. In each case, 100 samples of these waveforms were collected. For each waveform, the root mean square deviation of the actual response from the mean value was computed as a percentage of the mean value. This calculation was done independently for the falling and rising portions of the square wave perturbation. The results are seen in the table below.

    While more experiments are necessary to fully quantify these results, it appears that the settling time was better using the time stamp corrections.

    Similar experiments were conducted in which packets were deleted to simulate network collisions or checksum errors with no visible degradation in performance. In all cases, the network packet load ranged from about 10% to 30% of capacity.

    The only dramatic network-based interference produced was a result of bogus packets specifically addressed to a control system node. Such packets pass the usual Ethernet hardware filter and must be processed and rejected by the lower levels of the protocol stack, which steals processor cycles from the application. These experiments need to be repeated for controllers implementing notch filters and other algorithms that may show more sensitivity to the timing-induced phase or amplitude jitter.

    Additionally, both the phase and amplitude noise introduced by time jitter should be studied, particularly that introduced by alternative algorithms and conditions. Further, evidence exists that clock usage in event-driven applications needs to be examined as well.

    It's clear that the use of synchronized clocks in data-driven closed-loop control systems using Ethernet as the field bus is a viable solution. The ability to synchronize clocks to accuracy more than adequate for most control problems has been demonstrated on both the Ethernet and LonTalk protocols. The presence of these clocks allows algorithms to be corrected for the actual times of sampling, potentially eliminating computation, protocol stack, and communication time jitter.

    Additional Information

    Figures and Graphics
  • Figure 1. Time differences between two clocks using Ethernet communication
  • Figure 2. Time differences between two clocks using LonTalk communication
  • Figure 3. Test system block diagram
  • Figure 4. System response using Ethernet communication
  • PDF of "Ethernet rules closed-loop system"

    Label:

    Classic Ladder

    Monday, 9 February 2009
    Posted by Joe

    A project to have a free ladder language in C. Generally, you find this type of language on PLC to make the programs of automation process.

    It allows to realize little programs or bigger in an electric way.

    This project is released under the terms of the LGPL licence.

    GENESIS...

    I decided to program a ladder language only for test purposes at the start, in february 2001. It was planned, that I would have to participate to a new product after leaving the enterprise in which I was working at that time. And I was thinking that to have a ladder language in thoses products could be a nice option to considerate. And so I started to code the first lines for calculating a rung with minimal elements and displaying dynamically it under Gtk, to see if my first idea to realise all this works. And as quickly I've found that it advanced quite well, I've continued with more complex elements : timer, multiples rungs, etc... Voilà, here is this work... and more : I've continued to add features since then.

    FEATURES...

    Classic Ladder is coded 100% in C. It can be used for educational purposes or anything you want... The graphical user interface uses GTK+.

    The programs are splitted in sections (mains or sub-routines), in which you select a language. Two languages can be used in them: Ladder. Sequential (also known as grafcet). The following elements are available in the ladder :
  • Booleans elements
  • Rising / falling edges
  • Timers
  • Monostables
  • Counters
  • Compare of arithmetic expressions
  • Booleans outputs
  • Set / Reset coils
  • Jumps
  • Calls to sub-routines sections
  • Operate of arithmetic expressions

    There is a full editor for the rungs of ladder and the sequential pages. When editing, use the pointer of the toolbar if you want only to modify properties, else select the element you want to place in the rung. Each variable can be associated to a symbol name that can be then used instead of the real variable name.

    ClassicLadder can run in real-time (optional) with RTLinux v3, with RTAI and recently with Xenomai. It can run on little embedded platforms (no GTK interface dependance, and number objects to allocate for less memory usage).

    HARDWARE SUPPORT / SCADA...

    Classic Ladder can be used to drive real physical inputs/outputs: Direct port access (parallel port for example) Comedi drivers project Modbus/RTU distributed modules (Serial) and Modbus/TCP (Ethernet) A Modbus/tcp server is available that can be used to link with a SCADA software (like Lintouch).

    REQUIREMENTS...

    For using Classic Ladder as it is, you need : Linux and GTK2 librairies Windows (but with not all the features for real I/O access)

    DOWNLOADS...

    You can download here on SourceForge the last sources + executable + projects examples.

    DOCUMENTATION...

    Actually you should take a look at the only README file available, included too in the archive (and here the TODO list for future works). But, here you will found a nice little manual for using the sequential editor done by someone using classicladder: http://users.teledisnet.be/web/rlo05343/umanual/umanual_for_classicladder.htmlIf you don't know at all how work ladder, you can take a look here:http://www.plcs.net/contents.shtml

    You can take a look at the following project using ClassicLadder in an adapted version: EMC2, used to control machine tools. They have written some documents, that some parts could be interesting even if if is not totally the same version.

    Label:

    MatPLC

    Posted by Joe

    MatPLC is a PLC-like program for Linux (PLC = Programmable Logic Controller), licensed under the GNU GPL.

    We take advantage of the fact that we have an underlying operating system and use its features to make the MatPLC modular. One module could be executing mnemonics. Another module is a PID loop. A different module handles I/O, or logs to a database. (These modules all already exist.) The MatPLC then coordinates their workings to present a simple interface to the user.

    Currently, we are in early stages: we have a solid core, mnemonics for logic modules (python or C can also be used), a signal-processing module which includes a PID loop, several I/O modules (including numerous industrial networks and an interface to the comedi project) and some simple HMI modules.

    We are cooperating with the classicladder project project, which will provide stepladder and GRAFCET in an intuitive, point-and-click form. However, the interface between the two projects is not yet ready.

    Label: