Modicon Programming Handbook

This handbook is a collection of programming overviews, notes, helps, cheat sheets and whatever that can help you (and me) program a Modicon PLC. If you have experience with Modicon then please contribute.

Common Installation Mistakes on Modbus Plus Networks
Courtesy of: Delta Automation, Inc. History | Specifications | Modbus Organization">Modbus Plus is a robust network of peer to peer communications used on process control and data acquisition applications, but several basic mistakes are commonly uncovered during the certification process performed by Delta Automation, Inc.'s Field Service Engineers. One, if not the, most frequent, is exceeding the maximum allowable limit of 1500 cable feet without a repeater. Modbus Plus is a continuous cable with four conductors, a twisted pair, a drain wire and a shield. You must use the approved shielded Belden cable for the network to perform properly. There are several types of connectors approved for node connections, they are: the MBKT type, the TEE type, the Ruggedized Industrial type and the newest Version, which utilizes screw

The Industrial taps cause an impedance mismatch which can be displayed as an insertion reflection when testing the network using a time domain reflectometer (TDR). The MBKT connectors are "daisy-chained" together so when a node is connected or disconnected. If you terminate on the "left" side of one end of a segment you must follow the same pattern of coming in on the "left and going out on the right" so the other end of the segment is terminated on the "right" side. The grounding scheme is quite different. This certification includes a written report with the TDR printout as a snapshot of your network detailing node distances and any problems located and repaired. A quick check of a segment is to measure the resistance between pins 2 and 3. which in turn changes the resistance of the network that adversely effects the communications. Orientation of these connectors is critical for proper grounding. 8 and 20 feet that are connected to all but the MBKT type connectors. There are two lengths of drop cables. Any additions to your Modbus Plus networks or new networks can be certified by Delta Automation. the main trunk may be disturbed or made intermittent. The reading should be between 60-80 ohms. This also may cause a poor connection at the MBKT. . Inc. Delta Automation.terminals. These add 16 or 40 feet respectively to the main Modbus Plus or â¼ trunkâ¼ cable. if both ends are terminated properly and the 1500-foot length has not been exceeded. However. you cannot mix the MBKT style with any of the type connectors which utilize the drop cable (all others). Using the connectors which have drop cables guarantees the 10 feet minimum between nodes unless someone shortens the drop cable. Inc. does not recommend more than two of these taps on any segment. Engineers. This will insure each piece of the main cable is grounded properly.

What is MODBUS? MODBUS is a commonly used industrial communications protocol. 2. It allows the exchange of data between PLCs and computers. 5. To link the two protocols a converter like Panel-Tec¶s MD3000 is needed. etc. they are different protocols and not compatible. a function code defining the requested action. or by taking the action requested in the query. any data to be returned. This FAQ only applies to Modbus serial communications. and an error-checking field. and an error-checking field. or can initiate a broadcast message to all slaves. Intellution or LabVIEW in one location to gather data from various processes around the factory. Is MODBUS Plus the same as MODBUS? No. How does it work? Devices using MODBUS communicate using a master-slave technique. It contains fields confirming the action taken.Modbus FAQ General 1. Is MODBUS TCP/IP the same as MODBUS? . 3. Why would I use MODBUS? MODBUS is a common means of gathering data from many different sources for viewing operations. Siemens. The slave's response message is also constructed using Modbus protocol. Typically a PC is set up running such programs as Wonderware. the slave will construct an error message and send it as its response. The other devices (the slaves) respond by supplying the requested data to the master.) to respond to different levels or modes that are being transmitted from the device. Another application is for setting up remote factory process controllers (such as other PLCs like Allen-Bradley. Depending on the application a newer protocol may have more advantage. It was originally designed for Modicon (Schneider Electric) PLCs but has become widely used by many PLC manufacturers and industrial networks. archiving and troubleshooting from a central remote location. If an error occurred in receipt of the message. or if the slave is unable to perform the requested action. 4. Slaves return a message (response) to queries that are addressed to them individually. The History | Specifications | Modbus Organization">Modbus protocol establishes the format for the master's query by placing into it the device (or broadcast) address. any data to be sent. in which only one device (the master) can initiate transactions (queries). PLCDirect. It is widely used and a fairly simple protocol. The master can address individual slaves.

