PLC Tips from the Tech Team
AutomationDirect’s Technical Support Team receives a vast array of inquiries on programming and installation of our DirectLOGIC PLCs. We asked the team to provide some Tips and Techniques to help make programming and installation easier for our users. Here are some of the topics that come up regularly.
Locating problem code: Having trouble locating a problem in your code? Try placing an END rung after the problem area. Move it up or down through the program until the problem is located.
Troubleshooting math: Are you using a rung with multiple math instructions that doesn’t give the correct result? Try adding an OUT box instruction after each function (ADD, SUBTRACT, DIVIDE, etc.) and check the value in each OUT register to locate the problem.
Non-functional math: Do you get the same data out that you started with? This usually means that you have a data (BCD, BINARY, REAL, etc.) mismatch. DirectLOGIC PLCs use a BCD format for the default math instructions. Verify that all data being used is in BCD. If using BINARY, use the correct instructions (ADDB, SUBB, etc.). If using REAL numbers, use the correct instructions (LDR, ADDR, SUBR, etc.).
Outputs not executing: If one instruction, or a group of instructions, does not seem to be working correctly, the cause is often an addressing conflict with some other part of the program. Try isolating the problem section by creating a small test program with just the rung(s) in question and adding an END statement. If the section in question works correctly in the test program, then it could be a duplicate coil or register issue, meaning the same output address is used in more than one rung. Use the Cross Reference View to see what other parts of your code may be using the same addresses and causing the conflict. Note that the Cross Reference View may not indicate all instances of a memory location being used. This can happen in the case of Pointers, Table Instructions, Network Communication Instructions, etc.
Incorrect timer accumulator values: Is a timer accumulator not working or showing erroneous values? Chances are the same timer is being used somewhere else in the program. Also, check for any TMRA(F) instructions. These timers consume two physical timers. For example, TMRA T1 also uses T2, so the next available timer is T3.
Slow network communications: Want to speed up your network? When configuring PLC memory locations that will be used for data transfer to another PLC, operator panel or PC, try using contiguous blocks of memory as much as possible. This will reduce the number of separate communications necessary to transfer all the data, making communications much faster.
Network cable selection: Want to help ensure that your network will be up and running smoothly? Make sure you use the correct cable type for your communications, even when testing shorter distances. For RS-485 or Remote I/O, use a Belden 9841 or equivalent. For RS-232 or RS-422, use a Belden 8102 or equivalent. Terminate the shields at one end only and add termination resistors as required.
Testing PLC network communications: When setting up networking with two or more PLCs, test each communication rung separately, starting at the slowest baud rate available, and hardwired directly to each other (no radios, serial converters, etc). Then try all the communication rungs together to verify proper interlocking. Finally, add any necessary converters, radios, etc. This procedure may not always be possible, but by adding only one “link of the chain” at a time, it can be much easier to determine where any communications errors are occurring.
Protecting PLC inputs: Did you know that AC inputs have a high inrush, as much as 3A, that can damage fragile reed switches? Putting a 1K ohm 0.5W resistor in series with the input can reduce the inrush current.
Backup power for AC inputs: Did you know that AC inputs will not work with most UPS systems? That’s because a normal AC waveform is purely sinusoidal, with a frequency of 60Hz, and voltage peaks of about +/- 167 Volts. This is the type of wave form with which AC input circuits are designed to work. The waveform of the output of a typical UPS is not sinusoidal, but attempts to simulate the sinusoidal waveform by producing an intermittent, alternating square wave. A “sine wave” UPS does not use the intermittent alternating square wave of the standard UPS, but produces a very nearly sinusoidal waveform which will work with the AC inputs. You must have a “sine wave” UPS for AC inputs to function.
Protection against transient voltage spikes: Power Filters and Transient Voltage Suppressors are very cheap PLC system insurance. Power filters, such as AutomationDirect’s APF filters by Cutler-Hammer, protect your PLC system from noise and voltage spikes on the incoming power lines. Be sure that all devices in your system (PLCs, DC power supplies, etc.) are powered from the load side of the power filter. Transient Voltage Suppressors like the ZipLink ZL-TSD8-24 and ZL-TSD8-120, Fuji coil suppression units, and packaged MOVs and diodes for the 75 and 78 series relays will drastically reduce voltage spikes that occur when de-energizing inductive loads.
RJ-type connector pin orientation: Ever have trouble determining which way to view an RJ-type connector for a pinout? Try doing this. Take the cable connector and hold it as if you were going to plug it into your eyeball, with the locking tab up. In this orientation, Pin 1 is on the left side of the connector.
By The Tech Team,
Originally Published: March 1, 2006