Chapter 4 Ch4
User Manual: Chapter 4 DL06 User Manual
Open the PDF directly: View PDF
.
Page Count: 28
| Download | |
| Open PDF In Browser | View PDF |
System design configuration and Chapter 4 In This Chapter DL06 System Design Strategies......................................................... 4–2 Module Placement............................................................................ 4–3 Power Budgeting.............................................................................. 4–5 Configuring the DL06’s Comm Ports................................................ 4–7 Connecting to MODBUS and DirectNET Networks............................ 4–9 Non–Sequence Protocol (ASCII In/Out and PRINT)......................... 4–11 Network Slave Operation................................................................ 4–12 Network Master Operation............................................................. 4–18 Network Master Operation (using MRX and MWX Instructions)..... 4–22 Chapter 4: System Design and Configuration DL06 System Design Strategies 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D I/O System Configurations The DL06 PLCs offer a number of different I/O configurations. Choose the configuration that is right for your application, and keep in mind that the DL06 PLCs offer the ability to add I/O with the use of option cards. Although remote I/O isn’t available, there are many option cards available. For instance: • Various A/C and D/C I/O modules • Combination I/O modules • Analog I/O modules • Combination Analog I/O modules A DL06 system can be developed using several different arrangements using the option modules. See our DL05/06 Options Modules User Manual (D0-OPTIONS-M) on the website, www.automationdirect.com for detailed selection information. Networking Configurations The DL06 PLCs offers the following ways to add networking: • Ethernet Communications Module s connects a DL06 to high-speed peer-to-peer networks. Any PLC can initiate communications with any other PLC or operator interfaces, such as C-more, when using the ECOM modules. • Data Communications Modules s connects a DL06 to devices using either DeviceNet or Profibus to link to master controllers, as well as a D0-DCM. • Communications Port 1 s The DL06 has a 6-pin RJ12 connector on Port 1 that supports (as slave) K-sequence, MODBUS RTU or DirectNET protocols. • Communications Port 2 s The DL06 has a 15-pin connector on Port 2 that supports either master/slave MODBUS RTU or DirectNET protocols, or K-sequence protocol as slave. (MRX and MWX instructions allow you to enter native MODBUS addressing in your ladder program with no need to perform octal to decimal conversions). Port 2 can also be used for ASCII IN/OUT communictions. 4–2 DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration Module Placement 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Slot Numbering The DL06 has four slots, which are numbered as follows: Slot 1 Slot 2 Slot 3 Slot 4 DL06 Micro PLC User Manual; 3rd Edition Rev. D 4–3 Chapter 4: System Design and Configuration Automatic I/O Configuration The DL06 CPUs automatically detect any installed I/O modules (including specialty modules) at powerup, and establish the correct I/O configuration and addresses. This applies to modules located in the local base. For most applications, you will never have to change the configuration. I/O addresses use octal numbering, starting at X100 and Y100 in the slot next to the CPU. The addresses are assigned in groups of 8, or 16 depending on the number of points for the I/O module. The discrete input and output modules can be mixed in any order. The following diagram shows the I/O numbering convention for an example system. Both the Handheld Programmer and DirectSOFT 5 provide AUX functions that allow you to automatically configure the I/O. For example, with the Handheld Programmer AUX 46 executes an automatic configuration, which allows the CPU to examine the installed modules and determine the I/O configuration and addressing.With DirectSOFT 5, the PLC Configure I/O menu option would be used. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Automatic Manual Slot 1 Slot 2 Slot 3 8pt. Input 16pt. Output 16pt. Input X100–X107 Y100–Y117 X110–X127 Slot 4 8pt. Input X130–X137 Slot 1 Slot 2 Slot 3 8pt. Input 16pt. Output 16pt. Input X100–X107 Y100–Y117 X200–X217 Slot 4 8pt. Input X120–X127 Manual I/O Configuration It may never become necessary, but DL06 CPUs allow manual I/O address assignments for any I/O slot(s) . You can manually modify an auto configuration to match arbitrary I/O numbering. For example, two adjacent input modules can have starting addresses at X100 and X200.Use DirectSOFT 5 PLC Configure I/O menu option to assign manual I/O address. In automatic configuration, the addresses are assigned on 8-point boundaries. Manual configuration, however, assumes that all modules are at least 16 points, so you can only assign addresses that are a multiple of 20 (octal). You can still use 8 point modules, but 16 addresses will be assigned and the upper eight addresses will be unused. WARNING: If you manually configure an I/O slot, the I/O addressing for the other modules may change. This is because the DL06 CPUs do not allow you to assign duplicate I/O addresses. You must always correct any I/O configuration errors before you place the CPU in RUN mode. Uncorrected errors can cause unpredictable machine operation that can result in a risk of personal injury or damage to equipment. 4–4 DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration Power Budgeting The DL06 has four option card slots. To determine whether the combination of cards you select will have sufficient power, you will need to perform a power budget calculation. Power supplied Power is supplied from two sources, the internal base unit power supply and, if required, an external supply (customer furnished). The D0-06xx (AC powered) PLCs supply a limited amount of 24VDC power. The 24VDC output can be used to power external devices. For power budgeting, start by considering the power supplied by the base unit. All DL06 PLCs supply the same amount of 5VDC power. Only the AC units offer 24VDC auxiliary power. Be aware of the trade-off between 5VDC power and 24VDC power. The amount of 5VDC power available depends on the amount of 24VDC power being used, and the amount of 24VDC power available depends on the amount of 5VDC power consumed. Determine the amount of internally supplied power from the table on the following page. Power required by base unit Because of the different I/O configurations available in the DL06 family, the power consumed by the base unit itself varies from model to model. Subtract the amount of power required by the base unit from the amount of power supplied by the base unit. Be sure to subtract 5VDC and 24VDC amounts. Power required by option cards Next, subtract the amount of power required by the option cards you are planning to use. Again, remember to subtract both 5VDC and 24VDC. If your power budget analysis shows surplus power available, you should have a workable configuration. DL06 Micro PLC User Manual; 3rd Edition Rev. D 4–5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Chapter 4: System Design and Configuration DL06 Power Consumed by Option Cards DL06 Power Supplied by Base Units 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Part Number 5 VDC (mA) 24 VDC (mA) <1500mA <2000mA 1500mA 300mA 200mA none D0-06xx D0-06xx-D If the 5VDC loading is less than 2000mA, but more than 1500mA, then available 24VDC supply current is 200mA. If the 5VDC loading is less than 1500mA, then the available 24VDC current is 300mA. DL06 Base Unit Power Required Part Number D0-06AA D0-06AR D0-06DA D0-06DD1 D0-06DD2 D0-06DR D0-06DD1-D D0-06DD2-D D0-06DR-D 5 VDC (mA) 24 VDC (mA) 800mA 900mA 800mA 600mA 600mA 950mA 600mA 600mA 950mA none none none 280mA, note 1 none none 280mA, note 1 none none Power Budgeting Example Power Source D0-06DD1 (select row A or row B) A 1500mA 300mA B 2000mA 200mA Current Required D0-06DD1 D0-16ND3 D0-10TD1 D0-08TR F0-4AD2DA-2 D0-06LCD Total Used Remaining 5VDC 24VDC power (mA) power (mA) A B 5VDC 24VDC power (mA) power (mA) 600mA 35mA 150mA 280mA 100mA 50mA 1215mA 285mA 785mA 280mA, note 1 0 0 0 0 0 280mA 20mA note 2 NOTE: See the DL05/DL06 OPTIONS manual for the module data for your project. Part Number D0-07CDR D0-08CDD1 D0-08TR D0-10ND3 D0-10ND3F D0-10TD1 D0-10TD2 D0-16ND3 D0-16TD1 D0-16TD2 D0-DCM D0-DEVNETS F0-04TRS F0-08NA-1 F0-04AD-1 F0-04AD-2 F0-04DAH-1 F0-04DAH-2 F0-08ADH-1 F0-08ADH-2 F0-08DAH-1 F0-08DAH-2 F0-2AD2DA-2 F0-4AD2DA-1 F0-4AD2DA-2 F0-04RTD F0-04THM F0-CP128 H0-CTRIO(2) H0-ECOM H0-ECOM100 H0-PSCM 5 VDC (mA) 130mA 100mA 280mA 35mA 35mA 150mA 150mA 35mA 200mA 200mA 250mA 45mA 250mA 5mA 50mA 75mA 25mA 25mA 25mA 25mA 25mA 25mA 50mA 100mA 100mA 70mA 30mA 150mA 250mA 250mA 300mA 530mA 24 VDC (mA) none none none none none none none none none none none none none none none none 150mA 30mA 25mA 25mA 220mA 30mA 30mA 40mA none none none none none none none none DL06 Power Consumed by Other Devices Part Number D0-06LCD D2-HPP DV-1000 EA1-S3ML EA1-S3MLW 5 VDC (mA) 24 VDC (mA) 50mA 200mA 150mA 210mA 210mA none none none none none NOTE 1: Auxiliary 24VDC used to power V+ terminal of D0-06DD1/-D sinking outputs. NOTE 2: If the PLC’s auxiliary 24VDC power source is used to power the sinking outputs, use power choice A, above. 4–6 DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration Configuring the DL06’s Comm Ports This section describes how to configure the CPU’s built-in networking ports for either MODBUS or DirectNET. This will allow you to connect the DL06 PLC system directly to MODBUS networks using the RTU protocol, or to other devices on a DirectNET network. MODBUS masters on the network must be capable of issuing the MODBUS commands to read or write the appropriate data. For details on the MODBUS protocol, please refer to the Gould MODBUS Protocol reference Guide (P1–MBUS–300 Rev. B). In the event a more recent version is available, check with your MODBUS supplier before ordering the documentation. For more details on DirectNET, order our DirectNET manual, part number DA–DNET–M. NOTE: For information about the MODBUS protocol see the Group Schneider Web site at: www. schneiderautomation.com. At the main menu, select Support/Services, Modbus, Modbus Technical Manuals, PI-MBUS-300 Modbus Protocol Reference Guide or search for PIMBUS300. For more information about the DirectNET protocol, order our DirectNET user manual, part number DA–DNET–M, or download it free from our Web site: www.automationdirect.com. Select Documentation/Misc./DA-DNET-M. DL06 Port Specifications Communications Port 2 Communications Port 1 Connects to HPP, DirectSOFT 5, operator interfaces, etc. 6-pin, RS232C Communication speed (baud): 9600 (fixed) Parity: odd (fixed) Port 1 Station Address: 1 (fixed) 8 data bits 1 start, 1 stop bit Asynchronous, half-duplex, DTE Protocol (auto-select): K-sequence (slave only), DirectNET (slave only), MODBUS (slave only) Connects to HPP, DirectSOFT 5, operator interfaces, etc. 15-pin, multifunction port, RS232C, RS422, RS485 Communication speed (baud): 300, 600, 1200, 2400, 4800, 9600, 19200, 38400 Parity: odd (default), even, none Port 2 Station Address: 1 (default) 8 data bits 1 start, 1 stop bit Asynchronous, half-duplex, DTE Protocol (auto-select): K-sequence (slave only), DirectNET (master/slave), MODBUS (master/slave), non-sequence/print/ASCII in/out Port 2 Pin Descriptions DL06 Port Pinouts TERM PORT1 6 5 4 3 2 PORT2 1 5 1 10 6 15 PORT1 Port 1 Pin Descriptions RUN R STOP 11 PORT2 1 2 3 4 5 6 0V 5V RXD TXD 5V 0V Power (-) connection (GND) Power (+) connection Receive data (RS-232C) Transmit data (RS-232C) Power (+) connection Power (-) connection (GND) 1 5V 2 TXD 3 RXD 4 RTS 5 CTS 6 RXD7 0V 8 0V 9 TXD+ 10 TXD11 RTS+ 12 RTS13 RXD+ 14 CTS+ 15 CTS- Power (+) connection Transmit data (RS-232C) Receive data (RS-232C) Ready to send (RS-232C) Clear to send (RS232C) Receive data (-) (RS-422/485) Power (-) connection (GND) Power (-) connection (GND) Transmit data (+) (RS-422/485) Transmit data (-) (RS-422/485) Ready to send (+) (RS-422/485) Ready to send (-) (RS-422/485) Receive data (+) (RS-422/485) Clear to send (+) (RS-422/485) Clear to send (-) (RS-422/485) DL06 Micro PLC User Manual; 3rd Edition Rev. D 4–7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Chapter 4: System Design and Configuration Choosing a Network Specification RXD RXD RXD 4 TXD TXD TXD TXD RXD CTS RTS RTS PORT1 6P6C Phone Jack Connections on Port 1 CTS Connections on Port 2 OR Loop Back 15 0V 3 11 Signal GND GND Signal GND 1 1 Point-to-point DTE Device 10 Normally, the RS-232 signals are used for shorter distances (15 meters maximum), for communications between two devices. 5 RS-232 Network 6 NOTE: Termination resistors are required at both ends of RS–422 and RS-485 networks. It is necessary to select resistors that match the impedance rating of the cable (between 100 and 500 ohms). RTS CTS RS-422 Network RS-422 signals are for long distances ( 1000 meters maximum). Use terminator resistors at both ends of RS-422 network wiring, matching the impedence rating of the cable (between 100 and 500 ohms). RXD+ RXD– TXD+ TXD– Signal GND Termination Resistor TXD+ / RXD+ TXD– / RXD– Signal GND 6 6 1 0V RTS+ RTS– RXD+ The recommended cable for RS422 is AutomationDirect L19954 (Belden 9842) or equivalent. TXD– DL06 Micro PLC User Manual; 3rd Edition Rev. D RTS– CTS+ 15 CTS– 10 CTS– 15 10 CTS+ 5 RXD+ RTS+ TXD+ DL06 CPU Port 2 4–8 RXD– 11 1 0V TXD+ TXD– / RXD– Signal GND Signal GND Connect shield to signal ground RXD– PORT 2 Master TXD+ / RXD+ TXD+ / RXD+ TXD– / RXD– Termination Resistor at both ends of network 11 RS-485 Network RS-485 signals are for longer distances (1000 meters max) and for multi-drop networks. Use termination resistors at both ends of RS-485 network wiring, matching the impedance rating of the cable (between 100 and 500 ohms). 9 TXD+ 10 TXD– 13 RXD+ 6 RXD– 11 RTS+ 12 RTS– 14 CTS+ 15 CTS– 7 0V The recommended cable for RS422 is AutomationDirect L19772 (Belden 8102) or equivalent. 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D The DL06 PLC’s multi-function port gives you the option of using RS-232C, RS-422, or RS-485 specifications. First, determine whether the network will be a 2-wire RS–232C type, a 4-wire RS–422 type, or a 2-wire/4-wire RS-485 type. The RS–232C specification is simple to implement for networks of shorter distances (15 meters max) and where communication is only required between two devices. The RS–422 and RS-485 signals are for networks that cover longer distances (1000 meters max.) and for multi-drop networks (from 2 to 247 devices). TXD– DL06 CPU Port 2 Chapter 4: System Design and Configuration Connecting to MODBUS and DirectNET Networks MODBUS Port Configuration In DirectSOFT 5, choose the PLC menu, then Setup, then “Secondary Comm Port”. • Port: From the port number list box at the top, choose “Port 2”. • Protocol: Check the box to the left of “MODBUS” (use AUX 56 on the HPP, and select “MBUS”), and then you’ll see the box below. •T imeout: amount of time the port will wait after it sends a message to get a response before logging an error. • RTS ON / OFF Delay Time: The RTS ON Delay Time specifies the time the DL06 waits to send the data after it has raised the RTS signal line. The RTS OFF Delay Time specifies the time the DL06 waits to release the RTS signal line after the data has been sent. When using the DL06 on a multi-drop network, the RTS ON Delay time must be set to 5ms or more and the RTS OFF Delay time must be set to 2ms or more. If you encounter problems, the time can be increased. • Station Number: For making the CPU port a MODBUS master, choose “1”. The possible range for MODBUS slave numbers is from 1 to 247, but the DL06 network instructions used in Master mode will access only slaves 1 to 99. Each slave must have a unique number. At powerup, the port is automatically a slave, unless and until the DL06 executes ladder logic network instructions which use the port as a master. Thereafter, the port reverts back to slave mode until ladder logic uses the port again. •B aud Rate: The available baud rates include 300, 600, 1200, 2400, 4800, 9600, 19200, and 38400 baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors or noise problems on the network. Important: You must configure the baud rates of all devices on the network to the same value. Refer to the appropriate product manual for details. • Stop Bits: Choose 1 or 2 stop bits for use in the protocol. • Parity: Choose none, even, or odd parity for error checking. •Echo Suppression: Select the appropriate wiring configuration used on Port 2. Then click the button indicated to send the Port configuration to the CPU, and click Close. DL06 Micro PLC User Manual; 3rd Edition Rev. D 4–9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Chapter 4: System Design and Configuration DirectNET Port Configuration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–10 In DirectSOFT 5, choose the PLC menu, then Setup, then “Secondary Comm Port”. • Port: From the port number list box, choose “Port 2 ”. • Protocol: Check the box to the left of “DirectNET” (use AUX 56 on the HPP, then select “DNET”), and then you’ll see the dialog below. •T imeout: Amount of time the port will wait after it sends a message to get a response before logging an error. •R TS ON / OFF Delay Time: The RTS ON Delay Time specifies the time the DL06 waits to send the data after it has raised the RTS signal line. The RTS OFF Delay Time specifies the time the DL06 waits to release the RTS signal line after the data has been sent. When using the DL06 on a multi-drop network, the RTS ON Delay time must be set to 5ms or more and the RTS OFF Delay time must be set to 2ms or more. If you encounter problems, the time can be increased. •S tation Number: For making the CPU port a DirectNET master, choose “1”. The allowable range for DirectNET slaves is from 1 to 90 (each slave must have a unique number). At powerup, the port is automatically a slave, unless and until the DL06 executes ladder logic instructions which attempt to use the port as a master. Thereafter, the port reverts back to slave mode until ladder logic uses the port again. •B aud Rate: The available baud rates include 300, 600, 1200, 2400, 4800, 9600, 19200, and 38400 baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors or noise problems on the network. Important: You must configure the baud rates of all devices on the network to the same value. • Stop Bits: Choose 1 or 2 stop bits for use in the protocol. • Parity: Choose none, even, or odd parity for error checking. • Format: Choose between hex or ASCII formats. Then click the button indicated to send the Port configuration to the CPU, and click Close. DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration Non–Sequence Protocol (ASCII In/Out and PRINT) Non-Sequence Port Configuration Configuring port 2 on the DL06 for Non–Sequence allows the CPU to use port 2 to either read or write raw ASCII strings using the ASCII instructions. See the ASCII In/Out instructions and the PRINT instruction in chapter 5. In DirectSOFT 5, choose the PLC menu, then Setup, then “Secondary Comm Port”. • Port: From the port number list box at the top, choose “Port 2”. • Protocol: Check the box to the left of “Non–Sequence”. • Timeout: Amount of time the port will wait after it sends message to get a response before logging an error. a •R TS On Delay Time: The amount of time between raising the RTS line and sending the data. •R TS Off Delay Time: The amount of time between resetting the RTS line after sending the data. •D ata Bits: Select either 7–bits or 8–bits to match the number of data bits specified for the connected devices. •B aud Rate: The available baud rates include 300, 600, 900, 2400, 4800, 9600, 19200, and 38400 baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors or noise problems on the network. Important: You must configure the baud rates of all devices on the network to the same value. Refer to the appropriate product manual for details. •S top Bits: Choose 1 or 2 stop bits to match the number of stop bits specified for the connected devices. •P arity: Choose none, even, or odd parity for error checking. Be sure to match the parity specified for the connected devices. •E cho Suppression: Select the appropriate radio button based on the wiring configuration used on port 2. •X on/Xoff Flow Control: Choose this selection if you have Port 2 wired for Hardware Flow Control (Xon/Xoff) with RTS and CTS signal connected between all devices. • RTS Flow Control: Choose this selection if you have Port 2 RTS signal wired between all devices. Click the button indicated to send the port configuration to the CPU, and click Close. •M emory Address: Please choose a memory address with 64 words of contiguous free memory for use by Non-Sequence Protocol. DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–11 Chapter 4: System Design and Configuration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Network Slave Operation This section describes how other devices on a network can communicate with a CPU port that you have configured as a DirectNET slave or MODBUS slave (DL06). A MODBUS host must use the MODBUS RTU protocol to communicate with the DL06 as a slave. The host software must send a MODBUS function code and MODBUS address to specify a PLC memory location the DL06 comprehends. The DirectNET host uses normal I/O addresses to access applicable DL06 CPU and system. No CPU ladder logic is required to support either MODBUS slave or DirectNET slave operation. NOTE: For more intformation on DirectNET proprietary protocol, see the DirectNET reference manual, DA-DNET-M, available on our website. MODBUS Function Codes Supported MODBUS Function Code Function DL06 Data Types Available 01 02 05 15 03, 04 06 16 Read a group of coils Read a group of inputs Set / Reset a single coil Set / Reset a group of coils Y, Read a value from one or more registers Write a value into a single register Write a value into a group of registers Y, CR, T, CT X, SP Y, CR, T, CT CR, T, CT V V V The MODBUS function code determines whether the access is a read or a write, and whether to access a single data point or a group of them. The DL06 supports the MODBUS function codes described below. Determining the MODBUS Address 4–12 There are typically two ways that most host software conventions allow you to specify a PLC memory location. These are: • By specifying the MODBUS data type and address • By specifying a MODBUS address only DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration If Your Host Software Requires the Data Type and Address Many host software packages allow you to specify the MODBUS data type and the MODBUS address that corresponds to the PLC memory location. This is the easiest method, but not all packages allow you to do it this way. The actual equation used to calculate the address depends on the type of PLC data you are using. The PLC memory types are split into two categories for this purpose. • Discrete – X, SP, Y, CR, S, T, C (contacts) • Word – V, Timer current value, Counter current value In either case, you basically convert the PLC octal address to decimal and add the appropriate MODBUS address (if required). The table below shows the exact equation used for each group of data. DL06 Memory Type QTY (Decimal) PLC Range (Octal) MODBUS Address Range MODBUS Data Type (Decimal) For Discrete Data Types .... Convert PLC Addr. to Dec. + Start of Range + Data Type 512 X0 – X777 2048 – 2559 Input Inputs (X) 512 SP0 – SP777 3072 – 3583 Input Special Relays(SP) 512 Y0 – Y777 2048 – 2559 Coil Outputs (Y) 1024 C0 – C1777 3072 – 4095 Coil Control Relays (CR) 256 T0 – T377 6144 – 6399 Coil Timer Contacts (T) 128 CT0 – CT177 6400 – 6527 Coil Counter Contacts (CT) 1024 S0 – S1777 5120 – 6143 Coil Stage Status Bits(S) For Word Data Types .... Convert PLC Addr. to Dec. + Data Type 256 V0 – V377 0 – 255 Input Register Timer Current Values (V) 128 V1000 – V1177 512 – 639 Input Register Counter Current Values (V) V-Memory, user data (V) V-Memory, non-volatile (V) 3200 4096 128 V1200 – V7377 V10000 - V17777 V7400 – V7577 640 – 3839 4096 - 8191 3840 – 3967 Holding Register Holding Register Holding Register DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–13 Chapter 4: System Design and Configuration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D The following examples show how to generate the MODBUS address and data type for hosts which require this format. Example 1: V2100 Find the MODBUS address for User V location V2100. Holding Reg 1088 1. Find V-memory in the table. 2. Convert V2100 into decimal (1088). 3. Use the MODBUS data type from the table. V-memory, user data (V) 3200 V1200 – V7377 640 – 3839 Holding Register Example 2: Y20 Find the MODBUS address for output Y20. Coil 2064 1. Find Y outputs in the table. 2. Convert Y20 into decimal (16). 3. Add the starting address for the range (2048). 4. Use the MODBUS data type from the table. Outputs (V) 256 Y0 – Y377 2048 - 2303 Coil Example 3: T10 Current Value Find the MODBUS address to obtain the current value from Timer T10. Input Reg. 8 1. Find Timer Current Values in the table. 2. Convert T10 into decimal (8). 3. Use the MODBUS data type from the table. Timer Current Values (V) 128 V0 – V177 0 - 127 Input Register Example 4: C54 4–14 Find the MODBUS address for Control Relay C54. 1. Find Control Relays in the table. Coil 3116 2. Convert C54 into decimal (44). 3. Add the starting address for the range (3072). 4. Use the MODBUS data type from the table. Control Relays (CR) 512 C0 – C77 3072 – 3583 DL06 Micro PLC User Manual; 3rd Edition Rev. D Coil Chapter 4: System Design and Configuration If Your MODBUS Host Software Requires an Address ONLY Some host software does not allow you to specify the MODBUS data type and address. Instead, you specify an address only. This method requires another step to determine the address, but it’s still fairly simple. Basically, MODBUS also separates the data types by address ranges as well. So this means an address alone can actually describe the type of data and location. This is often referred to as “adding the offset”. One important thing to remember here is that two different addressing modes may be available in your host software package. These are: • 484 Mode • 584/984 Mode We recommend that you use the 584/984 addressing mode if your host software allows you to choose. This is because the 584/984 mode allows access to a higher number of memory locations within each data type. If your software only supports 484 mode, then there may be some PLC memory locations that will be unavailable. The actual equation used to calculate the address depends on the type of PLC data you are using. The PLC memory types are split into two categories for this purpose. • Discrete – X, SP, Y, CR, S, T (contacts), C (contacts) • Word – V, Timer current value, Counter current value In either case, you basically convert the PLC octal address to decimal and add the appropriate MODBUS addresses (as required). The table below shows the exact equation used for each group of data. Discrete Data Types DL06 Memory Type Global Inputs (GX) Inputs (X) Special Relays (SP) Global Outputs (GY) Outputs (Y) Control Relays (CR) Timer Contacts (T) Counter Contacts (CT) Stage Status Bits (S) PLC Range (Octal) GX0-GX1746 GX1747-GX3777 X0 – X1777 SP0 – SP777 GY0 - GY3777 Y0 – Y1777 C0 – C3777 T0 – T377 CT0 – CT377 S0 – S1777 Address (484 Address (584/984 MODBUS Data Mode) Mode) Type 1001 - 1999 ------1 - 2048 2049 - 3072 3073 - 5120 6145 - 6400 6401 - 6656 5121 - 6144 10001 - 10999 11000 - 12048 12049 - 13072 13073 - 13584 1 - 2048 2049 - 3072 3073 - 5120 6145 - 6400 6401 - 6656 5121 - 6144 Input Input Input Input Output Output Output Output Output Output DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–15 Chapter 4: System Design and Configuration Example 1: V2100 584/984 Mode 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–16 Word Data Types PLC Range Input/Holding Input/Holding (Octal) (484 Mode)* (584/984 Mode)* Registers V-memory (Timers) V-memory (Counters) V0 - V377 V1000 - V1177 V1200 - V1377 V1400 - V1746 V1747 - V1777 V2000 - V7377 V10000 - V17777 V-memory (Data Words) 3001/4001 3513/4513 3641/4641 3769/4769 ------- 30001/40001 30513/40513 30641/40641 30769/40769 31000/41000 41025 44097 *MODBUS: Function 04 1. Refer to your PLC user manual for the correct memory mapping size of your PLC. Some of the addresses shown above might not pertain to your particular CPU. 2. For an automated MODBUS/Koyo address conversion utility, go to our website, www.automationdirect.com, and down load download the EXCEL file modbus_conversion.xls located at: Tech Support > Technical Support Home page. Example 1: V2100 584/984 Mode Find the MODBUS address for User V location V2100. PLC Address (Dec.) + Mode Address 1. Find V-memory in the table. V2100 = 1088 decimal 2. Convert V2100 into decimal (1088). 41089 1088 + 40001 = 3. Add the MODBUS starting address for the mode (40001). Example 2: Y20 584/984 Mode For Word Data Types.... Timer Current Values (V) Counter Current Values (V) V-memory, user data (V) PLC Address (Dec.) 128 128 1024 V0 – V177 V1200 – V7377 V2000 – V3777 + Appropriate Mode Address 0 – 127 640 – 3839 1024 – 2047 Find the MODBUS address for output Y20. 3001 3001 4001 30001 30001 40001 Input Register Input Register Holding Register PLC Addr. (Dec.) + Start Address + Mode 1. Find Y outputs in the table. Y20 = 16 decimal 2. Convert Y20 into decimal (16). 16 + 2048 + 1 = 2065 3. Add the starting address for the range (2048). 4. Add the MODBUS address for the mode (1). Outputs (Y) Control Relays (CR) Timer Contacts (T) 320 256 128 Y0 - Y477 C0 - C377 T0 - T177 2048 – 2367 3072 – 3551 6144 – 6271 DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 1 1 1 1 1 Coil Coil Coil Chapter 4: System Design and Configuration Example 3: T10 Current Value 484 Mode PLC Address (Dec.) + Mode Address TA10 = 8 decimal Find the MODBUS address to obtain the current value from Timer T10. 1. Find Timer Current Values in the table. = 8 + 3001 3009 2. Convert T10 into decimal (8). 3. Add the MODBUS starting address for the mode (3001). For Word Data Types.... PLC Address (Dec.) Timer Current Values (V) Counter Current Values (V) V-memory, user data (V) 128 128 1024 + V0 – V177 V1200 – V7377 V2000 – V3777 Appropriate Mode Address 0 – 127 512 – 639 1024 – 2047 3001 3001 4001 30001 30001 40001 Input Register Input Register Holding Register Example 4: C54 584/984 Mode Find the MODBUS address for Control Relay C54. PLC Addr. (Dec.) + Start Address + Mode 1. Find Control Relays in the table. C54 = 44 decimal 2. Convert C54 into decimal (44). = 44 + 3072 + 1 3117 3. Add the starting address for the range (3072). 4. Add the MODBUS address for the mode (1). Outputs (Y) Control Relays (CR) Timer Contacts (T) 320 256 128 Y0 – Y477 C0 – C377 T0– T177 2048 – 2367 3072 – 3551 6144 – 6271 1 1 1 1 1 1 Coil Coil Coil Network Master Operation This section describes how the DL06 can communicate on a MODBUS or DirectNET network as a master. For MODBUS networks, it uses the MODBUS RTU protocol, which must be interpreted by all the slaves on the network. Both MODBUS and DirectNet are single master/multiple slave networks. The master is the only member of the network that can initiate requests on the network. This section teaches you how to design the required ladder logic for network master operation. G LG Y0 Y2 C1 Y5 Y7 Y10 Y12 C3 Y15 Y17 0V Y1 Y3 Y4 Y6 C2 Y11 Y13 Y14 Y16 N.C. AC(L) AC(N) 24V C0 OUTPUT: 6-240V 50 - 60Hz 2.0A, 6 - 27V 2.0A PWR: 100-240V 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 PWR RUN CPU TX1 RX1 TX2 RX2 50-60Hz 40VA Y 17 20 D0-06DR 21 22 23 X INPUT: 12 - 24V 3 - 15mA LOGIC 06 K oyo C0 X1 X0 X3 X2 X4 C1 X6 X5 X7 C2 X11 X13 X14 X16 C4 X21 X23 N.C. X15 X17 X20 X22 N.C. X10 X12 C3 TERM PORT1 Master PORT2 RUN STOP MODBUS RTU Protocol,, or DirectNET Slave #1 Slave #2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D Slave #3 DL06 Micro PLC User Manual; 3rd Edition Rev. D 4–17 Chapter 4: System Design and Configuration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D When using the DL06 PLC as the master station, simple RLL instructions are used to initiate the requests. The WX instruction initiates network write operations, and the RX instruction initiates network read operations. Before executing either the WX or RX commands, we will need to load data related to the read or write operation onto the CPU’s accumulator stack. When the WX or RX instruction executes, it uses the information on the stack combined with data in the instruction box to completely define the task, which goes to the port. 0V G LG Y0 Y2 C1 Y5 Y7 Y10 Y12 C3 Y15 Y17 AC(L) AC(N) 24V C0 Y1 Y3 Y4 Y6 C2 Y11 Y13 Y14 Y16 N.C. OUTPUT: 6-240V 50 - 60Hz 2.0A, 6 - 27V 2.0A PWR: 100-240V 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 PWR RUN CPU TX1 RX1 TX2 RX2 50-60Hz 40VA Y 17 20 D0-06DR 21 22 23 X INPUT: 12 - 24V 3 - 15mA LOGIC 06 K oyo C0 X1 X0 X3 X2 X4 C1 X6 X5 X7 C2 X11 X13 X14 X16 C4 X21 X23 N.C. X10 X12 C3 X15 X17 X20 X22 N.C. TERM PORT1 PORT2 RUN STOP Master Network WX (write) RX (read) Slave The following step-by-step procedure will provide you the information necessary to set up your ladder program to receive data from a network slave. Step 1: Identify Master Port # and Slave # The first Load (LD) instruction identifies the communications port number on the network master (DL06) and the address of the slave station. This instruction can address up to 99 MODBUS slaves, or 90 DirectNET slaves. The format of the word is shown to the right. The “F2” in the upper byte indicates the use of the right port of the DL06 PLC, port number 2. The lower byte contains the slave address number in BCD (01 to 99). F 2 0 1 Slave address (BCD) Port number (BCD) Internal port (hex) LD KF201 6 4 (BCD) Step 2: Load Number of Bytes to Transfer 4–18 The second Load (LD) instruction determines the number of bytes which will be transferred between the master and slave in the subsequent WX or RX instruction. The value to be loaded is in BCD format (decimal), from 1 to 128 bytes. DL06 Micro PLC User Manual; 3rd Edition Rev. D # of bytes to transfer LD K64 Chapter 4: System Design and Configuration The number of bytes specified also depends on the type of data you want to obtain. For example, the DL06 Input points can be accessed by V-memory locations or as X input locations. However, if you only want X0 – X27, you’ll have to use the X input data type because the V-memory locations can only be accessed in 2-byte increments. The following table shows the byte ranges for the various types of DirectLOGIC products. DL05 / 06 / 205 / 350 / 405 Memory Bits per unit Bytes V-memory T / C current value Inputs (X, SP) Outputs (Y, C, Stage, T/C bits) Scratch Pad Memory Diagnostic Status 16 16 8 2 2 1 8 1 8 8 1 1 DL330 / 340 Memory Bits per unit Bytes Data registers T / C accumulator I/O, internal relays, shift register bits, T/C bits, stage bits Scratch Pad Memory Diagnostic Status(5 word R/W) 8 16 1 2 1 1 8 16 1 10 Step 3: Specify Master Memory Area The third instruction in the RX or WX sequence is a Load Address (LDA) instruction. Its purpose is to load the starting address of the memory area to be transferred. Entered as an octal number, the LDA instruction converts it to hex and places the result in the accumulator. For a WX instruction, the DL06 CPU sends the number of bytes previously specified from its memory area beginning at the LDA address specified. For an RX instruction, the DL06 CPU reads the number of bytes previously specified from the slave, placing the received data into its memory area beginning at the LDA address specified. 4 0 6 0 0 (octal) Starting address of master transfer area LDA O40600 MSB V40600 LSB 0 15 MSB V40601 15 LSB 0 NOTE: Since V-memory words are always 16 bits, you may not always use the whole word. For example, if you only specify 3 bytes and you are reading Y outputs from the slave, you will only get 24 bits of data. In this case, only the 8 least significant bits of the last word location will be modified. The remaining 8 bits are not affected. DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–19 Chapter 4: System Design and Configuration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D The DL05/06, DL250-1/260, DL350 and DL450 will support function 04, read input register (Address 30001). To use function 04, put the number ‘4’ into the most significant position (4xxx). Four digits must be entered for the intruction to work properly with this mode. LD K101 The Maximum constant possible is 4128. This is due to the 128 maximum number of Bytes that the RX/WX instruction can allow. The value of 4 in the most significant position of the word will cause the RX to use function 04 (30001 range). LD K4128 LDA O4000 RX V0 Step 4: Specify Slave Memory Area The last instruction in our sequence is the WX or RX instruction itself. Use WX to write to the slave, and RX to read from the slave. All four of our instructions are shown to the right. In the last instruction, you must specify the starting address and a valid data type for the slave. SP116 LD KF201 LD K64 •D irectNET slaves – specify the same address in the WX and RX instruction as the slave’s native I/O address LDA O40600 • MODBUS DL405, DL205, or DL06 slaves – specify the same address in the WX and RX instruction as the slave’s native I/O address RX Y0 • MODBUS 305 slaves – use the following table to convert DL305 addresses to MODBUS addresses DL305 Series CPU Memory Type–to–MODBUS Cross Reference (excluding 350 CPU) MODBUS PLC Memory Base Address Type PLC Memory Type PLC Base Address TMR/CNT Current Values R600 V0 I/O Points Data Registers Stage Status Bits (D3-330P only) IO 000 R401,R400 S0 GY0 V100 GY200 4–20 TMR/CNT Status Bits Control Relays Shift Registers DL06 Micro PLC User Manual; 3rd Edition Rev. D PLC Base Address MODBUS Base Address CT600 GY600 CR160 SR400 GY160 GY400 Chapter 4: System Design and Configuration Communications from a Ladder Program Typically network communications will last longer than 1 scan. The program must wait for the communications to finish before starting the next transaction. Port Communication Error Port 2, which can be a master, has two Special Relay contacts associated with it (see Appendix D for comm port special relays). One indicates “Port busy”(SP116), and the other indicates ”Port Communication Error”(SP117). The example above shows the use of these contacts for a network master that only reads a device (RX). The “Port Busy” bit is on while the PLC communicates with the slave. When the bit is off the program can initiate the next network request. The “Port Communication Error” bit turns on when the PLC has detected an error. Use of this bit is optional. When used, it should be ahead of any network instruction boxes since the error bit is reset when an RX or WX SP116 instruction is executed SP117 SP116 LD KF201 LD K0003 Port Busy LDA O40600 RX Y0 Interlocking Relay C100 LD KF201 LD K0003 Multiple Read and Write Interlocks If you are 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 each port can only handle one transaction at a time. In the example to the right, after the RX instruction is executed, C100 is set. When the port has finished the communication task, the second routine is executed and C100 is reset. If you’re using RLLPLUS Stage Programming, you can put each routine in a separate program stage to ensure proper execution and switch from stage to stage allowing only one of them to be active at a time. Y1 SET LDA O40600 Interlocking Relay SP116 C100 RX VY0 C100 SET LD KF201 LD K0003 LDA O40400 WX VY0 DL06 Micro PLC User Manual; 3rd Edition Rev. D C100 RST 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–21 Chapter 4: System Design and Configuration Network Master Operation (using MRX and MWX 1 Instructions) 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D This section describes how the DL06 can communicate on a MODBUS RTU network as a master using the MRX and MWX read/write instructions. These instructions allow you to enter native MODBUS addressing in your ladder logic program with no need to perform octal to decimal conversions. MODBUS is a single master/multiple slave network. The master is the only member of the network that can initiate requests on the network. This section teaches you how to design the required ladder logic for network master operation. G LG Y0 Y2 C1 Y5 Y7 Y10 Y12 C3 Y15 Y17 0V Y1 Y3 Y4 Y6 C2 Y11 Y13 Y14 Y16 N.C. AC(L) AC(N) 24V C0 OUTPUT: 6-240V 50 - 60Hz 2.0A, 6 - 27V 2.0A PWR: 100-240V 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 PWR RUN CPU TX1 RX1 TX2 RX2 50-60Hz 40VA Y 17 20 D0-06DR 21 22 23 X INPUT: 12 - 24V 3 - 15mA LOGIC 06 K oyo C0 X1 X0 X3 X2 X4 C1 X6 X5 X7 C2 X11 X13 X14 X16 C4 X21 X23 N.C. X15 X17 X20 X22 N.C. X10 X12 C3 TERM PORT1 PORT2 RUN STOP Master MODBUS RTU Protocol,, or DirectNET Slave #1 Slave #2 Slave #3 MODBUS Function Codes Supported The MODBUS function code determines whether the access is a read or a write, and whether to access a single data point or a group of them. The DL06 supports the MODBUS function codes described below. MODBUS Function Code 4–22 01 02 05 15 03, 04 06 07 08 16 Function Read a group of coils Read a group of inputs Set / Reset a single coil (slave only) Set / Reset a group of coils Read a value from one or more registers Write a value into a single register (slave only) Read Exception Status Diagnostics Write a value into a group of registers DL06 Micro PLC User Manual; 3rd Edition Rev. D DL06 Data Types Available Y, CR, T, CT X, SP Y, CR, T, CT Y, CR, T, CT V V V V V Chapter 4: System Design and Configuration MODBUS Read from Network(MRX) The MODBUS Read from Network (MRX) instruction is used by the DL06 network master to read a block of data from a connected slave device and to write the data into V–memory addresses within the master. The instruction allows the user the to specify the MODBUS Function Code, slave station address, starting master and slave memory addresses, number of elements to transfer, MODBUS data format and the Exception Response Buffer. • Port Number: must be DL06 Port 2 (K2) • Slave Address: specify a slave station address (0–247) • Function Code: The following MODBUS function codes are supported by the MRX instruction: 01 – Read a group of coils 02 – Read a group of inputs 03 – Read holding registers 04 – Read input registers 07 – Read Exception status 08 – Diagnostics • Start Slave Memory Address: specifies the starting slave memory address of the data to be read. See the table on the following page. • Start Master Memory Address: specifies the starting memory address in the master where the data will be placed. See the table on the following page. • Number of Elements: specifies how many coils, input, holding registers or input register will be read. See the table on the following page. • MODBUS Data Format: specifies MODBUS 584/984 or 484 data format to be used • Exception Response Buffer: specifies the master memory address where the Exception Response will be placed. See the table on the following page. DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–23 Chapter 4: System Design and Configuration MRX Slave Memory Address 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D MRX Slave Address Ranges Function Code MODBUS Data Format Slave Address Range(s) 01 – Read Coil 01 – Read Coil 02 – Read Input Status 484 Mode 584/984 Mode 484 Mode 02 – Read Input Status 584/984 Mode 1–999 1–65535 1001–1999 10001–19999 (5 digit) or 100001–165535 (6 digit) 4001–4999 40001–49999 (5 digit) or 4000001–465535 (6 digit) 3001–3999 30001–39999 (5 digit) or 3000001–365535 (6 digit) n/a 0–65535 03 – Read Holding Register 484 Mode 03 – Read Holding Register 584/984 04 – Read Input Register 484 Mode 04 – Read Input Register 584/984 Mode 07 – Read Exception Status 08 – Diagnostics 484 and 584/984 Mode 484 and 584/984 Mode MRX Master Memory Addresses MRX Master Memory Address Ranges Operand Data Type DL06 Range Inputs X Outputs Y Control Relays C Stage Bits S Timer Bits T Counter Bits CT Special Relays SP V–memory V Global Inputs GX Global Outputs GY 0–1777 0–1777 0–3777 0–1777 0–377 0–377 0–777 All 0–3777 0–3777 MRX Number of Elements MRX Number of Elements DL06 Range Operand Data Type V–memory Constant V K All 1–2000 MRX Exception Response Buffer MRX Exception Response Buffer Operand Data Type V–memory 4–24 DL06 Range V All DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration MODBUS Write to Network (MWX) The MODBUS Write to Network (MWX) instruction is used to write a block of data from the network masters’s (DL06) memory to MODBUS memory addresses within a slave device on the network. The instruction allows the user to specify the MODBUS Function Code, slave station address, starting master and slave memory addresses, number of elements to transfer, MODBUS data format and the Exception Response Buffer. • Port Number: must be DL06 Port 2 (K2) • Slave Address: specify a slave station address (0–247) • Function Code: The following MODBUS function codes are supported by the MWX instruction: 05 – Force Single coil 06 – Preset Single Register 08 – Diagnostics 15 – Force Multiple Coils 16 – Preset Multiple Registers • Start Slave Memory Address: specifies the starting slave memory address where the data will be written. • Start Master Memory Address: specifies the starting address of the data in the master that is to written to the slave. • Number of Elements: specifies how many consecutive coils or registers will be written to. This field is only active when either function code 15 or 16 is selected. • MODBUS Data Format: specifies MODBUS 584/984 or 484 data format to be used. • Exception Response Buffer: specifies the master memory address where the Exception Response will be placed. DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–25 Chapter 4: System Design and Configuration MWX Slave Memory Address 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D MWX Slave Address Ranges Function Code MODBUS Data Format 05 – Force Single Coil 05 – Force Single Coil 06 – Preset Single Register 484 Mode 584/984 Mode 484 Mode 06 – Preset Single Register 84/984 Mode 08 – Diagnostics 15 – Force Multiple Coils 15 – Force Multiple Coils 16 – Preset Multiple Registers 484 and 584/984 Mode 484 585/984 Mode 484 Mode 16 – Preset Multiple Registers 584/984 Mode Slave Address Range(s) 1–999 1–65535 4001–4999 40001–49999 (5 digit) or 400001– 465535 (6 digit) 0–65535 1–999 1–65535 4001–4999 40001–49999 (5 digit) or 4000001– 465535 (6 digit) MWX Master Memory Addresses MWX Master Memory Address Ranges Operand Data Type DL06 Range Inputs Outputs Control Relays Stage Bits Timer Bits Counter Bits Special Relays V–memory Global Inputs Global Outputs X Y C S T CT SP V GX GY 0–777 0–777 0–1777 0–1777 0–377 0–177 0–777 All 0–3777 0–3777 MWX Number of Elements MWX Number of Elements Operand Data Type DL06 Range V–memory Constant V K All 1–2000 MWX Exception Response Buffer MWX Exception Response Buffer Operand Data Type V–memory 4–26 V DL06 Range All DL06 Micro PLC User Manual; 3rd Edition Rev. D Chapter 4: System Design and Configuration MRX/MWX Example in DirectSOFT 5 DL06 port 2 has two Special Relay contacts associated with it (see Appendix D for comm port special relays). One indicates “Port busy”(SP116), and the other indicates ”Port Communication Error”(SP117). The “Port Busy” bit is on while the PLC communicates with the slave. When the bit is off the program can initiate the next network request. The “Port Communication Error” bit turns on when the PLC has detected an error and use of this bit is optional. When used, it should be ahead of any network instruction boxes since the error bit is reset when an MRX or MWX instruction is executed. Typically network communications will last longer than 1 CPU scan. The program must wait for the communications to finish before starting the next transaction. The “Port Communication Error” bit turns on when the PLC has detected an error. Use of this bit is optional. When used, it should be ahead of any network instruction boxes since the error bit is reset when an RX or WX instruction is executed. Multiple Read and Write Interlocks If you are 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 each port can only handle one transaction at a time. In the example below, after the MRX instruction is executed, C100 is set. When the port has finished the communication task, the second routine is executed and C100 is reset. If you’re using RLLplus Stage Programming, you can put each routine in a separate program stage to ensure proper execution and switch from stage to stage allowing only one of them to be active at a time. See example on the next page. DL06 Micro PLC User Manual; 3rd Edition Rev. D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–27 Chapter 4: System Design and Configuration Pulse/Minute _1Minute 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–28 C20 ( PD ) SP3 Calculation of communication transfer quantity per minute between PLC and device. Pulse/Minute 2 LD C20 CTA1 OUT Transactions/Min V3600 LD CTA2 OUT Errors/Minute V3601 SP116 pulses on every transaction - CT1 counts the transactions per minute. The counter is reset every minute. Port 2 busy bit 3 CNT SP116 Number of transactions per minute Pulse/Minute C20 CT1 K9999 SP117 pulses on every transaction - CT2 counts the errors per minute. The counter is reset every minute. CNT Port 2 error bit 4 SP117 Number of errors per minute Pulse/Minute C20 CT2 K9999 This rung does a MODBUS write to the first holding register 40001 of slave address number one. It writes the values over that reside in V2000. This particular function code only writes to one register. Use function code 16 to write to multiple registers. Only one Network Instruction (WX, RX, MWX, MRX) can be enabled in one scan. That is the reason for the interlock bits. For using many network instructions on the same port, use the Shift Register instruction. Port 2 busy bit 3 SP116 C100 MWX Port Number: K2 Slave Address: K1 Function Code: 06 - Preset Single Register Start Slave Memory Address: 40001 Number of Elements: n/a Modbus Data Type: 584/984 Mode Exception Response Buffer: V400 Instruction interlock bit C100 ( SET ) This rung does a MODBUS read from the first 32 coils of slave address number one. It will place the values into 32 bits of the master starting at C0. Port 2 busy bit 4 SP116 C100 MRX Port Number: K2 Slave Address: K1 Function Code: 01 - Read Coil Status Start Slave Memory Address: 1 Start Master Memory Address: C0 Number of Elements: 32 Modbus Data Type: 584/984 Mode Exception Response Buffer: V400 Instruction interlock bit C100 ( RST ) DL06 Micro PLC User Manual; 3rd Edition Rev. D
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.4 Linearized : Yes Tagged PDF : Yes XMP Toolkit : Adobe XMP Core 5.6-c015 84.158975, 2016/02/13-02:40:29 Create Date : 2016:07:15 16:07:17-04:00 Metadata Date : 2016:08:16 09:43:38-04:00 Modify Date : 2016:08:16 09:43:38-04:00 Creator Tool : Adobe InDesign CC 2014 (Windows) Instance ID : uuid:939f086b-7012-4203-841a-2562a57f231e Original Document ID : xmp.did:8c9c75cd-a880-a744-9ada-cb190a004526 Document ID : xmp.id:a16576d3-0079-ab48-b3ef-2d57b9413d1b Rendition Class : proof:pdf Derived From Instance ID : xmp.iid:1cfffeb8-8351-7047-b1a5-8d413000c732 Derived From Document ID : xmp.did:a7052cac-e5e7-944c-8aa3-8a6331f80c62 Derived From Original Document ID: xmp.did:8c9c75cd-a880-a744-9ada-cb190a004526 Derived From Rendition Class : default History Action : converted History Parameters : from application/x-indesign to application/pdf History Software Agent : Adobe InDesign CC 2014 (Windows) History Changed : / History When : 2016:07:15 16:07:17-04:00 Format : application/pdf Producer : Adobe PDF Library 11.0 Trapped : False Page Count : 28 Creator : Adobe InDesign CC 2014 (Windows)EXIF Metadata provided by EXIF.tools