facts- eng. The other devices (the slaves) respond by supplying the requested data to the master.dataforth. Protocols define how the data is structured while the electrical standards determine how the data is physically transmitted.org/ Networking 7. DF1. RS-422 or RS-485 wired systems. or by taking the action requested in the query.modbus.pdf 9. What are RS-232. they are different protocols and not compatible. y RS-422 can address up to 10 slaves using four wires (full duplex) and has a distance capacity of 4000 meters. A common mistake is to confuse the electrical standard with the protocol.No. How can I connect MODBUS devices together in a network? RS-232 outputs cannot be connected together. RS-422 and RS-485 and how are they different? These are standards for serial communications that define the pin outs. A converter from MODBUS serial to MODBUS TCP/IP Ethernet is needed (for instance the EIS-2B Series Industrial MicroServers from Omega Engineering).com/manuals/faisoconm. Modbus. Intellution or LabVIEW while slaves include PLCs and smart devices such as PID controllers or meters. 8. This FAQ only applies to Modbus serial communications.pdf y Dataforth DCP485 manual: http://www.com/techpubs/toc7. Typical master devices include touch screens or PCs running Wonderware.modicon. What is a master-slave network? A master-slave technique is one in which only one device (the master) can initiate transactions (queries). signal levels. cabling. AS511) that can be used on RS-232. There are many different protocols (i.com/catalog/pdf/DCP485. To create a network the devices must use a RS485 network and have a unique slave address. Where can I find out more about MODBUS? y Modicon¶s MODBUS Protocol Guide: http://www. . transmission baud rates and parity checking.e. y RS-485 can address up to 32 slaves using either a two wire (half duplex) or four wire system (full duplex) and has a distance capacity of 4000 meters. References: y AutomationDirect FA-ISOCON manual: http://www.html y The MODBUS Users Web Site: http://www. y RS-232 only allows for one master and one slave and is limited to distances of up to 15 meters. 6.

com/tech_articles/rs485_basics.html y Basics of the RS485 Standard: http://www. How do I change the slave address? This is unique to each device. y RS-422 can address up to 10 slaves. Consult the manufacturer¶s manual. 11.asp 10.com/Data_Com_Basics/RS232_standard. . Where do I connect the communication wires? This is unique to each device. The address can be a unique number between 1 and 247 for all these systems. How many slaves can there be? y RS-232 only allows for one slave. Consult the manufacturer¶s manual.camiresearch.References: y The RS232 Standard: http://www. Wiring 12. y RS-485 can address up to 32 slaves. Here¶s a typical example of a PC connected directly to a PLC Direct DL05.bb-elec.

Dataforth Converters .wire or 4-wire arrangement. The diagrams below show the wiring connections for the Dataforth and AutomationDirect RS485 to RS232 connectors. The change can typically be made between both by use of two jumpers.RS485 connections can be wired in a 2. It is preferable to use the 2wire multidrop network.

AutomationDirect (Facts) Converters .

.

References: AutomationDirect FA-ISOCON manual: http://www. What are the dip switch settings for the Dataforth DPC485? .pdf 12a.com/catalog/pdf/an202.dataforth.facts-eng.pdf RS-485 connection example see Dataforth Application Note AN202 http://www.com/manuals/faisoconm.

Do I have to turn off the PLC and other devices to connect the wires? This is the only recommended safe way to install wiring. 14. Will I damage something if I get the wires swapped? No. . the RS-232/422/485 standards are designed to withstand short circuits and swapped wires. What are the dip switch settings for the AutomationDirect (Facts Engineering) FAISOCON? 13.12b. Damage may occur if a voltage greater than 25 volts is placed on one of the lines.

It uses http://en. Repeaters can be used to increase the distance. The advantage of ASCII is it allows up to 1 second time intervals to occur between character transmissions without generating an error. Should I use RTU or ASCII? RTU is the most commonly used. The shield should be grounded on one end only. Communicating 17. Addressing 20. 1 parity bit.15.wikipedia. It uses LRC (Longitudinal Redundancy Check) for error checking. 19. Consult the manufacturer¶s manual. RTU mode (Remote Terminal Unit) contains 4 bit hex characters divided up into 8 data bits. and 1 stop bit. that was too much information for me. What sort of cable should I use? A shielded #18AWG cable with twisted pairs is recommended. What are ASCII Chart ">ASCII and RTU modes? ASCII (American Standard Code for Information Interchange) uses 10 bits of data comprised of 7 data bits. 1 parity bit. 1 start bit and 1 stop bit. It's most useful when communication is slow. RTU has the advantage that it can send more data in the same amount of time but it has to be in a continuous stream (no delays between characters). 16. How far away can devices be away from each other? For an RS-232 connection the maximum distance is 15 meters. 1 start bit. For RS-422 and RS485 connections the maximum distance is 4000 meters. Where do I find information on identifying the addresses? .org/wiki/Cyclic_redundancy_check for more detailed information. A typical setup has Baud Rate: Parity: Data Bits: Stop Bits: 9600 Even 8 1 18. OK. What are the communication settings? This is unique to each device.">CRC (Cyclical Redundancy Check) for error checking.

