DirectNETt Manual Number DA–DNET–M
WARNING Thank you for purchasing automation equipment from PLCDirect. We want your new DirectLOGIC automation equipment to operate safely. Anyone who installs or uses this equipment should read this publication (and any other relevant publications) before installing or operating the equipment. To minimize the risk of potential safety problems, you should follow all applicable local and national codes that regulate the installation and operation of your equipment.
1 Manual Revisions If you contact us in reference to this manual, be sure and include the revision number. Title: DirectNET Reference Manual Manual Number: DA–DNET–M Issue Date Effective Pages Description of Changes Original 1/94 Cover/Copyright Contents Original Issue Rev. A 6/98 Manual History 1-1 – 1-3 2-1 – 2-12 3-1 – 3-30 4-1 – 4-14 5-1 – 5-10 6-1 – 6-21 7-1 – 7-7 A-1 – A-18 B-1 – B-16 C-1 – C-15 D-1 – D-17 E-1 – E-16 F-1 – F-12 Made minor corrections throughout.
1 Table of Contents i Chapter 1: How to Use this Manual Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The purpose of this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Who should read this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii Table of Contents Chapter 3: Network Design and Setup Choosing the Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Analyze your Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Identify Your System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iii Table of Contents Chapter 4: Communication Settings Selecting the communication settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What do I have to select? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Baud Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parity . . . . . . .
iv Table of Contents Chapter 5: RLL Communications Programs Why do you need a communications program? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Master Initiates Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Why Ladder Logic? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
v Table of Contents Bytes 10 & 11: Complete Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bytes 12 & 13: Partial Data Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bytes 14 & 15: Master Station ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Byte 16: End Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . .
vi Table of Contents Appendix A: PLC Master / Slave Example The Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Master Station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vii Table of Contents Step 2: Select the Communication Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set the DCM Switches for Peer #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set the DCM Switches for Peer #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Install the DCMs and Connect the Cables . . . . . . . . . . . . . . . . . . . . . . . . .
viii Table of Contents Appendix D: DL405 Data Types and Memory Maps DL405 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Type 31 V Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Type 31 (continued) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ix Table of Contents Appendix F: DL205 Data Types and Memory Map DL205 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Type 31 V-Memory Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Type 31 V-Memory Addresses (continued) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Type 32 Input Points . . . . . .
How to Use this Manual In This Chapter. . . .
1–2 How to Use this Manual How to Use this Manual Introduction The purpose of this The purpose of our manual is simple. We want to make it easy get your DirectNET network up and running as soon as possible. Since we understand your time is manual money, our goal is to keep the documentation simple and concise. This manual focuses on the details of the DirectNET network. The manual provides a general overview of DirectNET along with an explanation of all the steps required to implement a network.
1–3 How to Use this Manual Supplemental Manuals There are other manuals occasionally referenced by this manual. These manuals are not absolutely necessary to install the network, but they do provide additional details on several products that can be used with DirectNET.
Getting Started with DirectNET Communications In This Chapter. . . .
2–2 Getting Started Getting Started The DirectNET Basics It’s an Easy-to-use Data NETwork DirectNET is an easy-to-use data network for the DirectLOGIC family of products. DirectNET is the perfect choice for those applications requiring data to be shared between programmable controllers (PLCs) or, between PLCs and a host computer. This network operates at speeds up to 38.4Kbps and permits you to upload or download virtually any type of system data.
2–3 Getting Started How Does it Work? The network is controlled by a master station that issues network commands to individual slave stations (you cannot “broadcast” a message to all slaves). The commands may be used to download data to the slave stations, or upload data from the slave stations. The slave stations only respond to requests from the master station and cannot initiate communications. Issues Network Commands to transfer data Read V1400 from slave 1..... Write X0–X15 to slave 3.....
2–4 Getting Started What can I use as a network master station? Getting Started DL405/DL205 PLCs with a DCM or DL340 CPU The master stations can be any one of the following: S DL430 or DL440 PLCs with a DCM S DL340 CPU (using built-in port) S DL240 PLC with a DCM (A DCM is a Data Communication Module.) These master stations use Relay Ladder Logic Instructions to initiate the communications requests over the network. No complex programming (or knowledge of the DirectNET protocol) is required.
2–5 Getting Started Operator Interface Many applications utilize a computer to act as a central data collection point and to manage the network requests for data transfer. The advantage with this approach is you can perform many different types of operations with the data either before or after a request. The disadvantage is you may have to write your own communications driver and that can take a considerable amount of time for more complex applications.
2–6 Getting Started Getting Started What can I use as a network slave station? CPUs with Built-in DirectNET Port One of the benefits of DirectNET is many of the DirectLOGIC CPUs already have built-in DirectNET ports that can communicate up to 19.2K baud, (38.4K for the DL340). The following CPUs have this feature. S DL430, DL440 S DL340 S DL240 Data Communications Modules and Data Communications Units Each DirectLOGIC product family has a general purpose communications interface.
2–7 Getting Started The following diagram shows the various combinations of master and slave stations available with a DirectNET solution. DL205 or DL405 PLCs with DCM or DL340 CPU Operator Interface Host Computer Getting Started Master Slave 1 Slave 5 Slave 3 DL340 CPU DL405 CPUs DL205 CPU port cost Two built-in DirectNET ports yield the lowest cost solution Built-in DirectNET yields the lowest solution Maximum baud rate= 19.
2–8 Getting Started Choosing a Configuration Three Basic Configurations Getting Started PLC as Master The network components can be used to create many different network designs. However, all networks use a mixture of three basic configurations. Any of the three configurations can be grouped together or used independently. The type of configuration determines the types of cables, communication parameters, and communications programming. This configuration is very easy to use.
2–9 Getting Started Combination Networks The three types of networks can be combined to solve many different applications. Even though the configurations can be combined in an application, each network remains independent. The master station from one network cannot request data directly from slave stations on another network. This does not mean you cannot obtain data from these networks, you can. It just requires more than one interface for that slave station.
2–10 Getting Started What communications program should I use? Getting Started Two Options RLL Programs There are two types of communications programs, RLL instructions or DirectNET protocol programs. The network configuration determines the type of communications program required. S PLC as Master — The PLC master requires instructions in the RLL program to initiate the requests for data. S Peer as Master — Both peer masters require instructions in the RLL program.
2–11 Getting Started DirectNET Programs The communications program used with a hosted network is more complex than the simple RLL instructions used with the other configurations, but the concept is the same. The host is the DirectNET master and must use a DirectNET protocol communications program to initiate all network requests to read or write data. These communication programs can be written in many different languages, such as BASIC, C, etc.
2–12 Getting Started How can I create a network? Getting Started Follow Four Simple You can easily create a DirectNET network by following four simple steps. The remainder of this manual provides explanations and examples of these steps. Steps 1. Design the network by: S Selecting the configuration(s) S Building the communication cables. Don’t ignore the importance of this step because it determines the type of switch settings and communications program you should use. Chapter 3 provides the details. 2.
Network Design and Setup In This Chapter. . . .
–2 3–2 Network Design and Setup Choosing the Configuration Analyze your Application There are almost as many ways to build your network as there are grains of sand at the beach. The first step in determining the configuration is to analyze your application. As with most things, there’s probably a logical grouping that will point you in the right direction. If you have several systems you’ll need to decide which station(s) will be the master(s) and which one(s) will be slaves.
3–3 Network Design and Setup Determine how you plan to use the information that is transferred. This may help you design your network. For example, are you trying to share data between several machines, or are you trying to obtain data to be used in production reports or spreadsheets? Once you’ve taken a look at your application, you should be able to identify the configuration needs. For example, our simple widget factory needs to accomplish the following things.
–4 3–4 Network Design and Setup Sketch the Network Since all applications must use one (or more) of the three basic network configurations (PLC as Master, Host as Master and Peer as Master), we can easily Diagram draw the complete diagram for our example factory. To refresh your memory, here are the possible configurations.
3–5 Network Design and Setup Production Management 2 Production Line #1 Production Line #2 1ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉ 1 ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇ Widget Station 1 Widget Station 2 Widget Station 3 Widget Station 4 Pack Station 3 Pack Station Palletizer Now you’re ready to build the network cables.
–6 3–6 Network Design and Setup Cable Selection and Installation Guidelines Things to Consider There are several considerations that help determine the type of cable needed for your application. 1. Will the DCM be physically connected in a point-to-point configuration or multi-drop configuration? 2. What electrical specification is best for your application? RS232C or RS422? 3. What is the cable schematic? 4. What are the relevant cable specifications? 5. What installation guidelines are necessary? 6.
3–7 Network Design and Setup Consideration 1: Physical Configuration DirectNET can be used in either a point-to-point or multi-drop configuration. A point-to-point connection only has two stations, a master and a slave. You should use this configuration when you want to connect a DirectNET master station to a single DirectNET slave station. For example, use the point-to-point configuration to connect a personal computer, an operator interface, or an intelligent device to a single station.
–8 3–8 Network Design and Setup Consideration 2: Electrical Specification RS232C or RS422 DirectNET supports both RS232C or RS422 communication. Your application and configuration choice will help determine which electrical specification is best for you. If you are using multi-drop, you must use RS422. If you are using point-to-point, you may have a choice between RS232C and RS422.
3–9 Network Design and Setup Consideration 3: Cable Schematics There are two sections in this chapter that provide various types of cable schematics that are appropriate for most applications. Point-to-Point cable diagrams can be found on pages 3–17 through 3–21. Multi-drop cable diagrams can be found on pages 3–22 through 3–29. You may have to combine some of these examples to design a cable that meets your exact application requirements.
3–10 –10 Network Design and Setup Consideration 5: Installation Guidelines Your company may have guidelines for cable installation. If so, you should check those before you begin the installation. Here are some general things to consider. S Don’t run cable next to larger motors, high current switches, or transformers. This may cause noise problems. S Route the cable through an approved cable housing to minimize the risk of accidental cable damage.
3–11 Network Design and Setup Consideration 6: PLCDirect offers a Universal Cable Kit (part number FA–CABKIT). This cable kit A Quick Test Cable allows you to connect various types of DirectLOGIC products with an RS232C cable in a matter of minutes. The kit consists of a cable (phone cable with male plugs already attached) and several specially wired connectors and phone cables. The special connectors are a D-sub style with built-in female phone jacks.
3–12 –12 Network Design and Setup DL430 and DL440 Port Pinouts The DL430 and DL440 CPUs have built-in DirectNET ports. This port is only a slave port. The following diagram shows the port pinout connections.
3–13 Network Design and Setup DL405 DCM Port Pinouts The DL405 DCM can be used as a master or slave station interface. The following diagram shows the port pinout connections.
3–14 –14 Network Design and Setup DL340 CPU Port Pinouts The DL340 CPU has two built-in DirectNET slave ports under the hinged cover. The ports are limited to RS232C communication, so you have to use an RS232C/RS422 converter for multi-drop connections. This port is an RJ11 (handset connector) phone jack. The DirectLOGICE Universal Cable Kit (FA–CABKIT) can be used if you do not want to create a phone jack connection. DirectNET Ports 1 and 2 Port 2 is the Master port.
3–15 Network Design and Setup DL305 DCU Port Pinouts There are two versions of the DL305 DCU. S D3–232–DCU (RS232C version) S D3–422–DCU (RS422 version) The DL305 DCU can only be used as a slave station interface. If you only have one master and one slave, you can use either version. If you have more than one slave you should probably use the the RS422 version. You can use the RS232C version, but you’ll need an RS232C/ RS422 converter (FA–UNICON) for each station.
3–16 –16 Network Design and Setup DL240 CPU Port Pinouts Network Design and Setup The DL240 CPU has two built-in DirectNET ports. Port 1: can be used for point-to-point communications with either RS232C or RS422. However Port 1 cannot be used in a multi-drop configuration even with an RS232C / RS422 converter. This is because the RTS signal pin is used for 5V. Port 2: can be used for either point-to-point or multi-drop connections. An RS232C/RS422 converter is required for multi-drop connections.
3–17 Network Design and Setup Point-to-point Cables Host as Master Slaves: DL405 DCM, DL405 CPU Port, DL305 RS232C DCU B A DL405 CPU Port DL405 DCM Connect to any of these devices DL305 w/DCU 9-pin Connector RS232C B Master Slave 2 RXD 2 TXD 3 TXD 3 RXD 5 GND 7 GND 1 DCD 4 RTS 4 DTR 5 CTS A DL405 CPU Port or DL405 DCM 6 DSR B RS232C Master Slave 2 TXD 3 RXD 3 RXD 2 TXD 7 GND 7 GND 4 RTS 4 RTS 5 CTS 5 CTS 6 DSR DL405 CPU Port or DL405 DCM 8 DCD 7 RTS or 8 CTS 9Ćpin
3–18 –18 Network Design and Setup Host as Master (continued) Slaves: DL340 CPU Port, DCM, DL240 CPU Port B A DL340 CPU Port DL240 CPU Port 2 C Connect to any of these devices 9-pin Connector A Network Design and Setup B RS232C Master 25-pin Connector Slave DL340 CPU Port A Master RS232C B Slave 2 RXD 2 TXD 2 TXD 3 TXD 1 RXD 1 RXD 3 RXD 5 GND 4 GND 2 TXD 7 GND 4 GND 1 DCD 4 DTR 6 DSR 7 RTS DL340 CPU Port 4 RTS Or, use phone cable adapter provided with the device 8 CTS 5
3–19 Network Design and Setup Host as Master (continued) Slaves: DL305 RS422 DCU A DL305 w/DCU B Male connector plugs onto DCU 9-pin Connector A RS232C A B RS232C Master FA–UNICON Converter for Slave B FA–UNICON Converter for Slave 2 RXD 3 RXD 2 TXD 2 TXD 3 TXD 2 TXD 3 RXD 3 RXD 5 GND 7 GND 4 RTS 1 DCD 20 DTR 4 DTR 25 +5V DL305 w/DCU 6 DSR DL305 w/DCU 5 CTS 7 GND 7 GND 6 DSR 7 RTS 8 DCD 8 CTS 20 DTR 20 DTR 25 +5 9-pin Connector 25-pin DCE Connector 25-pin DTE Connec
3–20 –20 Network Design and Setup DL405 DCM as Master A Slaves: DL405 DCM, DL405 CPU Port, DL305 RS232C DCU B A B RS232C Master DL405 CPU Port DL405 DCM Slave 2 TXD 3 RXD 3 RXD 2 TXD 4 RTS 4 RTS 5 CTS 5 CTS 7 GND 7 GND DL405 CPU Port or DL405 DCM Connect to anyone of these devices or DL305 w/DCU DL305 w/DCU 25-pin Connector 25-pin Connector Network Design and Setup Slaves: DL340 CPU Port, DL240 CPU Port, DL205 DCM A B DL340 CPU CPU Port DL240 CPU Port Connect to anyone of these
3–21 Network Design and Setup DL405 DCM as Master (continued) A Slaves: DL305 RS422 DCU B A B RS422 Master DL305 w/DCU Slave 7 10 11 12 13 GND +RTS –RTS +CTS –CTS 7 10 11 12 13 GND +RTS –RTS +CTS –CTS 14 15 16 17 +OUT –OUT –IN +IN 17 16 15 14 +IN –IN –OUT +OUT 22 23 24 25 +OUT –OUT –IN +IN 25 24 23 22 +IN –IN –OUT +OUT 25-pin Connector DL305 w/DCU 25-pin Connector Network Design and Setup Pin labeling conforms to the IBM DTE and DCE standards.
3–22 –22 Network Design and Setup Multi-Drop Cables More Considerations With RS422 you have great flexibility in how you want to design your network cabling. You also have to use: S Network Amplifiers – if you have more than 16 slave stations S Cable Termination Resistors – to help to reduce data errors. Network Amplifiers If you have more than 16 slave stations, you should use an RS422 amplifier to maintain the signal levels.
3–23 Network Design and Setup Cable Termination Resistors It is important you add termination resistors at each end of the RS422 line. This helps reduce data errors during data transmission. You should select resistors that match the cable impedance. For example, a typical 22 AWG solid conductor cable with 4.5 twists per foot has a typical impedance of about 120W. There are two ways to actually connect the resistors.
3–24 –24 Network Design and Setup Host as Master A Slaves: DL405 DCM, DL305 RS422 DCU C B DL405 DCM DL405 DCM D DL305 w/DCU A B C Master FA–UNICON Converter Slave Slave 3 RXD 2 TXD 2 TXD 3 RXD 5 GND 7 GND 1 DCD 20 DTR 4 DTR 25 +5V 6 DSR 7 RTS 8 CTS D RS422 — — — GND +RTS –RTS +CTS –CTS 7 10 11 12 13 7 10 11 12 13 GND +RTS –RTS +CTS –CTS 7 10 11 12 13 GND +RTS –RTS +CTS –CTS +OUT –OUT –IN +IN 17 16 15 14 17 16 15 14 +IN –IN –OUT +OUT 17 16 15 14 +IN –IN –OUT +OUT 25
3–25 Network Design and Setup Host as Master (continued) Slaves: DL340 CPU Port, DL240 CPU Port, DL205 DCM A B Master A FA–UNICON Converter RS422 — — — 2 RXD 3 RXD 3 TXD 2 TXD 5 GND 7 GND 1 DCD 20 DTR 4 DTR 25 +5V 6 DSR 7 RTS B 8 CTS GND +RTS –RTS +CTS –CTS 7 10 11 12 13 +OUT –OUT –IN +IN 17 16 15 14 9-pin Connector DL340 CPU Termination Resistor C C FA–UNICON Converter Slave D RXD 1 3 RXD TXD 2 2 TXD GND 4 RTS 3 20 DTR 7 GND DL340 CPU Or, use phone cable included with con
3–26 –26 Network Design and Setup Host as Master (continued) Slaves: DL305 RS232C DCU A A B Master FA–UNICON Converter RS422 — — — 2 RXD 3 RXD 3 TXD 2 TXD 5 GND 7 GND 1 DCD 20 DTR 4 DTR 25 +5V 6 DSR 7 RTS 8 CTS B 9-pin Connector DL305 DCU with Convertor GND +RTS –RTS +CTS –CTS 7 10 11 12 13 +OUT –OUT –IN +IN 17 16 15 14 +OUT –OUT –IN +IN 22 23 24 25 Termination Resistor C Network Design and Setup C FA–UNICON Converter DL305 DCU with Convertor Slave RS232C DCU D GND +RTS –R
3–27 Network Design and Setup DL405 DCM Master Slaves: DL405 DCM, DL305 RS422 DCU A A RS422 — — — B DCM Master B DL405 DCM C DL405 DCM C Slave DL305 DCU Slave 7 10 11 12 13 GND +RTS –RTS +CTS –CTS 7 10 11 12 13 GND +RTS –RTS +CTS –CTS 7 10 11 12 13 GND +RTS –RTS +CTS –CTS 14 15 16 17 +OUT –OUT –IN +IN 17 16 15 14 +IN –IN –OUT +OUT 17 16 15 14 +IN –IN –OUT +OUT 22 23 24 25 +OUT –OUT –IN +IN 25 24 23 22 +IN –IN –OUT +OUT 22 23 24 25 +OUT –OUT –IN +IN Termination Resistor Terminat
3–28 –28 Network Design and Setup DL405 DCM as Master (continued) A Slaves: DL340 CPU Port, DL240 CPU Port DCM Master RS422 — — — A DL340 CPU GND +RTS –RTS +CTS –CTS 7 10 11 12 13 +OUT –OUT –IN +IN 14 15 16 17 +OUT –OUT –IN +IN 22 23 24 25 Termination Resistor B B FA–UNICON Converter Network Design and Setup Slave DL240 CPU RXD 1 2 TXD TXD 2 3 RXD GND 4 RTS 3 20 DTR 7 GND DL340 CPU C Or, use phone cable included with converter to connect the D-shell to the phone jack GND +RTS
3–29 Network Design and Setup DL405 DCM Master (continued) A Slaves: DL305 RS232C DCU DCM Master A RS422 — — — DL305 DCU GND +RTS –RTS +CTS –CTS 7 10 11 12 13 +OUT –OUT –IN +IN 14 15 16 17 +OUT –OUT –IN +IN 22 23 24 25 Termination Resistor B B FA–UNICON Converter DL305 DCU Slave RS232C DCU 7 10 11 12 13 +IN –IN –OUT +OUT 14 15 16 17 Male connector plugs onto DCU C FA–UNICON Converter Slave RS232C DCU GND +RTS –RTS +CTS –CTS 7 10 11 12 13 +IN –IN –OUT +OUT 14 15 16 17 Male connector
3–30 –30 Network Design and Setup Network Design Checklist Network Design and Setup You can avoid problems Incorrect network cabling causes many problems. It’s important to make sure your network design and cable selection is complete before proceeding to the next chapters. Have you ...... 1. Drawn the network so you can easily identify the types of networks involved? 2.
Communication Settings In This Chapter. . . .
4–2 Communication Settings Communication Settings Selecting the communication settings. What do I have to select? There are a few things you need to select before you can set the communication switches for the network stations. S Baud rate S Parity S Response delay S Hexadecimal or ASCII data representation S Station address Baud Rate All devices on the network must use the same communication settings, but not all of the masters and slaves offer the same range of settings.
4–3 Communication Settings Setting the station parameters For all Masters and You have to set the switches for all the stations on the network, masters and slaves. Set the switches so all the stations have the same communication parameters. The Slaves next several pages provide the switch settings for the DirectLOGIC network components. You can quickly scan the pages to find the settings for your devices.
4–4 Communication Settings DL405 DCM Communication Switches There are two banks of switches located on the rear of the DCM that are used to set the communications parameters.
4–5 Communication Settings Online / Offline Switch Address Switch In the Offline position, this switch logically disconnects the DCM from the network (just as if you pulled the cable from the connector.) Once this switch is moved to the Offline position, the DCM will not communicate with the network. If you move the switch to the Online position, the DCM will communicate with the network, but not until the master sends another request for communication.
4–6 Communication Settings DL305 DCU Communications Switches First, make sure you have the correct model of DCU. There are two models. S D3–232–DCU (RS232C version) S D3–422–DCU (RS422 version) The DL305 DCU can only be used as a slave station interface. If you only have one master and one slave, you can use either version. If you have more than one slave you should probably use the the RS422 version. You can use the RS232C version, but you’ll need an RS232C / RS422 converter for each one.
4–7 Communication Settings Online / Offline Switch Address Switch In the Offline position, this switch logically disconnects the DCU from the network (just as if you pulled the cable from the connector.) Once this switch is moved to the Offline position, the DCU will not communicate with the network. (The switch is set to Offline when you’re using a handheld programmer.
4–8 Communication Settings Communication Settings DL430 and DL440 PLC Communication Switches If you look at the back of the DL440 CPU you will notice a small bank of switches. Switches 2, 3, and 4 are used to set the communication parameters for the bottom communication port. Switch 2 — It’s usually best to turn off this switch. If in the on position this switch will override the CPU slave address, and set the address to 1. (Remember each device on the network must have a unique address.
4–9 Communication Settings DL430 and DL440 Station Addresses With DirectSOFT, use AUX 56 from the Auxiliary functions menu to set the port parameters. With the DL405 Handheld Programmer, use AUX 56 to set the port parameters. The following example shows how to use the handheld programmer to set the address. DirectSOFT DL405 HP NOTE: The PLC port address is set in decimal, not hexadecimal.
4–10 Communication Settings DL340 Network Address Selection for Ports 1 and 2 DL340 Network Addressing Switch D3–340 CPU PWR RUN RX BATT TX CPU Network Address Mode Switch Fixed Station Address Selectable Station Address FIXED FIXED USER USER (Network Address (Network Address is set to 01) is set to 03) FIXED USER PRG RAM/UVPROM RS232C SW4 SW3 Most Significant Digit Least Significant Digit Port 1 (RS232C): Network address selection is accomplished with the Network Address Mode Swi
4–11 Communication Settings DL340 Baud Rate Selection The following chart shows how to configure the baud rate for Port 1 (RS232C) of the DL340 using dipswitch SW1, switches 3, 4 and 5. Port 2 baud rate is set by using a programming device to enter the baud rate in address R773 (in BCD or HEX).
4–12 Communication Settings DL240 Communication Settings The DL240 CPU is set similarly to the DL405 CPUs, except that all parameters can be set with AUX 56 from DirectSOFT or the Handheld Programmer.
4–13 Communication Settings The following example shows you can set the port parameters with the DL205 Handheld Programmer. NOTE: The PLC port address is set in decimal, not hexadecimal. DirectSOFT DL205 HP Select AUX 56 CLR CLR AUX F G 5 6 ENT ENT AUX 5* CPU CFG AUX 56 CPU N/W ADDRES Enter the Address (in decimal) X X ENT AUX 56 CPU N/W ADDRES N/W # 01 Select Hex or ASCII To change the mode press .... then press enter.
4–14 Communication Settings Communications Settings Checklist You can avoid problems The majority of problems are caused by incorrect switch settings. Make sure you have set the switches for each station. Have you... 1. Checked your computer documentation to obtain host master switch settings? (if applicable) 2. Set the communications switches for all stations? 3. Set the network addresses for all stations? Now, you’re ready to create the communications programs.
RLL Communications Programs In This Chapter. . . .
5–2 RLL Communications Programs Why do you need a communications program? The Master Initiates Requests DirectNET is a master / slave network, therefore; the master station must initiate requests for network data transfers. If you’re using a PLC as the master station, you use simple RLL instructions to initiate the requests. Why Ladder Logic? Since the DCM (network interface) does not contain any RLL, you have to use the PLC to issue the commands telling the DCM where to read or write data.
5–3 RLL Communications Programs This example writes 3 bytes of data from the Master Station (starting at V40600) to Y0 – Y37 in Slave Station #1.
5–4 RLL Communications Programs Identifying the Master and Slave Location of Master Whenever the WX or RX instructions are used, they must be preceded with the necessary LD and LDA instructions to set up the communication addresses, data to and Slave transfer and the location for the transference. The first Load (LD) instruction identifies the slot location of the DCM master and the slave station address. (Remember, the slot numbers start at 0.
5–5 RLL Communications Programs Specifying the Amount of Data Number of Bytes to The second LD instruction indicates the amount of data (in bytes) that needs to be Transfer transferred. You have to specify the amount of data in complete bytes. For example, Y0 – Y27 would be three bytes of data. The different PLC families do not always use the same types of memory or the same byte boundaries. For example, the DL305 does not use a separate data type for input and output points.
5–6 RLL Communications Programs Designating the Master Station Memory Area Memory Area of Master The Load Address (LDA) instruction specifies the V memory area of the master that will be used. This is the starting address (in octal). Additional sequential locations may be used, depending on the number of bytes that are being transferred. Since all DL405 data is mapped into V memory, you can easily access the data you need.
5–7 RLL Communications Programs Identifying the Slave Station Memory Area Memory Area of Slave to Read or Write The Read Network (RX) or Write Network (WX) is the last instruction in the routine. Use the RX if you want to read data from the slave, or use the WX instruction if you want to write data to the slave. You have to specify the data type and the starting address (in octal) for the slave. (Remember, you have to specify a data type that will work correctly with the number of bytes specified.
5–8 RLL Communications Programs Controlling the Communications Communications Special Relays When you execute communication with a DCM, chances are good the communication may take longer than the actual PLC scan. If the DCM is busy, you shouldn’t initiate another request until it is finished. Fortunately, there’s an easy solution for this. There are two SPs (special relays) for each slot in the CPU base which are used to provide communication status. For example, slot 0 has SP120 and SP121.
5–9 RLL Communications Programs Multiple Read and Write Interlocks If you’re using multiple reads and writes in the RLL program, you have to interlock the routines to make sure all the routines are executed. If you don’t use the interlocks, then the CPU will only execute the first routine. This is because the DCM can only handle one routine at a time. In the example, once the RX instruction is executed, C0 is set.
5–10 RLL Communications Programs What part of the manual should you use next? RLL Communications Programs Start the Network Once you’ve created the communications program, you can start the network. Chapter 7 provides information concerning network operation and troubleshooting. Appendices A and B provide examples of PLC master and PLC Peer networks. Both of these networks use RLL instructions for the communications program.
DirectNET Host Communications Programs 16 In This Chapter. . . .
6–2 DirectNET Host Communications Prog. DirectNET Host Communications Programs Why do you need a communications program? The Master Initiates Requests Since DirectNET is a master / slave network, the master station must initiate requests for network data transfers. If you’re using a host as the master station, you will need to use a communications program written with the DirectNET protocol.
6–3 DirectNET Host Communications Programs Master Read Request Slave Initiate Request Acknowledge Define Request Acknowledge Receipt of Data Acknowledge and Respond with Data Finished – All Data Sent Finished Write Request Initiate Request Acknowledge Define Request Acknowledge Transmit Data Acknowledge Receipt of Data Finished The remainder of this chapter discusses the individual elements of DirectNET protocol programs. DirectNET Host Communications Prog.
6–4 DirectNET Host Communications Prog. DirectNET Host Communications Programs Modes of Operation Transmission Bytes DirectNET can transfer a maximum of 65,791 bytes ( 256 blocks 256 bytes each + an additional 255 bytes) in a single request. The actual amount of system information that is transferred depends on the mode of operation. HEX or ASCII Mode There are two modes used with the DirectNET protocol, HEX or ASCII. You must choose the mode of operation before you write the program.
6–5 DirectNET Host Communications Programs In HEX mode, the number of bytes transferred is equal to the number of bytes for the selected data type. ASCII mode requires twice as many bytes to transfer the same data. Here’s a listing of the data types and their corresponding byte requirements.
6–6 DirectNET Host Communications Prog. DirectNET Host Communications Programs Protocol Components All DirectNET program read and write requests use the following protocol components. S Enquiry (ENQ) – initiates a request (from the master) with the slave stations. S Header (HDR) – defines the operation as a read or write, the slave station address, and the type and amount of data to be transferred. S Data (DATA) – the actual data that is being transferred.
6–7 DirectNET Host Communications Programs Master Read Request ENQ Slave Initiate Request Acknowledge HDR ACK Write Request Acknowledge Receipt of Data EOT Finished ENQ Initiate Request HDR DATA EOT ACK Define Request Acknowledge and Respond with Data ACK – DATA Finished – All Data Sent EOT Acknowledge ACK Acknowledge ACK Acknowledge Receipt of Data ACK Define Request Transmit Data Finished DirectNET Host Communications Prog.
6–8 DirectNET Host Communications Prog. DirectNET Host Communications Programs Controlling the Communications Control Codes All read or write requests use ASCII control codes and a Longitudinal Redundancy Check (LRC) to manage the communications between the master and slave. The control codes identify the beginning and ending of the protocol components such as, enquiry, acknowledge, etc. The LRC is used to ensure the data was transmitted and received correctly.
6–9 DirectNET Host Communications Programs Read Request Master ENQ Write Request Slave N Target Address ENQ ENQ N Target Address ACK HDR HDR STX Full Data Block ETB LRC ACK ACK ACK ACK ACK ACK STX Full Data Block ETB LRC DATA DATA STX Last Data Block ETX LRC ACK EOT EOT ACK ACK STX Last Data Block ETX LRC ACK DATA N Target Address ACK SOH Header ETB LRC ACK DATA Slave N Target Address ENQ ACK SOH Header ETB LRC ACK ACK Master EOT EOT EOT EOT DirectNET Host Communication
6–10 DirectNET Host Communications Prog. DirectNET Host Communications Programs Initiating the Request Enquiry ENQ The Enquiry is a three character message that initiates the request with the appropriate slave station. The message always begins with 4E (“N”), which means normal enquiry sequence. The second character contains the offset station address, which is the station address plus HEX 20. The last character is the ASCII control code for ENQ.
6–11 DirectNET Host Communications Programs Acknowledge ACK – NAK The three character acknowledge commands are used by both the master and slave stations to indicate the status of the communication. An ACK is used if the information was transmitted (or received) without any problems. If there are problems, Not Acknowledge (NAK) is used. A NAK will also be returned from the slave if something is incorrect in the header or data packet. This could be incorrect byte boundaries, an invalid address, etc.
6–12 DirectNET Host Communications Prog. DirectNET Host Communications Programs Defining the Request Header – HDR The header is a 17-byte (18-byte for ASCII transmissions) message that defines the operation. It is sent by the master station and specifies the following.
6–13 DirectNET Host Communications Programs Byte 4 indicates whether the operation is a read or write request. A value of HEX ASCII 30 is read, HEX ASCII 38 is write. Byte 5: Data Type This byte identifies the type of memory to be accessed. Appendices D–F provide a complete listing of the data types and memory references for product families. Bytes 6 & 7: Starting Address MSB The address is the starting point for the data transfer. The data is transferred from this point forward.
6–14 DirectNET Host Communications Prog. DirectNET Host Communications Programs Transferring Data Data Blocks The data blocks contain the actual data that is being transferred between the master and slave station. DirectNET transfers data in full blocks of 256 8-bit bytes, or partial blocks of less than 256 8-bit bytes. The 256 byte limit does not include control characters that signal the end of the data. To determine the number of full blocks, divide the number of bytes by 256.
6–15 DirectNET Host Communications Programs The HEX ASCII control codes that indicate the beginning and end of data blocks are used to manage the data transfer. Start of Text (STX) indicates the beginning of a data block. If there are several blocks, all but the last block will terminate with the End of Block (ETB) code. The last block always ends with End of Text (ETX). All transfers also include an LRC checksum.
6–16 DirectNET Host Communications Prog. DirectNET Host Communications Programs Calculating the Header Checksum Longitudinal Redundancy Check The LRC yields a checksum which is used to verify the communications are being received without errors. For a header, this checksum is calculated by taking the exclusive OR of all bytes between the Start of Header and End of Transmission (ETB). For a data block, the checksum is the exclusive OR of all bytes between the STX and ETB/ETX characters.
6–17 DirectNET Host Communications Programs HEX Mode: 1 byte LRC Checksum Decimal 8 0 0 0 0 1 0 0 0 1 byte 7 0 16 17 17 08 ETB LRC ASCII Mode: 2 bytes 16 17 & 18 17 3038 ETB LRC Calculating the Data LRC You should always calculate the LRC when either writing data to a slave or reading data from a slave. Note, during a read command slave stations will calculate their own LRC to be verified by the receiving device. However, you must calculate the value for LRC verification.
6–18 DirectNET Host Communications Prog. DirectNET Host Communications Programs Ending the Request End of Transmission – ETB When the last data block has been transferred and acknowledged, the End of Transmission (EOT) character is sent. The master station must always end the communication by sending an EOT (HEX ASCII 04). The following diagram shows the EOT format.
6–19 DirectNET Host Communications Programs Timeouts DL405 Timeouts The network communications generally operate very quickly and without problems. However, as with all things, problems can occur. Timeouts occur when either the master or slave does not receive a response to a communication within a certain period of time. There are two timeout possibilities. S Slave timeout – this occurs when the slave does not respond within a specified time.
6–20 DirectNET Host Communications Prog. DirectNET Host Communications Programs DL305 Timeouts Communication Segment Master sends ENQ → Slave sends ACK 800 Master receives ACK → sends Header 800 Slave receives SOH → waits for Header LRC 300 baud 1200 baud 9600 baud 19.2K baud Slave receives Header → sends ACK/NAK (Destination – write is slave, read is PLC) Master receives ACK → Data is transferred Destination receives Data → sends ACK/NAK 300 baud 1200 baud 9600 baud 19.
6–21 DirectNET Host Communications Programs Start the Network Once you’ve created the communications program, you can start the network. Chapter 7 provides information concerning network operation and troubleshooting. Appendix C provides an example of a hosted network. DirectNET Host Communications Prog.
Network Operation and Troubleshooting In This Chapter. . . .
7–2 Network Operation and Troubleshooting Network Operation & Troubleshooting Starting the Network PLC as Master Networks If you’re using a PLC as the master station, you must put the CPU in Run mode before the communications program can be executed. This is because the PLC master uses RLL instructions included in your application program to initiate the data transfer requests. There are two ways to place the CPUs in run mode. S Turn the keyswitch to the RUN position.
7–3 Network Operation and Troubleshooting Troubleshooting Try an Example Program Sometimes it is helpful to have an example you can try. AppendicesA,B, andC provide examples of the three network configurations. You can quickly and easily build a small network to make sure you are following all the appropriate steps. These are especially helpful if this is your first DirectNET application. CPUs with Built-in DirectNET Ports Most problems that occur with the CPUs are related to communication settings.
7–4 Network Operation and Troubleshooting DL405 DCM Indicators Check the DCM indicators to verify the DCM is operating correctly. The following diagram shows the proper indicator conditions.
7–5 Network Operation and Troubleshooting Indicator Status PWR or OK off Possible Cause Corrective Action Check the PLC source power. DCM is defective Replace the DCM. MSTR off (and DCM is in a master station) Switch setting is incorrect Remove power from the PLC, remove the DCM and check switch positions1 and 2 on SW5. ENQ indicator does not come on when communications program is executed The PLC master station is not in Run mode Place the PLC in Run mode.
7–6 Network Operation and Troubleshooting DL305 DCU Indicators Check the DCU indicators to verify the DCU is operating correctly. The following diagram shows the proper indicator conditions. Network Operation & Troubleshooting On when PLC is in Run Mode On when PLC battery needs replacing On when CPU watchdog timer has expired On when data is being transmitted RUN DATA BATT DIAG CPU PWR On when internal diagnostic tests are complete On when base power is on.
7–7 Network Operation and Troubleshooting The following table provides additional troubleshooting details for the DL305 DCU. Indicator Status PWR off Possible Cause Corrective Action Check the PLC source power. DCU is not connected to the CPU properly Make sure the DCU is securely fastened to the CPU and that no connector pins are bent. DCU external power source (if used) is not connected Check the external power source.
PLC Master / Slave Example In This Chapter. . . . 1A Ċ The Example Ċ Remember these Four Steps! Ċ Step 1: Design the Network Ċ Step 2: Select the Communication Settings Ċ Step 3: Create the Communications Program.
A–2 Appendix A Master / Slave Example PLC Master / Slave Example The Example This chapter provides an example of a PLC master / slave network and is designed for the experienced user. This chapter does not provide detailed descriptions of network concepts and communications parameters. If you’re unfamiliar with networking concepts, or if you want to know more detailed information about DirectNET, you may want to read Chapters 2 – 5 before setting up the example network.
A–3 PLC Master / Slave Example Normally, you can install the modules in any manner. However, we’d like to keep our examples consistent between the different configurations. Install the equipment in the following order. WARNING: To minimize the risk of electrical shock, personal injury, or equipment damage, always disconnect the system power before installing or removing any system component. 1. Install the CPU in the far left side of the base in the position marked “CPU/Power Supply”.
A–4 Remember these Four Steps! Use these steps to build your example network. The remainder of this chapter provides detailed explanations and examples of these steps. Master / Slave 1. Design the network by: S Selecting the configuration (this is a master / slave configuration) S Building the communication cables 2. Select the communication settings by: S Setting the master switches S Setting the slave switches 3. Write the communication control program. S RLL program is used with PLC master 4.
A–5 PLC Master / Slave Example The Example Configuration In this chapter we’ll use the following example configuration to create a simple master slave network. WARNING: These examples are for illustration purposes only and are not intended for use in actual applications. This is because there may be many aspects of your system safety precautions that are not addressed in the examples. If you use these examples in actual applications, you are increasing the risk of personal injury and/or property damage.
A–6 Appendix A Master / Slave Example PLC Master / Slave Example The Example Cable In our example configuration we have: S A PLC with a DCM as the master station S A PLC with a DCM as slave station #1. S A DL440 PLC with a built-in DirectNET port as slave station #2 We’ll have to use the pinout diagrams for those slaves. Also, since we have more than one slave station we’ll use the RS422 multi-drop cable.
A–7 PLC Master / Slave Example Set the DCM Switches for the Master Station The next step is to set the master station DCM communication parameters. We will use the following settings in our example. S On-line / Off-line — On-line position S Address — 0 (hexadecimal) S Baud Rate — 19.
A–8 Appendix A Master / Slave Example PLC Master / Slave Example Set the DCM Switches for Slave #1 Slave station #1 is a DL405 PLC with a DCM as the network interface. Set the DCM address to 1. Set the communication parameters to match the master station. S Address — 1 (hexadecimal) S On-line / Off-line — On-line position S Baud Rate — 19.
A–9 PLC Master / Slave Example With DirectSOFT, use AUX 56 from the Auxiliary functions menu to set the port parameters. With the DL405 handheld programmer, use AUX 56 to set the port parameters. The following example shows how to use the handheld programmer to set the address. DirectSOFT NOTE: The PLC port address is set in decimal, not hexadecimal.
A–10 Appendix A Master / Slave Example PLC Master / Slave Example Step 3: Create the Communications Program. Program Description In the example network, we’ll use 8 switches on the input simulator in the master system to set a bit pattern that will be written to an output module on the slave station #1. Also, we’ll read the current value of a timer from slave station #2. Our example requires a program in both the master and slave stations. Goal: 1.
A–11 PLC Master / Slave Example The following diagram shows the RLL instructions used in the communications program. Chapter 5 provides detailed descriptions of the instructions. You should always use the interlocking relays to ensure that the DCM has adequate time to finish a communication task.
A–12 Appendix A Master / Slave Example PLC Master / Slave Example Master Program RLL Example DirectSOFT SP120 C0 DL405 HP Mnemonics LD K0001 LD K0001 LDA O40400 WX Y0 Set C0 SP120 C0 LD K0002 LD K0002 LDA O2000 RX V0 RST C0 END $0 STRN SP120 $1 ANDN C0 $2 LD K0001 $3 LD K0001 $4 LDA O40400 $5 WX Y0 $6 SET C0 $8 STRN SP120 $9 AND C0 $10 LD K0002 $11 LD K0002 $12 LDA O2000 $13 RX V0 $15 RST C0 $16 END
A–13 PLC Master / Slave Example DirectSOFT DL405 HP Mnemonics ISG 0 SP120 LD K0001 LD K0001 LDA O40400 WX Y0 JMP S1 SG 1 SP120 LD K0002 LD K0002 LDA O2000 RX V0 JMP S0 END $0 ISG S0 $1 STRN SP120 $2 LD K0001 $3 LD K0001 $4 LDA O40400 $5 WX Y0 $6 JMP S1 $8 SG S001 $9 STRN SP120 $10 LD K0002 $11 LD K0002 $12 LDA O2000 $13 RX V0 $15 JMP S0 $16 END Appendix A Master / Slave Example Master Program RLL PLUS Example
A–14 Appendix A Master / Slave Example PLC Master / Slave Example Slave Station #2 Program RLL Example Our example requires a program in slave station #2. The slave station program is much easier because the master station program controls the communication. In the slave station, we’re just using a self-resetting timer to provide a data value.
A–15 PLC Master / Slave Example Switch the PLCs to Run Mode Only the master station needs to be in Run mode to execute the communications program. However, for this example to work correctly all CPUs should be in Run mode. You can use the programming devices to place them in Run mode,or you just turn the keyswitch to the RUN position.
A–16 Appendix A Master / Slave Example PLC Master / Slave Example Verify the Network Check the DCM indicators to verify that the network is operating correctly. shows the proper indicator conditions. The ENQ, HDR, and DATA indicators should be flashing.
A–17 PLC Master / Slave Example You’ll need to use the programming device to verify the read requests. Connect the programming device and complete the following steps.
A–18 Appendix A Master / Slave Example PLC Master / Slave Example What should I do if it isn’t working correctly? Troubleshooting Steps If the network does not seem to be working correctly, check the following items. 1. Cable and connections. Incorrectly wired cables and loose connectors cause the majority of problems. Verify that you’ve selected the proper cable configuration and check that the cable is wired correctly. 2. Dipswitch settings.
Peer Master Example 1B In This Chapter. . . .
B–2 Peer Master Example The Example Appendix B Peer Master Example This chapter provides an example of a peer-to-peer network and is designed for the experienced user. This chapter does not provide detailed descriptions of network concepts and communications parameters. If you’re unfamiliar with networking concepts, or if you want to know more detailed information about DirectNET, you may want to read Chapters 2 – 5 before setting up the example network.
B–3 Peer Master Example Install the Equipment Normally, you can install the modules in any manner. However, we’d like to keep our examples consistent between the different configurations. Install the equipment in the following order. WARNING: To minimize the risk of electrical shock, personal injury, or equipment damage, always disconnect the system power before installing or removing any system component. Appendix B Peer Master Example 1. Install the CPU as described in the DL405 User Manual.
B–4 Peer Master Example Remember these Four Steps! Appendix B Peer Master Example Use these steps to build your example network. The remainder of this chapter provides detailed explanations and examples of these steps. Peer to Peer 1. Design the network by: S Selecting the configuration (this is a Peer as Master configuration) S Building the communication cables. 2. Select the communication settings by: S Setting the Peer Master switches 3. Write the communication control program.
B–5 Peer Master Example Step 1: Design the Network The Example Configuration In this chapter we’ll use the following example configuration to create a simple peer network. WARNING: These examples are for illustration purposes only and are not intended for use in actual applications. This is because there may be many aspects of your system safety precautions that are not addressed in the examples.
B–6 Peer Master Example Step 2: Select the Communication Settings Appendix B Peer Master Example Set the DCM Switches for Peer #1 The next step is to set the communications parameters for the DCM in peer station #1. We will use the following settings in our example. S On-line / Off-line — On-line position S Address — 1 (hexadecimal) S Baud Rate — 38.
B–7 Peer Master Example The next step is to set the communications parameters for the DCM in peer station #2. Notice the settings are exactly the same, with the exception of the address. S On-line / Off-line — On-line position S Address — 2 (hexadecimal) S Baud Rate — 38.
B–8 Peer Master Example Step 3: Create the Communications Programs Two Programs are Required With peer networks, you need a communications program in both stations. Each program contains the necessary instructions to initiate the data requests. Peer Station #1 Program Description For peer station #1, we’ll use 8 switches on the input simulator to set a bit pattern that will be written to an output module on peer station #2.
B–9 Peer Master Example The example provides the instructions needed for the DirectSOFT programming Connect the Programing Device package and for the DL405 Handheld Programmer. In either case, you should connect the programming device to the top port on the DL405 CPU. We assume you understand how to use the DirectSOFT Programming Package and/or the Handheld Programmer. If you aren’t familiar with these, you should probably review those product manuals prior to trying to enter these programs.
B–10 Peer Master Example Peer Station #1 RLL Instructions The following diagram shows the RLL instructions used in the communications program for peer station #1. Chapter 5 provides detailed descriptions of the instructions. Since we also plan to use peer station #2 to read a V memory location from peer station #1, we’re using a self-resetting timer to provide a data value. This will make it easier to verify our example is working correctly.
B–11 Peer Master Example Peer Station #1 RLL Example DirectSOFT T0 SP120 DL405 HP Mnemonics TMR T0 K9999 LD K0002 K0001 LDA O40400 WX Y0 END NOTE: To create this program in RLL PLUS, just add an initial stage (ISG 0) to the beginning of the program.
B–12 Peer Master Example Peer Station #2 RLL Instructions The following diagram shows the RLL instructions used in the communications program for peer station #2. Chapter 5 provides detailed descriptions of the instructions. NOTE: This example does not have multiple communications requests in each station. If you need multiple requests in your application, you should use the interlocking relays to ensure the DCM has adequate time to finish a communication task. See Chapter 4 for more detailed information.
B–13 Peer Master Example Peer Station #2 RLL Example DirectSOFT SP120 DL405 HP Mnemonics LD K0001 LD K0002 RX V0 END NOTE: To create this program in RLL PLUS, just add an initial stage (ISG 0) to the beginning of the program.
B–14 Peer Master Example Step 4: Start the Network Appendix B Peer Master Example Switch the PLCs to Run Mode For this example to work correctly both CPUs should be in Run mode. You can use the programming devices to place them in Run mode,or you can just turn the keyswitch to the RUN position.
B–15 Peer Master Example Verify the Network Check the DCM indicators to verify the network is operating correctly. shows the proper indicator conditions. The ENQ, HDR, and DATA indicators should be flashing. Self Test Indicator: ON Module Power: ON PWR NAK TOUT MSTR OK ENQ HDR DATA Send/Receive Enquiry: FLASHING Send/Receive Header: FLASHING Verify the Write Command Now you can change the I/O simulator switch settings and verify the communications. 1. Set every other switch to the ON position 2.
B–16 Peer Master Example Verify the Read Command You’ll need to use the programming device to verify the read requests. Connect the programming device to peer station #2 and complete the following steps.
Host Master Example 1C In This Chapter. . . . — The Example — Remember these Four Steps! — Step 1: Design the Network — Step 2: Select the Communication Settings — Step 3: Create the Communications Program — Step 4: Start the Network.
C–2 Host Master Example The Example Example Equipment A hosted network utilizes an intelligent device, such as a personal computer, to act as the network master station. Slave stations can be DCMs or DirectLOGIC PLCs with built-in DirectNet ports. The host device initiates all communication requests and the slaves respond to the requests for data. This example is not intended to show you how to build DirectLink programs.
C–3 Host Master Example Install the Equipment Normally, you can install the modules in any manner. However, we’d like to keep our examples consistent between the different configurations. Install the equipment in the following order. WARNING: To minimize the risk of electrical shock, personal injury, or equipment damage, always disconnect the system power before installing or removing any system component. 1. Install the CPUs as described in the DL405 User’s Manual.
C–4 Host Master Example Remember these Four Steps! Use these steps to build your example network. The remainder of this chapter provides detailed explanations and examples of these steps. Host 1. Design the network by: S Selecting the configuration (this is a Host as Master configuration) S Building the communication cables. Appendix C Host Master Example 2. Select the communication settings by: S Setting the station switches 3. Write the communication control program.
C–5 Host Master Example Step 1: Design the Network The Example Configuration In this chapter we’ll use the following example configuration to create a simple Host master network. WARNING: These examples are for illustration purposes only and are not intended for use in actual applications. This is because there may be many aspects of your system safety precautions that are not addressed in the examples.
C–6 Host Master Example The Example Cable In our example configuration we have: S A personal computer as the master station S A DL440 PLC with a built-in DirectNet port as slave station #1 Since this is a simple point-to-point network, we can use RS232C communications.
C–7 Host Master Example Step 2: Select the Communication Settings Set the Personal Computer as the Master Station Set the PLC Switches for the Slave Station The next step is to set the personal computer communication parameters (in the BASIC program). The parameters are typically set with software on the personal computer. The best place to find this information is in the documentation that came with your computer.
C–8 Host Master Example Set the Station Address for the Slave Station With DirectSOFT, use AUX 56 from the Auxiliary functions menu to set the port parameters. With the DL405 Handheld Programmer, use AUX 56 to set the port parameters. The following example shows how to use the handheld programmer to set the address. DirectSOFT NOTE: The PLC port address is set in decimal, not hexadecimal.
C–9 Host Master Example Step 3: Create the Communications Program DirectNET Programs Example Program The communications program used with a hosted network is more complex than the simple RLL instructions used with the other configurations, but the concept is the same. The host is the DirectNET master and must use a DirectNET protocol communications program to initiate all network requests to read or write data.
C–10 Host Master Example Peer Master Example Appendix C Host Master Example Example Program to Read Data 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 The following program will read X0–X7 from Slave Station #1. REM Program to read X0–X7 from a 405 PLC REM REM Define all variables REM REM Change the slave address in HEX at line 60 if required.
C–11 Host Master Example Host Master Example REM Do Header RETRY=0 PRINT #1,HEADER$;LRC$; INPUT #1,HEADERRESP$:PRINT ”Header Response = ”;HEADERRESP$ IF MID$(HEADERRESP$,1,1)=ACK$ THEN GOTO 560 RETRY=RETRY+1 IF RETRY>2 THEN GOTO 760 GOTO 490 REM Get the data RETRY=0 INPUT #1,DAT$ GOSUB 850 IF VALUELRC$=DATLRC$ THEN GOTO 640 PRINT #1,NAK$; RETRY=RETRY+1 IF RETRY>2 THEN GOTO 760 GOTO 570 REM Print the data to the screen PRINT ”Data = ”;VALUE$ REM Do the ACK RETRY=0 PRINT #1,ACK$; INPUT #1,ACKRESP$:PRINT ”EO
C–12 Host Master Example Peer Master Example Appendix C Host Master Example Example Program to Write Data 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 The following program will write a value to Y0 – Y7 in Slave Station #1.
C–13 Host Master Example Host Master Example REM Begin active program REM CLS OPEN ”COM1:9600,N,8,1,RS,DS” AS #1 LRC=0:DATLRC=0 INPUT ”ENTER DATA STRING (2 DIGITS, 0–F) ” , VALUE$ GOSUB 650 GOSUB 730 RETRY=0 PRINT #1,SLAVEENQ$; INPUT #1,ENQRESP$:PRINT ”Enquire Response = ”;ENQRESP$ IF MID$(ENQRESP$,3,1)=ACK$ THEN GOTO 490 RETRY=RETRY+1 IF RETRY>2 THEN GOTO 640 GOTO 430 RETRY=0 PRINT #1,HEADER$;LRC$; INPUT #1,HEADERRESP$:PRINT ”Header Response = ”;HEADERRESP$ IF MID$(HEADERRESP$,1,1)=ACK$ THEN GOTO 560 RET
C–14 Host Master Example Peer Master Example Appendix C Host Master Example Step 4: Start the Network. Execute the PC Master Program This program was designed to work with GWBasic. Complete the following steps to execute the example program. 1. Start GWBasic. 2. Load the file you used to create the read example program. Verify the Read Command Now you can change the I/O simulator switch settings and verify the communications. 1. Set every other switch to the ON position . 2. Execute the program.
C–15 Host Master Example What should I do if it isn’t working correctly? Troubleshooting Steps If the network does not seem to be working correctly, check the following items. 1. Cable and connections. Incorrectly wired cables and loose connectors cause the majority of problems. Verify you’ve selected the proper cable configuration and check to see the cable is wired correctly. 2. Dipswitch settings.
DL405 Data Types and Memory Maps In This Chapter. . . .
D–2 DL405 Data Types and Memory Map DL405 Data Types The following table shows the data types available with the DL405 products. DL405 Data Type Description Bits per unit Number of bytes HEX ASCII 31 V memory T / C current value 16 16 2 2 4 4 32 Inputs (X, GX, SP) 8 1 2 33 Outputs (Y, C, Stage, T/C bits) 8 1 2 39 Diagnostic Status 8 1 2 NOTE: Not all DL405 CPUs offer the same memory ranges. Check your DL405 User Manual to determine the ranges for your particular model.
D–3 DL405 Data Types and Memory Map Data Type 31 (continued) Memory Type DirectNET Reference Address V40400 V40401 ——— V40423 X X ——— X 4101 4102 ——— 4114 V40500 V40501 ——— V40523 Y Y ——— Y 4141 4142 ——— 4154 V40600 V40601 ——— V40677 C C ——— C 4181 4182 ——— 41C0 V41000 V41001 ——— V41077 Stage Bits Stage Bits ——— Stage Bits 4201 4202 ——— 4240 V41100 V41101 ——— V41117 TMR Status Bits TMR Status Bits ——— TMR Status Bits 4241 4242 ——— 4250 V41140 V41141 ——— V41147 CTR Status Bits CTR Status
D–4 DL405 Data Types and Memory Map Host Master Example Appendix D DL405 Memory Map Data Type 32 Inputs V-Memory Address Memory Type Range DirectNET Reference Address V40000 LSB V40000 MSB V40001 LSB ——— V40077 LSB V40077 MSB GX GX GX ——— GX GX 0007 – 0000 0017 – 0010 0027 – 0020 ——— 1767 – 1760 1777 – 1770 0001 0002 0003 ——— 007F 0080 V40400 LSB V40400 MSB V40401 LSB ——— V40423 LSB V40423 MSB X X X ——— X X 0007 – 0000 0017 – 0010 0027 – 0020 ——— 0467 – 0460 0477 – 0470 0101 0102 0103 ——— 012
D–5 DL405 Data Types and Memory Map Data Type 33 Outputs Memory Type Range DirectNET Reference Address V40500 LSB V40500 MSB V40501 LSB ——— V40523 LSB V40523 MSB Y Y Y ——— Y Y 0007 – 0000 0017 – 0010 0027 – 0020 ——— 0467 – 0460 0477 – 0470 0101 0102 0103 ——— 0127 0128 V40600 LSB V40600 MSB V40601 LSB ——— V40677 LSB V40677 MSB C C C ——— C C 0007 – 0000 0017 – 0010 0027 – 0020 ——— 1767 – 1760 1777 – 1770 0181 0182 0183 ——— 01FF 0200 V41000 LSB V41000 MSB V41001 LSB ——— V41077 LSB V41077 MSB Stag
D–6 DL405 Data Types and Memory Map Data Type 39 Diagnostic Status You can use Data Type 39 to obtain DirectNET diagnostic status. The following tables show the reference addresses for the various types of information and the DirectNET error codes (used with address 0000).
D–7 DL405 Data Types and Memory Map DL430 Memory Map Memory Type Discrete Memory Reference (octal) Word Memory Reference (octal) Qty.
D–8 DL405 Data Types and Memory Map DL440 Memory Map Memory Type Discrete Memory Reference (octal) Word Memory Reference (octal) Qty.
D–9 DL405 Data Types and Memory Map X Input Bit Map This table provides a listing of the individual Input points associated with each V-memory address bit for the DL430 and DL440 CPUs.
D–10 DL405 Data Types and Memory Map Y Output Bit Map This table provides a listing of the individual output points associated with each V-memory address bit for both the DL430 and DL440 CPUs.
D–11 DL405 Data Types and Memory Map Remote I/O Bit Map This table provides a listing of the individual remote I/O points associated with each V-memory address bit.
D–12 DL405 Data Types and Memory Map This portion of the table shows additional Remote I/O points available with the DL440.
D–13 DL405 Data Types and Memory Map Control Relay Bit Map This table provides a listing of the individual control relays associated with each V-memory address bit.
D–14 DL405 Data Types and Memory Map This portion of the table shows additional Control Relays points available with the DL440.
D–15 DL405 Data Types and Memory Map Stage Control / Status Bit Map This table provides a listing of the individual stage control bits associated with each V-memory address bit.
D–16 DL405 Data Types and Memory Map MSB 17 DL440 Additional Stage (S) Control Bits (continued) 16 15 14 13 12 Host Master Example Appendix D DL405 Memory Map 1017 1016 1015 1014 1013 1012 11 1011 10 7 6 5 4 LSB 3 2 1 0 Address 1010 1007 1006 1005 1004 1003 1002 1001 1000 V41040 1037 1036 1035 1034 1033 1032 1031 1030 1027 1026 1025 1024 1023 1022 1021 1020 V41041 1057 1056 1055 1054 1053 1052 1051 1050 1047 1046 1045 1044 1043 1042 1041 1040 V41042 1077 1076 1075 1074 1073
D–17 DL405 Data Types and Memory Map Timer Status Bit Map This table provides a listing of the individual timer contacts associated with each V-memory address bit.
D–18 DL405 Data Types and Memory Map Counter Status Bit Map This table provides a listing of the individual counter contacts associated with each V-memory address bit.
DL305 Data Types and Memory Map In This Chapter. . . .
E–2 DL305 Data Types and Memory Map DL305 Data Types The following table shows the data types available with the DL405 family of products.
E–3 DL305 Data Types and Memory Map Data Type 39 Diagnostic Status You can use Data Type 39 to obtain DirectNET diagnostic status. The only valid address for the DL305 products is 0000 (hex). There are 5 status words that can be read or cleared. You must access these words as a complete group. The following tables show the reference addresses for the various types of information and the DirectNET error codes (used for word 1).
E–4 DL305 Data Types and Memory Map Error Code Applicable Data Type 00 All types The transfer was successful. 00 also occurs if: 1. The transfer direction (Read / Write) is not 30 or 38. 2. A code other than ASCII code 0 to F has been received in ASCII mode. 3. E01 or E10 occurred during a write operation from the host to the CPU. 01 All types A timeout occurred in the serial link. 03 32, 33 A request was made to read or write a non-existent I/O point.
E–5 DL305 Data Types and Memory Map DL330 Memory Map Memory Type Discrete Memory Reference (octal) Register Memory Reference (octal) Qty.
E–6 DL305 Data Types and Memory Map DL330P Memory Map Memory Type Discrete Memory Reference (octal) Register Memory Reference (octal) Qty.
E–7 DL305 Data Types and Memory Map DL340 Memory Map Memory Type Discrete Memory Reference (octal) Register Memory Reference (octal) Qty.
E–8 DL305 Data Types and Memory Map I/O Point Bit Map These tables provide a listing of the individual Input points associated with each register location for the DL330, DL330P, and DL340 CPUs.
E–9 DL305 Data Types and Memory Map Control Relay Bit Map The following tables provide a listing of the individual control relays associated with each register location for the DL305 CPUs. NOTE: 160 – 167 can be used as I/O in a DL330 or DL330P CPU under certain conditions. 160 – 177 can be used as I/O in a DL340 CPU under certain conditions. You should consult the DL305 User Manual to determine which configurations allow the use of these points.
E–10 DL305 Data Types and Memory Map MSB 167 166 207 217 227 237 247 257 267 277* 206 216 226 236 246 256 266 276 DL330P Control Relay References 165 164 163 162 174 173 172 205 204 203 202 215 214 213 212 225 224 223 222 235 234 233 232 245 244 243 242 255 254 253 252 265 264 263 262 275 274 273 272 LSB 161 171 201 211 221 231 241 251 261 271 160 170 200* 210 220 230 240 250 260 270 Register Number R16 R17 R20 R21 R22 R23 R24 R25 R26 R27 * Control relays 200 – 277 can be made retentive by setting
E–11 DL305 Data Types and Memory Map Special Relays The following table shows the Special Relays used with the DL305 CPUs. CPUs DL330P DL330 DL340 DL330 DL330P DL340 DL340 Special Relay Description of Contents 175 100 ms clock, on for 50 ms and off for 50 ms. 176 Disables all outputs except for those entered with the SET OUT instruction. 177 Battery voltage is low. 374 On for the first scan cycle after the CPU is switched to Run Mode. 375 100 ms clock, on for 50 ms and off for 50 ms.
E–12 DL305 Data Types and Memory Map Timer / Counter Registers and Contacts The following table shows the locations used for programming timer or counters. Since timers and counters share the same data area, you cannot have timers and counters with duplicate numbers. For example, if you have Timer 600, you cannot have a Counter 600. Each register contains the current value for the timer or counter. Each timer or counter also has a timer or counter contact with the same reference number.
E–13 DL305 Data Types and Memory Map Data Registers The following 8-bit data registers are primarily used with data instructions to store various types of application data. For example, you could use a register to hold a timer or counter preset value. Some data instructions call for two bytes, which will correspond to two consecutive 8-bit data registers such as R401 and R400.
E–14 Appendix E DL305 Memory Map DL305 Data Types and Memory Map 407 417 427 437 447 457 467 477 507 517 527 537 547 557 406 416 426 436 446 456 466 476 506 516 526 536 546 556 405 415 425 435 445 455 465 475 505 515 525 535 545 555 707 717 727 737 747 757 767 706 716 726 736 746 756 766 705 715 725 735 745 755 765 DL340 8-Bit Data Registers 404 403 414 413 424 423 434 433 444 443 454 453 464 463 474 473 504 503 514 513 524 523 534 533 544 543 554 553 563 704 703 714 713 724 723 734 733 744 743 754
E–15 DL305 Data Types and Memory Map Stage Control / Status Bit Map This table provides a listing of the individual stages and stage control bits. These are only available with the DL330P CPU.
E–16 DL305 Data Types and Memory Map Shift Register Bit Map The shift register bits listed below are used in the shift register instruction. These outputs are discrete bits and are not the same locations as the 8 Bit Data Registers. These bits are retentive meaning they retain their state after a power cycle. NOTE: The DL330P does not have Shift Register bits. Shift Register instructions in the DL330P use Control Relays memory references.
E–17 DL305 Data Types and Memory Map Special Registers This table provides a listing of the special registers used with the DL305 CPUs. CPUs DL330 DL330P DL340 DL340 Only Special Register Description of Contents R574 – 575 Contains the error code used with the FAULT instruction. R576 – 577 Auxiliary accumulator used with the MUL and DIV instructions. R771 Sets the upper byte of the station address assigned to the bottom communication port.
E–18 DL305 Data Types and Memory Map DL305 / 405 Cross Reference If you are using a DL405 Master, you will have to make some slight changes in the way you request certain types of data. For example, the DL405 uses V-memory references instead of Register references. This section shows the cross references. NOTE: Not all DL305 devices offer the same memory ranges. Check your DL305 User Manual to determine the ranges for your particular model. Data Type 31: Register Access To get to ...
E–19 DL305 Data Types and Memory Map RLL PLUS CPUs To get to ... I/O Points, CRs, & Shift Registers in a DL305 Use Ref. ... in a DL405 To get to ... Stage Status Bit in a DL305 Use Ref. ... in a DL405 To get to ... TMR / CNT Status Bit in a DL305 Use Ref. ...
DL205 Data Types and Memory Map In This Chapter. . . .
F–2 Appendix F DL205 Memory Map DL205 Data Types and Memory Map DL205 Data Types The following table shows the data types available with the DL205 products. DL205 Data Type Description Bits per unit Number of bytes HEX ASCII 31 V memory T / C current value 16 16 2 2 4 4 32 Inputs (X, GX, SP) 8 1 2 33 Outputs (Y, C, Stage, T/C bits) 8 1 2 39 Diagnostic Status 8 1 2 NOTE: Not all DL205 devices offer the same memory ranges.
F–3 DL205 Data Types and Memory Map V-memory Address Memory Type DirectNET Reference Address V40400 V40401 ——— V40423 X X ——— X 4101 4102 ——— 4114 V40500 V40501 ——— V40523 Y Y ——— Y 4141 4142 ——— 4154 V40600 V40601 ——— V40617 C C ——— C 4181 4182 ——— 4190 V41000 V41001 ——— V41037 Stage Bits Stage Bits ——— Stage Bits 4201 4202 ——— 4218 V41100 V41101 ——— V41107 TMR Status Bits TMR Status Bits ——— TMR Status Bits 4241 4242 ——— 4248 V41140 V41141 ——— V41147 CTR Status Bits CTR Status Bits ———
F–4 Host Master Example Peer Master Example Appendix F DL205 Memory Map DL205 Data Types and Memory Map Data Type 32 Input Points V-Memory Address Memory Type Range DirectNET Reference Address V40400 LSB V40400 MSB V40401 LSB ——— V40423 LSB V40423 MSB X X X ——— X X 0007 – 0000 0017 – 0010 0027 – 0020 ——— 0467 – 0460 0477 – 0470 0101 0102 0103 ——— 0127 0128 V41200 LSB V41200 MSB V41201 LSB ——— V41205 LSB V41205 MSB Special Relay Special Relay Special Relay ——— Special Relay Special Relay 0007
F–5 DL205 Data Types and Memory Map V-Memory Address Memory Type Range DirectNET Reference Address V40500 LSB V40500 MSB V40501 LSB ——— V40523 LSB V40523 MSB Y Y Y ——— Y Y 0007 – 0000 0017 – 0010 0027 – 0020 ——— 0467 – 0460 0477 – 0470 0101 0102 0103 ——— 0127 0128 V40600 LSB V40600 MSB V40601 LSB ——— V40617 LSB V40617 MSB C C C ——— C C 0007 – 0000 0017 – 0010 0027 – 0020 ——— 0367 – 0360 0377 – 0370 0181 0182 0183 ——— 019F 01A0 V41000 LSB V41000 MSB V41001 LSB ——— V41037 LSB V41037 MSB Stage Bi
F–6 Appendix F DL205 Memory Map DL205 Data Types and Memory Map Data Type 39 Diagnostic Status You can use Data Type 39 to obtain DirectNET diagnostic status. The following tables show the reference addresses for the various types of information and the DirectNET error codes (used with address 0000).
F–7 DL205 Data Types and Memory Map Memory Type Discrete Memory Reference (octal) Word Memory Reference (octal) Qty.
F–8 Appendix F DL205 Memory Map DL205 Data Types and Memory Map DL240 Memory Map Memory Type Discrete Memory Reference (octal) Word Memory Reference (octal) Qty.
F–9 DL205 Data Types and Memory Map This table provides a listing of the individual Input points associated with each V-memory address bit for the DL230 and DL240 CPUs.
F–10 Host Master Example Peer Master Example Appendix F DL205 Memory Map DL205 Data Types and Memory Map Control Relay Bit Map This table provides a listing of the individual control relays associated with each V-memory address bit.
F–11 DL205 Data Types and Memory Map This table provides a listing of the individual stage control bits associated with each V-memory address bit.
F–12 Appendix F DL205 Memory Map DL205 Data Types and Memory Map Timer Status Bit Map This table provides a listing of the individual timer contacts associated with each V-memory address bit.