How can I test the MODBUS connection? . times and PID variables. Types of register data include temperatures. #2 . The data can be in binary (decimal). 23. alarms/warnings and status.Most software packages allow you to specify the MODBUS data type and address. pressures. Can I control the PLC remotely through MODBUS? Only if the PLC program is programmed to do it. Consult the manufacturer¶s manual.If your host software package specifies an address only then you will need to determine the addressing mode as either 484 or 584/984. This is the easiest method and most often used. 21. What is a coil? This is a single bit of information indicating either an ON (1) or OFF (0) state. Can I write a value to the PLC? Yes there are both read and write functions. The following table shows what will need to be added to the existing address: 484 mode Coils Registers +1 + 4001 584/984 mode +1 + 40001 24. If the address is supposed to be four digits then it is 484 mode. What is a register? This is a 16-bit data field. This is often referred to as ³adding the offset´. If the address is to be five digits then it is 584/984 mode. Why is the addressing off by one? Some Modbus master devices compute register locations differently so the actual address might be shifted by one. Types of coils include valve states.This is unique to each device. Troubleshooting 27. Why do some addresses have only four digits when I expect five? Typically there are two ways that MODBUS can address the PLC: #1 . 25. 22. 26. hex or BCD format.

htm y LabVIEW can be used but the MODBUS component called BusVIEW must be purchased first from SEG Corp. Are the communication cables shielded and is the shield grounded on one end. (www.softwarewithrelish. I¶m getting communication time out errors and I can¶t get the device to communicate with my software? What could be wrong? y Transmit and receive signals can often be verified by watching the transmit and receive lights on the Modbus components. and the GND goes to GND. Vendors that have stand alone MODBUS testing software include: y Ocean Controls . To test an RS485 connection first establish that the RS232 side is working by disconnecting the RS232/485 converter and testing by the above method.The best way to do this is to have a separate computer/laptop with the ability to monitor MODBUS by acting as a Master station. baud rate. o Make sure the host software has the same configuration y The transmit and receive wires are crossed.oceancontrols.htm y Wintech Software . Try switching the wires as it will not cause any damage. y The data format may be set up incorrectly. What is wrong? y The addressing may be off by one depending upon how the host software handles addressing. In certain situations the data may be in hexadecimal.com). and 5 is GND (or Common). The MODBUS data does not match what is on the screen.win-tech. . wired to one end with a standard 9 pin connector for the computer com port and the other end loose to tie into the customer interface terminalsThe 9 pin terminal 2 is Rx. o Typically the data will be in binary/decimal format.au/modbus/modview. y Host software is not configured to continually poll for new readings.http://www. A converter on another PLC can be used for testing but the RS232 side of the converter must be disconnected first before using the PC. Check the settings match for slave address. y High power lines or improper grounding is causing noise in the system.http://www. The only cable required to test MODBUS is a three conductor. 28.com. stop bit and parity. terminal 3 is Tx. o The communication parameters are not set up correctly on the device. y Check the conductivity on each wire for loose connections or broken wires. Once the RS232 side is confirmed as working the only way to verify the RS485 connection with a PC is to use another RS232/485 converter to convert the signal back into a RS232 signal that the PC can read. Refer to the user manual¶s MODBUS table for the data formatting. 29. y Slow communications may delay updates on MODBUS data. So the Rx on one end goes to the Tx on the other and vice versa.com/html/modbus1.

a transaction will only be queued in the first bridge and not in subsequent bridges for transactions that utilize multiple bridges. there are paths reserved for programming use only. A bridge plus device has eight master and eight slave paths for utilization of data transmissions. the amount of traffic which may attempt to flow through it. that this bridge is beginning to get overloaded and may pose future problems. The low address (word) will contain the first four places while the higher address (word) will contain the upper four digits.95 to get the proper scaling. o Some large numbers may require two addresses. with no logical indications. it has been the experience of Delta's Engineers. The scaling is indicated on the MODBUS table where the actual data is given and then the scale value. Inc. Additionally. A response is only returned to the origin when a complete path is made to the destination. For example. When all of the data paths are busy in the bridge. the queued transaction is removed from the queue and given a path. o Modbus Plus Traffic Issues in Bridge Plus Devices Courtesy of: Delta Automation. Once a path becomes available. monitor the traffic on each side of each bridge located on your network. The ultimate solution is to add an . This will result in lost data or data not getting to or from the proper nodes. the incoming transaction will be queued in the first bridge plus device. problems can arise when data is requested from nodes that route over more than one bridge. o Sometimes scaling is required to derive the proper number. While a "backbone" of bridges on the main trunk of a History | Specifications | Modbus Organization">Modbus Plus network is generally the most efficient design for larger systems. Since a bridge must open ports on both sides and maintain the proper timing. that if the traffic exceeds an average of about 75% (six paths). to determine how many paths are being utilized at one time.Some data has implied decimal places so that a value of 432. Utilizing the MBPSTAT program supplied with your computer Modbus Plus network card. it is possible that some messages may be queued for transmission. For a quick conversion take the (high word X 10000) + low word.1 will be 4321 in MODBUS. In fact. if the actual reading is from 0 to 4095 and the scaling is from 0 to 100 then the actual value will have to be divided by 40. This is called a double word. If traffic is indicated on all eight paths. It is important to keep in mind when deciding the routing paths for your data transmissions which utilize more than one Modicon Bridge Plus device.

on Modicon systems it can take several scans of the processor to complete the switch- . With the default setting of 300. or go to a preset value. and a graphic display. This default time setting is usually adequate for most stand alone systems.additional bridge in "parallel" (with different addressing of course). for all of your network design and support needs. maintenance and servicing. This loss can be due to a power loss at the drop or a cabling problem for example. is 300 milliseconds. Inc. hold last value. The analog modules options are: go to zero. and re route some of the traffic over the new bridge. Modbus 11 and Remote I/0 networks in metallic and fiber optics. Modicon Redundancy System I/O Hold-up Time Courtesy of: Delta Automation. certifies Modbus Plus. the discreet outputs will de-energize after 300 milliseconds (0. The default setting for the remote I/O hold up time (HUT) on a Modicon PLC system. These options are all chosen in the traffic cop (I/O map) area of the configuration screen. This switch-over takes a finite amount of time. cable resistance. This determines the amount of time that the discrete outputs associated with a particular drop will remain in the "on" state once communication with the processor is lost. token rotation time. This is accomplished by "moving" the I/O points from the control of one processor to another if a failure should occur.3 seconds). A complete written report is generated with a network certification which includes distances. The purpose of a redundant PLC system is to allow the application or process to continue to operate in the event of a PLC processor type failure. Analog modules behave differently. Typically. during which the I/O is not communicating to the processor. All of this information is important for future planning for expansion. These are the types of issues and problems that can be avoided by utilizing the network services of Delta Automation Inc. Delta Automation Inc.

in some versions of the PLC programming software. the PLC software will allow you to enter an enormous value. On large applications. This setting is accessed on the traffic cop or I/O map screen associated with each drop. Secondly.over. This would cause an application or process to stop. If the switch-over time takes longer than the hold-up time. This can be extremely dangerous as the I/O will remain on and active even with the processor turned off! With NO CONTROL! It is advised that the time never be set greater than 15 (1500 milliseconds). this can be longer than the default setting of 300 milliseconds. at 0. If you attempt to do this you will get an error message.4 milliseconds per K of logic. In these types of systems Delta Automation. Inc. First.3 to 1. There are several items to be very careful of when changing this value. you cannot just highlight the "3" and replace it with a "15". suggests that the time be set to 1500 milliseconds (1. A work-around is to enter a "5" after the "3". and 1500 milliseconds is just "15". . then type over the "3" with a "1" to get a "15". the value that you enter is already in hundreds of milliseconds. Also. the I/O will have lost communications with the "failed" processor and began its timing sequence and will ultimately drop out or de-energize. for example 300 milliseconds is entered as just "3".5 seconds).

Sign up to vote on this title
UsefulNot useful