Cutler-Hammer D320 PLC User Manual

Programmable logic controller
Table of Contents

Advertisement

Quick Links

D320 PLC
User's Manual

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the D320 PLC and is the answer not in the manual?

Questions and answers

Summary of Contents for Cutler-Hammer D320 PLC

  • Page 1 D320 PLC User’s Manual...
  • Page 2 The information contained in this manual is the property of Cutler-Hammer, Inc. Information in this manual is subject to change without notice and does not represent a commitment on the part of Cutler- Hammer, Inc. Any Cutler-Hammer software described in this manual is furnished under a license agreement. The software may be used or copied only in accordance with the terms of the agreement.
  • Page 3 Preface Preface Welcome to Cutler-Hammer’s D320 PLC User's Manual. This preface describes the contents of this manual and provides information on Support Services.
  • Page 4: About This Manual

    Chapter 4: Installation and Wiring Chapter 5: CPU Operation and Memory Chapter 6: Instructions Chapter 7: Testing and Troubleshooting Chapter 8: Troubleshooting Noise Problems Chapter 9: External Dimensions Appendix A: D320 PLC Communication Protocol Appendix B: PID Loop Control Appendix C: COM2 UDCP Specification...
  • Page 5: Support Services

    We are dedicated to providing fast, friendly, and accurate assistance. That is why we offer you so many ways to get the support you need. Whether it’s by phone, fax, modem, or mail, you can access Cutler-Hammer support information 24 hours a day, seven days a week. Our wide range of services include:...
  • Page 6 Stock availability, proof of shipment, or to place an order. Expedite an existing order. Product assistance and product price information. Product returns other than warranty returns. For information on your local distributor or sales office, call the Cutler-Hammer Tech Line at 1-800- 809-2772. Correspondence Address Cutler-Hammer...
  • Page 7: Table Of Contents

    What's Inside ..............................ii Support Services..............................iii Table of Contents Chapter 1: Introduction Overview of the Manual............................2 Features of the D320 PLC............................2 Self Diagnostics ............................. 3 PID Loop Control............................3 Real-time Clock ............................. 3 Large Program Memory..........................3 NOVRAM Battery Backup ..........................3 I/O and Special Function Module Support.....................
  • Page 8 D320 PLC User's Manual Expansion Cable Connection........................30 Power Supply Wiring ............................31 Power wiring..............................31 Grounding..............................31 120/240 VAC Power Supply Wiring Diagram .................... 32 I/O Module Wiring .............................. 33 Digital Input Module Wiring ........................33 Digital Output Module Wiring ........................37 Installation Precautions for I/O Modules .....................
  • Page 9 Table of Contents Example ............................... 79 Basic Instruction Details ............................80 STR, STN..............................80 AND, ANN, (ADN) ............................. 81 OR, ORN..............................82 OUT, SET, RST ............................83 NOT ................................84 STR DIF, STR DFN, AND DIF, AND DFN, OR DIF, OR DFN..............85 ANB, ORB ..............................
  • Page 10 D320 PLC User's Manual Transfer Instruction Details ..........................135 LDR, DLDR .............................. 135 STO, DSTO ............................... 137 MOV, FMOV ............................139 BMOV, BFMV............................141 Block Processing Instruction Details ......................... 142 FOR, DFOR, NEXT ..........................142 JMP, LBL ..............................144 JMPS, JMPE..............................
  • Page 11 Power Supply Module Dimensions........................196 CPU and Remote I/O Slave Module Dimensions ....................196 I/O Module and Intelligent Module Dimensions....................197 Integrated Remote I/O Drop Dimensions......................197 Appendix A: D320 PLC Communication Protocol Communication Rules............................200 Communication Environment ........................200 Communication Protocol ........................... 200 Step 1 ...
  • Page 12 D320 PLC User's Manual Description of Operation – MODBUS RTU mode.................... 235 MODBUS Memory Mapping ........................235 Description of Operation – UDCP Mode......................236 Example 1 – Printing an Error Message from an Input ................237 Example 2 – D320 Master on D50 Network....................238...
  • Page 13: Chapter 1: Introduction

    This manual will give you a complete understanding of how to install and program the D320 PLC. It also includes complete product specifications, and a description of the various products that work with the D320 PLC.
  • Page 14: Overview Of The Manual

    CPU processing procedure. • Chapter 6 presents detailed information on the Instruction Set that is used by the D320 PLC. • Chapter 7 discusses testing and troubleshooting procedures.
  • Page 15: Self Diagnostics

    I/O flexibility is achieved through the wide variety of available digital and analog modules, covering a broad range of voltage and current ratings. The D320 PLC has many additional features that combine to make it the ideal choice for many control applications.
  • Page 16: Peripheral Support

    D320 PLC User's Manual Peripheral Support The D320 PLC has two program loader software packages available for use on standard PCs: the DOS- based GPC5, and the Windows-based WinGPC. These packages provide advanced programming, monitoring, editing, and troubleshooting for the D320 PLC. A dedicated hand-held programmer is also available for harsh environments.
  • Page 17: Preventing Plc System Malfunctions

    Chapter 1: Introduction Preventing PLC System Malfunctions Use an isolation transformer and line filter on the incoming power to the PLC when in the vicinity of equipment using or producing high current, high voltage, or large magnetic fields. Separate the main PLC power line ground from all other power grounds. Always use triple- grounding.
  • Page 18 D320 PLC User's Manual...
  • Page 19: Chapter 2: System Configuration

    Chapter 2: System Configuration System Configuration This chapter provides information on the various products that are available for the D320 PLC. It includes a diagram that shows the D320 PLC system components, I/O configurations, and backplane configurations. This chapter contains: •...
  • Page 20: D320 Plc System Components

    D320 PLC User's Manual D320 PLC System Components SDU Module Remote I/O (Slave) Module W-LINK Module CPU Module Analog (A/D, D/A, RTD, T/C), HSC Module Remote I/O (Master) Module Power Module (AC/DC) 16/32p Digital I/O Module Expansion backplane Base backplane...
  • Page 21: D320 Plc Product List

    Chapter 2: System Configuration D320 PLC Product List Name Catalog # Product Description Remarks 24K Words, 0.2 µs/instruction, 8 loop PID, Realtime D320CPU320 Clock, 2 communications ports Backplanes Name Catalog # Product Description Remarks D320RAK03B 3-slot type Base D320RAK05B 5-slot type...
  • Page 22 D320 PLC User's Manual I/O Modules Name Catalog # Product Description Remarks D320DIM1605D 5 to 12 VDC, 8 points/common, 16 point sink or source D320DIM1624D 12 to 24 VDC, 8 points/common, Input sink or source Module D320DIM1615A 100 to 120 VAC, 8 points/common...
  • Page 23 Chapter 2: System Configuration Analog and Intelligent Modules Name Catalog # Product Description Remarks 8 Ch, 16 bit A/D converter, ±10 V, 0 to 5 V D320AIM810V Conversion speed: 1.25 ms/Ch Resolution: 1/20,000, 1 mV Analog Input (8 Ch) 8 Ch, 16 bit A/D converter, ±20 mA, 0 to 20 mA D320AIM820C Conversion speed: 1.25 ms/Ch Resolution: 1/10,000, 4 µA...
  • Page 24 D320 PLC User's Manual PLC Link Module Name Catalog # Product Description Remarks Wire Link D320LNKW Install on backplane. Can install maximum of three. Refer to Wire Link Module Module Manual for Function: PLC Link, data transmission, remote installation and programming operation.
  • Page 25 Chapter 2: System Configuration Programming Equipment Name Catalog # Product Description Remarks Write, edit, monitor program (mnemonic only) Does not include Handheld cable Memory BACK-UP function Program D320PGM500 Backlit LCD screen Loader Supports RS-232C/485 communication Name Catalog # Product Description Remarks GPC5 (DOS) D50CCS35...
  • Page 26: D320 Plc I/O Configuration

    D320 PLC User's Manual D320 PLC I/O Configuration Intelligent Module I/O Module A/D, D/A, RTD, TC Power 16 point High-speed Supply counter 32 point 24K words AC Type Link module 0.2 µs 110/220V 2 port DC Type Backplane 3 slot...
  • Page 27: D320 Plc Backplane Configurations

    Chapter 2: System Configuration D320 PLC Backplane Configurations • A general I/O module has two point types: 16 point and 32 point. The diagram below shows the two types of control. • The base backplane has three different slot types: 3 slot, 5 slot, and 8 slot.
  • Page 28 D320 PLC User's Manual...
  • Page 29: Chapter 3: Product Specification

    Chapter 3: Product Specification Product Specification This chapter outlines the environmental conditions for D320 PLC operation and the performance specifications and component functions of the CPU. This chapter discusses: • The environmental operating ranges for the D320 Series products •...
  • Page 30: Environmental Operating Ranges

    D320 PLC User's Manual Environmental Operating Ranges Item Specifications Operating temp. 0 to 55°C (32 to 131°F) Ambient temperature Storage temp. -20 to 70°C (-4.0 to 158°F) Ambient Operating 30% to 85% RH (Non-condensing) humidity Storage 30% to 85% RH (Non-condensing) Between AC external terminal and earth, AC 1500 V for 1 min.
  • Page 31: Cpu Performance Specifications

    Chapter 3: Product Specification CPU Performance Specifications CPU Name D320CPU320 Control method Program storage, Repeat calculation method External I/O Digital 1,024 points local, 1,024 points remote, 2,048 total Basic instruction 28 types Instruction Application instruction About 150 types 0.2 to 0.4 µS/step Process Basic instruction speed...
  • Page 32: Name And Function Of Cpu Components

    D320 PLC User's Manual Name and Function of CPU Components Initialize switch Status display LED Test switch Mode switch CPU cover • Battery • Terminal resistance switch • Communication speed control switch RS-232C/RC485 Communication connector D-sub 9 pin Female The initialize switch clears CPU errors. The switch is only active when the CPU is in the Stop/Program mode.
  • Page 33 Chapter 3: Product Specification The DIP switch located on the front of the CPU is used as a selecting switch for communication. The DIP switches function as follows: Switch Switch Function Diagram Number Position COM1, 9,600 bps COM1, 19,200 bps COM2, 9,600 bps COM2, 19,200 bps COM2, 38,400 bps...
  • Page 34 D320 PLC User's Manual...
  • Page 35: Chapter 4: Installation And Wiring

    Chapter 4: Installation and Wiring Installation and Wiring This chapter provides considerations and information on installing and wiring the D320 PLC. Diagrams are included to illustrate the installation procedures. This chapter contains: • System design considerations • System installation guidelines •...
  • Page 36: System Design Considerations

    D320 PLC User's Manual System Design Considerations Power Supply Wiring Physical and Electrical Isolation of Power Supplies When wiring the PLC, external control I/O, and large power equipment such as motors, each system should be electrically separated as shown: Power...
  • Page 37: Momentary Power Failure And Voltage Drop

    Momentary Power Failure and Voltage Drop Momentary Power Failure The D320 PLC will ride through momentary power failures of 10 msec or less. The PLC will stop and turn off its outputs if a momentary power failure greater than 20 msec occurs. For momentary power failures between 10 msec and 20 msec, the PLC's operation depends on circumstances at that time, and is not defined.
  • Page 38: Control Panel Installation

    D320 PLC User's Manual • Locations subject to direct impact greater than 5 G or vibrations greater than 1 G @ 57-2000 Hz. • Direct sunlight. • Presence of water, oil, and other chemicals. Electrical Noise Considerations • Do not install near high-tension wires, high-voltage devices, power cables, power devices, and other devices which generate large power surges or electromagnetic fields when starting and stopping.
  • Page 39 Chapter 4: Installation and Wiring Duct or other device At least 2 in. (50 mm) Base Backplane At least 2 in. (50 mm) At least 2 in. (50 mm) Expansion Backplane At least 2 in. (50 mm) Leave at least 2 inches (50 mm) from the duct or other devices: •...
  • Page 40: System Wiring And Installation Procedures

    D320 PLC User's Manual System Wiring and Installation Procedures Installation Dimensions Four M5 or #10 screws Type Slot Product Number Size (A) Size (B) in.* (mm) in.* (mm) D320RAK03B 10.25 (260) 9.65 (254) Base Backplane D320RAK05B 13.0 (330) 12.4 (315) D320RAK08B 17.15 (435)
  • Page 41: Module Installation

    Chapter 4: Installation and Wiring Module Installation Mounting Insert the flanges at the base of the module into the slots at the bottom of the I/O backplane. Swing the I/O module up onto the backplane, pressing firmly onto the backplane connector. Tighten the screw at top of module to establish a solid connection between the module and backplane.
  • Page 42: Unit Installation Height

    D320 PLC User's Manual Unit Installation Height The depth of the D320 PLC is 5 inches (120 mm) when the unit is installed on the backplane. When the communication cable is connected and the unit is installed in an enclosure, additional space is required.
  • Page 43: Power Supply Wiring

    Chapter 4: Installation and Wiring Fastening the Connector • Push the expansion cable connector onto the backplane connector firmly until it clicks into place. (See the following diagram.) • To remove the expansion cable from the backplane, release the locking device by pressing the spring on the expansion cable connector.
  • Page 44: 120/240 Vac Power Supply Wiring Diagram

    D320 PLC User's Manual • The line ground (LG) terminal has electric potential. When the frame ground (FG) is connected to a solid earth ground, you must also earth ground the LG terminal to prevent electric shock from the electric potential difference between the two grounds.
  • Page 45: I/O Module Wiring

    Chapter 4: Installation and Wiring I/O Module Wiring Digital Input Module Wiring Check Points • Refer to the instruction leaflet for the individual modules for specific limitations regarding the particular type of input sensor used. • The input device connection methods are shown in the following graphics for the various types of digital input devices.
  • Page 46 D320 PLC User's Manual Universal Type Sensor DC Load Sensor Output Input Termina Input Power 2-Wire Sensor Sensor Module Input Terminal Terminal Sensor Input Power Sourcing PNP Type Sensor Module Input Terminal Terminal Input Power...
  • Page 47 Chapter 4: Installation and Wiring AC Sensor The following diagrams show the input device in connection with an AC sensor. Contact Type AC Input Module Input Terminal Terminal SSR/Triac Type AC Input Module Input Terminal Terminal 2-Wire Sensor When using a 2-wire type photoelectric switch or a proximity sensor, the sensor may draw such a low level of current that the input may not be turned off due to the effect of leakage current.
  • Page 48 D320 PLC User's Manual The power rating W required for the bridge resistor R can be calculated as follows: W = (Power Voltage) When specifying the resistor, set it within 3 to 5 times of this value. LED Limit Switch When using a limit switch with internal LED On/Off indication, the input may not be turned off due to the effect of leakage current, or the LED may be incorrectly illuminated.
  • Page 49: Digital Output Module Wiring

    Chapter 4: Installation and Wiring Digital Output Module Wiring Check Points • Refer to the instruction leaflet for the individual modules for specific limitations regarding the particular output ratings for that module, particularly with regard to load current limitations. Additionally, installation of the modules in high temperature environments can further limit the acceptable load ratings of the outputs.
  • Page 50: Installation Precautions For I/O Modules

    D320 PLC User's Manual Capacitive Load When using a capacitive load, to reduce the effect of an inrush current, connect the protective circuit in series with the load as shown in the figure below. [Output Module] [Output Module] Inductance Resistance...
  • Page 51: Terminal Strip Wiring

    Terminal Strip Wiring Compressed Terminal, M3.5 • The removable terminal strips on the I/O modules for the D320 PLC use an M3.5 metric screw. Either open or circular type connectors may be used for attaching the control wiring to the terminal strip.
  • Page 52: Connector Module Wiring

    Connector Module Wiring Connection For the 32-point input and output modules (D320DIM3224D, D320DOM3224D) of the D320 PLC, use a 20-pin MIL connector. Use the correct Cutler-Hammer supplied cable for the type of I/O module used. Harness Connection Use flat ribbon cable connector. Harness cables are available for the following modules: •...
  • Page 53 Chapter 4: Installation and Wiring I/O Address Cross-reference Table (D320DIM3224D, D320DOM3224D, 0320DOM3200R) Connector (I) I/O Point D320DIM3224D D320DOM3224D D320DOM3200R R0.0 R0.0 R0.0 R0.1 R0.1 R0.1 R0.2 R0.2 R0.2 R0.3 R0.3 R0.3 R0.4 R0.4 R0.4 R0.5 R0.5 R0.5 R0.6 R0.6 R0.6 R0.7 R0.7 R0.7...
  • Page 54: Alarm Output Of Power Supply

    D320 PLC User's Manual Alarm Output of Power Supply Alarm Output (Power Supply) • The alarm output on the power supply turns On when the PLC is in Error mode. • The alarm output terminal has two relay contacts. These contacts are the NO (Normally Open) contact, and the NC (Normally Closed) contact.
  • Page 55: Plc Communications Wiring

    Chapter 4: Installation and Wiring PLC Communications Wiring Connecting the PLC to a PC The D320 PLC communication ports (COM1, COM2) support both RS-232C and RS-485 communications. The diagram below shows local communications connections for the D320 PLC. D320 CPU module...
  • Page 56 D320 PLC User's Manual Reference • RS232C/RS485 common cable diagram (D320CBL20, 6 feet (2 m)) • RS232C shared cable wiring diagram (D320CBL50, 15 feet (5 m)) D320CBL20 IBM-PC computer VCC (5 V) 9 Pin D-sub cable 9 Pin D-sub cable...
  • Page 57: Chapter 5: Cpu Operation And Memory

    This chapter provides you with information about memory addresses and the CPU operation. It includes a terminology section and an overview of registers. This chapter discusses: • The terminology used in the D320 PLC manual • CPU operation and processing •...
  • Page 58: Terminology

    D320 PLC User's Manual Terminology This section introduces some terminology you should know. Address (register) Address refers to the location of memory being used. It can refer to the external input/output module or internal memory. An address is categorized into 1 bit, 16 bit (word), or 32 bit (double word).
  • Page 59: Overview Of Cpu Operation Mode

    It can be in Run, Stop, Remote, or Error mode. Run Mode (operating) The D320 PLC reads the external input signals and executes the user program stored in RAM. The external outputs are updated every scan according to program results.
  • Page 60: Cpu Processing Procedure

    D320 PLC User's Manual Operation mode and function according to CPU mode switch Mode Change Operation LED Display Program Data Change Initialize Mode after Switch Mode Run Prog. Change Switch Power-Cycle Disabled Enabled × Stop Enabled Enabled × × Enabled...
  • Page 61: Introduction To Registers

    (serial process) Introduction to Registers The D320 PLC has a series of registers for storing data. Different registers store different types of data. R (Relay) register (Can be bit, word or double word) Indicates the internal memory address which is directly linked with the real-world external input/output module.
  • Page 62: Internal/External Address Designation

    L (Link) register (Can be bit, word, or double word) A special memory area which holds shared data when the D320 PLC is on a Link Network with other D320 PLC's. Refer to the D320 Link Network User's Manual for detailed information on the L registers.
  • Page 63: Expression Example

    Chapter 5: CPU Operation and Memory D320 Memory Addresses Type Scope Features External I/O Area R000.0 to R127.15 Local I/O memory area. Remote I/O memory area. 2048 points, 128 words Link Area L000.0 to L063.15 Link memory area. 1024 points, 64 words M000.0 to M063.15 Link memory area for second loop.
  • Page 64: Double Word Address Designation

    D320 PLC User's Manual Double Word Address Designation • Double words are composed of two words put together. The designation for a double word follows the word number designation method, consisting of a one character register type and a 4 digit word address. Double words can hold 32 bits of data.
  • Page 65: Absolute Address Designation

    Chapter 5: CPU Operation and Memory Absolute Address Designation In LDR, DLDR, STO, DSTO instructions, the absolute address is used to perform indirect memory operations using pointers. The absolute address is also used by the D320 program loader port protocol for reading and writing memory areas.
  • Page 66: I/O Address Designation

    D320 PLC User's Manual I/O Address Designation (8-slot backplane) Example I/O Addressing Configuration Slot No I/O Points Word No R2, R3 R4, R5 R8, R9 R000.0 R001.0 R002.0 R004.0 R006.0 R007.0 R008.0 R000.1 R001.1 R002.1 R004.1 R006.1 R007.1 R008.1 Bit No R000.2...
  • Page 67: Special Internal Addresses

    Chapter 5: CPU Operation and Memory Special Internal Addresses F000 to F015 System Flags Address Function Details Remarks F0 register System check/control System self check/program checking, operation control. F1 register System check/clock 0.02/0.1/1.0 s timer output, operation results, carry flag F2 register Link control Link installation and operation mode setting.
  • Page 68 D320 PLC User's Manual F0.0 to F0.15 (F0 word register) System/Diagnostic Functions Address Function Details Remarks F0.0 System check When power is applied, the system runs self- Normal: Off diagnostics. Should any fault exist, the error lamp is turned on. Output and operation are halted.
  • Page 69 Chapter 5: CPU Operation and Memory F1.0 to F1.15 (F1 word register) Special Application Functions Address Function Details Note F1.0 First single scan Maintain On state for first single-scan period, when the CPU changes its status from Stop to Run. F1.1 Scan clock Cycle On/Off state for each scan during the...
  • Page 70 D320 PLC User's Manual F12.0 to F12.15 (F12 word register) Realtime Clock Functions Address Function Details Note F12.0 RTC check On when the RTC is enabled. Output F12.3 Flash On when the Flash ROM is enabled. Output F12.10 RTC set error On when there is an error setting the RTC.
  • Page 71 Chapter 5: CPU Operation and Memory Address Function Detail SR017 System error information Gives result of self-check by CPU. Indicates error content when F0.0 turns On. Watchdog time error Undefined instruction during run state Peripheral device fault Misc. faults Logic circuit fault Microcomputer fault SR018 Location of undefined...
  • Page 72 D320 PLC User's Manual Syntax Check Data (16 bits of SR30) Indicates the result of the automatic check on user program syntax when the programmer or GPC executes a syntax check, and when operation mode is switched from the Stop state to the Run state. If the value of SR30 is not zero, F0.4 turns On.
  • Page 73 Chapter 5: CPU Operation and Memory SR290 to SR297 (W2849 to W2857) Realtime Clock Functions Sets the time of the built-in clock (RTC) and stores and displays the current time. Data is stored in BCD format. Address Control display Bit Control Contents 15 14 13 12 11 10 SR289 This year...
  • Page 74 HH:MM:SS format. Click the OK button to accept the values and change the data in the PLC. The D320 PLC realtime clock is completely year 2000 compliant. However, as the year is designated by a two-digit representation, it is the responsibility of the programmer to accurately account for the proper calculation of dates using the two-digit value.
  • Page 75: Timer/Counter (Tc0-255)

    Chapter 5: CPU Operation and Memory Timer/Counter (TC0-255) The table below gives the timer/counter Set Value and Present Value for each inherent address W2048 W2304 W2088 W2344 W2128 W2384 W2049 W2305 W2089 W2345 W2129 W2385 W2050 W2306 W2090 W2346 W2130 W2386 W2051 W2307...
  • Page 76 D320 PLC User's Manual Internal/external address designation. W2168 W2424 W2214 W2470 W2260 W2516 W2169 W2425 W2215 W2471 W2261 W2517 W2170 W2426 W2216 W2472 W2262 W2518 W2171 W2427 W2217 W2473 W2263 W2519 W2172 W2428 W2218 W2474 W2264 W2520 W2173 W2429 W2219...
  • Page 77 Chapter 5: CPU Operation and Memory Note: Channel: The inherent number of the timer and the counter. Set Value (SV): The designated value for the timer (to turn On) and the counter (number of times On) to start operation. Present Value (PV): Current processing value of the timer (elapsed time) and the counter (number of counts).
  • Page 78 D320 PLC User's Manual...
  • Page 79: Chapter 6: Instructions

    Chapter 6: Instructions Instructions This chapter contains all of the instructions that are used with the D320 PLC. The instructions are grouped by function, and then explained in detail. This chapter discusses: • The instructions that are used with the D320 PLC •...
  • Page 80: Basic Instructions

    D320 PLC User's Manual Basic Instructions Mnemonic Command Ladder Symbol Description Start Start NO contact. Start Not Start NC contact. NO contact series circuit. ANN (ADN) And Not NC contact series circuit. NO contact parallel circuit. Or Not NC contact parallel circuit.
  • Page 81: Timer/Counter/Sr Instructions

    Chapter 6: Instructions Timer/Counter/SR Instructions Mnemonic Command Ladder Description Remarks Symbol On Delay Timer Turn on after set Time Base: Ch 0-63: 0.01s T CH = 10 delay time from Ch 64-255: 0.1s SV = 500 input on. Setting range: SV = 0-65535 Done Contact: TC + channel no.
  • Page 82: Comparison Instructions

    D320 PLC User's Manual Comparison Instructions Mnemonic Command Word Double Word Description STR = START = On if A(C) value and B(D) value are AND = AND = the same. OR = OR = STR <> START <> On if A(C) value and B(D) value are different.
  • Page 83: Arithmetic Instructions

    Chapter 6: Instructions Arithmetic Instructions Mnemonic Command Word Double Word Description Decimal addition DADD D = S1 + S2 (DADD) (Decimal operation) S1 = S1 = S2 = S2 = Decimal subtraction D = S1 - S2 DSUB (DSUB) (Decimal operation) S1 = S1 = S2 =...
  • Page 84: Logic Instructions

    D320 PLC User's Manual Logic Instructions Mnemonic Command Word Double Word Description AND (logic multiply) Store AND of S1 and S2 in D. DAND (DAND) S1 0 S1 = S1 = S2 = S2 = S2 0 OR (logic sum) Store OR of S1 and S2 in D.
  • Page 85: Word Conversion Instructions

    Chapter 6: Instructions Word Conversion Instructions Mnemonic Command Word Double Word Description Binary Coded Convert binary number of S to BCD DBCD (DBCD) Decimal and store in D. S ..0 0 1 1 1 1 1 1 =63 D ..0 1 1 0 0 0 1 1 =$63 Binary Convert BCD of S to binary number DBIN...
  • Page 86: Bit Conversion Instructions

    D320 PLC User's Manual Bit Conversion Instructions Mnemonic Command Word Double Word Description BSET Bit Set Set Nth bit of D to 1. BSET ..0 1 1 1 1 1 0 0 BRST Bit Reset Reset Nth bit of D to 0.
  • Page 87: Transfer Instructions

    Chapter 6: Instructions Transfer Instructions Mnemonic Command Word Double Word Description Load D←(Sr) Store value at absolute address Sr in DLDR (DLDR) Sr = Sr = Register Absolute Data Value Address Value Sr = Store (D)←Sr Store Sr in register at absolute DSTO (DSTO) address D.
  • Page 88: Block Processing Instructions

    D320 PLC User's Manual Block Processing Instructions Mnemonic Command Word Double Word Description For Loop Begin execution of instructions DFOR (DFOR) between FOR and corresponding NEXT. Repeat execution D times. NEXT Next Decrease D of FOR instruction by 1. NEXT If not zero, repeat from FOR Instruction.
  • Page 89: Special Instructions

    Chapter 6: Instructions Special Instructions Mnemonic Command Word Double Word Description INPR Input Refresh Refresh external input (get input INPR signal during execution of program). Ch = Ch is external input word address. OUTR Output Refresh Refresh external output (send output OUTR signal during execution of program).
  • Page 90: How To Read The Description Of Instructions

    D320 PLC User's Manual How to Read the Description of Instructions Each instruction is explained in three parts: the instruction itself, its ladder diagram, and a description. This section explains how to read the instructions. Sample Instruction Mnemonic Substitution Formula...
  • Page 91: Example

    Chapter 6: Instructions Sample Description Range: LET: 0 to 65,535 DLET: 0 to 4,294,976,295 Either a register (R, M, K, L, or W) address or a constant number can be assigned for S. When S is a register address, copy the data of the register to D. When S is a constant number, copy the value to D.
  • Page 92: Basic Instruction Details

    D320 PLC User's Manual Basic Instruction Details Instruction Mnemonic Start of the Circuit Range I Bit Start rung with NO contact Start rung with NC contact Word Double words Ladder Used for the start of a circuit. STR: Start NO (normally open) contact STN: Start NC (normally closed) contact (STR NOT) A: Circuit started with NO contact →...
  • Page 93: And Ann (Adn)

    Chapter 6: Instructions Instruction Mnemonic Series Connection Range Series connection I Bit Word (ADN) Double words Ladder AND: NO (normally open) contact series connection. ANN: NC (normally closed) contact series connection. Description AND and ADN (AND NOT) indicate a series connection of each contact. The number of ANDs and ADNs used within one branch (rung) is unlimited.
  • Page 94: Or Orn

    D320 PLC User's Manual Instruction Mnemonic Parallel Circuit Range Parallel connection I Bit Word Double words Ladder OR: NO (normally open) contact parallel connection. ORN: NC (normally closed) contact parallel connection. Description OR and ORN (OR NOT) indicate parallel connection of each contact.
  • Page 95: Out Set Rst

    Chapter 6: Instructions Instruction Mnemonic Output Range Relay output I Bit On output Word Off output Double words Ladder OUT: Relay coil turns On or Off based on the state of the input conditions. (OUT) SET: Relay coil turns On when the input conditions are true. (SET) RST: Relay coil turns Off when the input conditions are true.
  • Page 96: Not

    D320 PLC User's Manual Instruction Mnemonic Reverse Range I Bit Reverse the previous status of the logic. Word Double words Ladder Reverse the logic result of the input conditions before A at B. Reverse the previous On/Off state and transfer to the next input.
  • Page 97: Str Dif, Str Dfn, And Dif, And Dfn, Or Dif, Or Dfn

    Chapter 6: Instructions Instruction Mnemonic Edge Contact Range STR DIF I Bit Contact which is On for one scan at the up or down point of contact STR DFN Word AND DIF Double words AND DFN OR DIF OR DFN Ladder ) (Off →...
  • Page 98: Anb, Orb

    D320 PLC User's Manual Instruction Mnemonic Block Circuit Range Connect circuit by block I Bit Word Double words Ladder A block R000.0 R000.2 R000.0 (OUT) R000.0 R000.2 R000.0 (OUT) R000.1 R000.3 R000.1 R000.3 A block B block B block ANB: block in series...
  • Page 99: Mcs Mcr

    Chapter 6: Instructions Instruction Mnemonic Master Control Set (Reset) Range Execute block circuit using the specified conditions. Word Double words Ladder MCS: Enable processing of the following block of instructions. (MCS) condition MCR: End block of instructions enabled by MCS. circuit block (MCR) Description...
  • Page 100: Timer/Counter/Sr Instruction Details

    D320 PLC User's Manual Timer/Counter/SR Instruction Details Instruction Mnemonic Timer Range I Bit On delay timer Single shot timer Word Double words Ladder In t seconds (t = SV × time base) after the input is On, the output is On.
  • Page 101 Chapter 6: Instructions Example Program Expression Time Chart R000.0 T CH = 25 R000.0 SV = 70 0.7 sec TC25 R000.1 T CH = 200 SV = 70 R000.1 TC025 M11.5 7 sec (OUT) TC200 TC200 M22.5 (OUT)
  • Page 102: Tof

    D320 PLC User's Manual Instruction Mnemonic Timer Range Off delay timer I Bit Word Double words Ladder While the input is On, the timer output is On. For t seconds (t = T CH = SV × time base) after the input turns Off, the output stays On.
  • Page 103: Uc Dc

    Chapter 6: Instructions Instruction Mnemonic Timer (I) Range Up counter I Bit Down counter Word Double words Example of UC with SV = 3. condition U CH = Whenever count input condition (U input) turns On, PV SV = condition increases by 1.
  • Page 104 D320 PLC User's Manual Example Program Expression Time Chart R000.0 R000.0 U CH = 0 R000.1 SV = 3 R000.1 TC000 M0.0 counter (OUT) time value Output TCO...
  • Page 105: Rct

    Chapter 6: Instructions Instruction Mnemonic Rotation Counter Range Ring counter I Bit Word Double words Ladder U input condition U CH = (condition 1) SV = condition Reset (condition 3) Set Value (SV) Present Value (PV) Output (TC) Description When the input count condition (U input) turns on, the Present Value (PV) is incremented by 1.
  • Page 106: Udc

    D320 PLC User's Manual Instruction Mnemonic Up/Down Counter Range Up/Down counter I Bit Word Double words Ladder U input condition U CH = (condition 1) SV = D input condition (condition 2) Reset condition (condition 3) Set Value Present (SV)
  • Page 107 Chapter 6: Instructions Example Program Expression Time Chart R000.0 U input (R0.0) U CH = 64 R000.1 SV = 3 Down Input (R0.1) TC15 Reset Input (TC15) TC64 M1.0 (OUT) Present Value (PV64) Output (TC64)
  • Page 108 D320 PLC User's Manual Instruction Mnemonic Shift Register Range Shift Register I Bit Word Double words Ladder condition I SB = Shift data EB = (condition 1) condition Shift pulse condition (condition2) Reset (condition 3) Starting contact no. (SB) (SB+1) End contact no.
  • Page 109 Chapter 6: Instructions Examples Program Expression Time Chart R0.0 Input R0.0 I Sb = K114 R0.7 Eb = K201 Pulse R0.7 R0.15 Reset R0.5 K1.14 R3.0 (OUT) Output K1.14 K1.15 R3.5 (OUT) Output K1.15 K2.0 R0.10 (OUT) Output K2.0 K2.1 M0.11 (OUT) Output K2.1...
  • Page 110: Comparison Instruction Details

    D320 PLC User's Manual Comparison Instruction Details Instruction Mnemonic Comparing the Value Range A = B (A is equal to B) A <> B (A is not equal to B) <> A > B (A is greater than B) I Word >...
  • Page 111: Substitution, Increment/Decrement Instruction Details

    Chapter 6: Instructions Substitution, Increment/Decrement Instruction Details Instruction Mnemonic Substitution Formula Range Direct substitution of number (direct output of number) DLET I Word I Double words Ladder D: Destination S: Source Example: S = M0, and M0 is 123 D = R3, and R3 is 456 Before execution: M0 = 123, R3 = 456 After execution: M0 = 123, R3 = 123...
  • Page 112: Inc Dinc Incb Dincb

    D320 PLC User's Manual Instruction Mnemonic Increment Range Increment (INC, DINC) DINC BCD increment (INCB, DINCB) I Word INCB I Double words DINCB Ladder D = D + 1: Decimal number increment INCB D = D + 1: BCD increment Description INC and DINC increase D in decimal by 1 when the input is On.
  • Page 113: Dec Ddec Decb Ddecb

    Chapter 6: Instructions Instruction Mnemonic Decrement Range Decrement (DEC, DDEC) DDEC BCD decrement (DECB, DDECB) I Word DECB I Double words DDECB Ladder D = D - 1: Decimal decrement DECB D = D - 1: BCD decrement Description DEC and DDEC decrease D by 1 down to 0 when the input is On. DECB and DDECB decrease D by 1 in BCD to 0 when the input is On.
  • Page 114: Arithmetic Instruction Details

    D320 PLC User's Manual Arithmetic Instruction Details Instruction Mnemonic Addition Range Decimal addition (ADD, DADD) DADD BCD addition (ADDB, DADDB) I Word ADDB I Double words DADDB Ladder D = S1 + S2 Decimal: S1 = 21, and S2 = 22...
  • Page 115 Chapter 6: Instructions Example Program Expression Operation Results Initial conditions: W0 = 00017 = $0011 W1 = 00001 = $0001 D = W10 S1 = W0 W2 = 00025 = $0019 S2 = W2 W3 = 00002 = $0002 DADD D = W11 Operation results: W10 = 00042 = $002A S1 = W0...
  • Page 116: Sub Dsub Subb Dsubb

    D320 PLC User's Manual Instruction Mnemonic Subtraction Range Decimal subtraction (SUB, DSUB) DSUB BCD subtraction (SUBB, DSUBB) I Word SUBB I Double words DSUBB Ladder D = S1 - S2 Decimal: S1 = 34 and S2 = 19 S1 =...
  • Page 117: Mul, Dmul, Mulb, Dmulb

    Chapter 6: Instructions Instruction Mnemonic Multiplication Range Decimal multiplication (MUL, DMUL) DMUL I Word BCD multiplication (MULB, MULB I Double words DMULB) DMULB Ladder D = S1 × S2 Decimal: S1 = 3 and S2 = 7 S1 = S2 = Hexadecimal: S1 = $03 and S2 = $07 MULB MUL Example:...
  • Page 118: Div Ddiv Divb Ddivb

    D320 PLC User's Manual Instruction Mnemonic Division Range Decimal division (DIV, DDIV) DDIV BCD division (DIVB, DDIVB) I Word DIVB I Double words DDIVB Ladder D = S1 ÷ S2 Decimal: S1 = 18 and S2 = 3 S1 =...
  • Page 119: Adc, Dadc, Adcb, Dadcb

    Chapter 6: Instructions Instruction Command Addition with Carry Range Decimal addition with carry (ADC, DADC) DADC I Word BCD addition with carry (ADCB, ADCB I Double words DADCB) DADCB Ladder D = S1 + S2 + carry Decimal: S1 = 21, and S2 = 22 S1 = S2 = Hexadecimal: S1 = $15 and S2 = $16...
  • Page 120 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: W0 = 00017 = $0011 R0.0 W1 = 00025 = $0019 Operation results: W10 = 00017 + 00025 +1 = 00043 W11 = $0011 + $0019 + 0 = $0030 R0.0...
  • Page 121: Sbc, Dsbc, Sbcb, Dsbcb

    Chapter 6: Instructions Instruction Command Subtraction with Carry Range Decimal subtraction with carry (SBC, DSBC) DSBC I Word BCD subtraction with carry SBCB I Double word (SBCB, DSBCB) DSBCB Ladder D = S1 - S2 - carry Decimal: S1 = 34 and S2 = 19 S1 = S2 = Hexadecimal:...
  • Page 122 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: W0 = 00016 = $0010 R0.0 W1 = 00002 = $0002 Operation results: W10 = 00016 - 00002 - 1 = 00013 W11 = $0010 - $0002 - 0 = $0008 R0.0...
  • Page 123: Abs, Dabs, Neg, Dneg, Not, Dnot

    Chapter 6: Instructions Instruction Mnemonic Absolute Value, NEG and NOT Range ABS: Absolute value DABS NEG: 2's complement I Word NOT: 1's complement I Double words DNEG DNOT Ladder ABS: Take the absolute value of D, and store it in D. NEG: Take the 2’s complement and store it in D.
  • Page 124: Logic Instruction Details

    D320 PLC User's Manual Logic Instruction Details Instruction Mnemonic Bit AND Operation Range Bit AND operation DAND I Word I Double words Ladder Process each bit of S1 and S2 in bit AND operation and store the result in D.
  • Page 125: Or Dor

    Chapter 6: Instructions Instruction Mnemonic Bit OR Operation Range Bit OR operation I Word I Double words Ladder Process S1 and S2 in bit OR operation and store the result in D. S1 = S2 = S1 = S2 = Description Process S1 and S2 (word/double word) by bit OR operation and store the result in D.
  • Page 126: Xor Dxor

    D320 PLC User's Manual Instruction Mnemonic Bit Exclusive OR Operation Range Bit exclusive OR operation DXOR I Word I Double words Ladder Process S1 and S2 in bit exclusive OR operation and store the result in D. S1 = S2 =...
  • Page 127: Xnr Dxnr

    Chapter 6: Instructions Instruction Mnemonic Bit Exclusive NOR Operation Range Bit exclusive OR NOT operation DXNR I Word I Double words Ladder Process S1 and S2 in bit exclusive OR NOT operation and store the result in D. S1 = S2 = DXNR S1 =...
  • Page 128: Rotation Instruction Details

    D320 PLC User's Manual Rotation Instruction Details Instruction Mnemonic Rotate to the Left Without Carry Range Rotate specified address to the left (low to high) DRLC I Word I Double words Ladder D = Register address N = Number of bits to rotate...
  • Page 129: Rrc Drrc

    Chapter 6: Instructions Instruction Mnemonic Rotate to the Right Without Carry Range Rotate the specified address to the right (high to low) DRRC I Word I Double words Ladder D = Register address N = Number of bits to rotate 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 p o n m l k j i h g f e d c b a...
  • Page 130: Rol Drol

    D320 PLC User's Manual Instruction Mnemonic Rotate to the Left Range Rotate the specified address to the left with the carry flag DROL I Word I Double words Ladder D = Register address N = Number of bits to rotate...
  • Page 131 Chapter 6: Instructions Example Program Expression Operation Results R0.0 F1.8 (OUT) R0.0 R0.1 R0.1 D =MO N = 1 $00 $01 $06 $0D (word) … 1 1 0 1 … 0 1 1 0 … 0 0 1 1 … 0 0 0 1 0 …...
  • Page 132: Ror Dror

    D320 PLC User's Manual Instruction Mnemonic Rotate to the Right Range Rotate the specified address to the right with the carry flag DROR I Word I Double words Ladder D = Register address N = Number of bits to rotate...
  • Page 133: Shl Dshl

    Chapter 6: Instructions Instruction Mnemonic Shift to Left Range I Bit Shift to left (high-order bit) by N bits DSHL Word Lowest bit becomes 0 Double words Ladder D = Register address N = Number of bits to rotate 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 carry p o n m l k j i h g f e d c b a...
  • Page 134 D320 PLC User's Manual Example Program Expression Operation Results R0.0 R0.0 D = MO S = $FFFF R0.1 $FFF0 R0.1 $FFFF $FFFC D = M0 N = 2 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0...
  • Page 135: Shr Dshr

    Chapter 6: Instructions Instruction Mnemonic Shift to Right Range Shift to right (low-order bit) by N bits DSHR I Word The highest bit becomes 0 I Double words Ladder D = Register address N = Number of bits to rotate 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 carry p o n m l...
  • Page 136: Word Conversion Instruction Details

    D320 PLC User's Manual Word Conversion Instruction Details Instruction Mnemonic BCD Conversion, Range Binary Conversion BCD: Convert binary to BCD DBCD BIN: Convert BCD to binary I Word I Double words DBIN Ladder BCD: Convert the S value from binary into BCD and store in D.
  • Page 137: Xchg Dxchg

    Chapter 6: Instructions Instruction Mnemonic Data Exchange Range XCHG Exchange registers of D1, D2 with each other DXCHG I Word I Double words Ladder XCHG Exchange registers D1 and D2 (word /double word) with each other. D1 = D2 = D1 =>...
  • Page 138: Seg

    D320 PLC User's Manual Instruction Mnemonic 7-Segment Decoder Range Convert the low-order 4 bits of S into 7-segment display format and I Word store in D Double words Ladder Convert the value in the low-order 4 bits of address S (0 to 15) into the proper format for display by a 7-segment display and store in D.
  • Page 139: Enco Deco

    Chapter 6: Instructions Instruction Mnemonic Decoder and Encoder with 8421 Range ENCO ENCO: 8421 encoder DECO DECO: 8421 decoder I Word Double words Ladder ENCO ENCO: Inspect the S register. If there is a bit in the On state, encode it (on bit n) and store it in the low-order 8 bits of D.
  • Page 140 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: W0 = $0070 (hex) R0.0 ENCO W1 = $1235 (hex) D = W2 S = W0 W2 = $5678 (hex) DECO W3 = $9ABC (hex) D = W3 S = W1...
  • Page 141: Dis Uni

    Chapter 6: Instructions Instruction Mnemonic Dissemble by 4 bit units/ Range Unify by 4 bit units DIS: Dissemble by 4 bit units UNI: Unify by 4 bit units I Word Double words Ladder DIS: Separate Sr into Nd+1 units of 4 bits each, and store in the low 4 bits of words starting at D.
  • Page 142 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: M0 = $74E5 (hex) W0 = $1111 (hex) R0.0 W1 = $2222 (hex) D = W0 Nd = 3 W2 = $3333 (hex) Sr = M0 W3 = $4444 (hex)
  • Page 143: Bit Conversion Instruction Details

    Chapter 6: Instructions Bit Conversion Instruction Details Instruction Instruction Bit Set, Reset, Reverse, Test Range BSET BSET: Nth bit set BRST BRST: Nth bit reset I Word BNOT BNOT: Nth bit reverse Double words BTST BTST: Nth bit test Ladder BNOT BSET BSET: Set the Nth bit in the D register...
  • Page 144 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: M0 = 0001 0010 0001 1100 (binary) R0.0 BSET M1 = 0011 0100 0101 1100 (binary) D = M0 N = 5 M2 = 0101 0110 0111 0100 (binary)
  • Page 145: Sum

    Chapter 6: Instructions Instruction Mnemonic Count Number of On (= 1) Bits Range Count On (= 1) bits in the S register I Word Double words Ladder SUM: Count the number of On (= 1) bits in the S register and store the result in the D register.
  • Page 146: Sc Rc Cc

    D320 PLC User's Manual Instruction Mnemonic Carry Bit (F1.8) Set, Reset, Range Reverse SC: Set carry bit RC: Reset carry bit Word CC: Reverse carry bit Double words Ladder SC: Carry bit set (F1.8: X → 1). RC: Carry bit reset (F1.8: X → 0).
  • Page 147: Transfer Instruction Details

    Chapter 6: Instructions Transfer Instruction Details Instruction Mnemonic Load Absolute Address Range Store value at absolute address Sr in D, D←(Sr) DLDR I Word I Double words Ladder Store the value located at the absolute address pointed to by Sr into register D.
  • Page 148 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: W0 = 611 R0.0 D = W0 R0.0 (bit) D = R2 data of data of data of data of data of Sr = W0 W100 W101 W102 W198...
  • Page 149: Sto Dsto

    Chapter 6: Instructions Instruction Mnemonic Store Absolute Address Range Store Sr in register at absolute address D, (D)←Sr DSTO I Word I Double words Ladder Store the data contained in the Sr register into the register pointed Sr = to by the absolute address contained in register D. R0 word absolute address: 0 (decimal) DSTO M0 word absolute address: 192 (decimal)
  • Page 150 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: W0 = 611 R0.0 D = W0 R0.0 (bit) Sr = R1 D = W0 (word process measurement) Store in Store in Store in Store in Store in W100...
  • Page 151: Mov Fmov

    Chapter 6: Instructions Instruction Mnemonic Duplicate Word, Duplicate the Range Same Word MOV: Copy a block of words FMOV FMOV: Fill a block of words with I Word the same value Double words Ladder MOV: Copy Ns words from Sr to D. Sr = Ns = FMOV...
  • Page 152 D320 PLC User's Manual Example Program Expression Operation Results Initial conditions: M0 = $12AA (hex) W0 = $XXXX (hex) R0.0 M1 = $340F (hex) W1 = $XXXX (hex) D = W0 Sr = M0 M2 = $56F0 (hex) W2 = $XXXX (hex)
  • Page 153: Bmov Bfmv

    Chapter 6: Instructions Instruction Mnemonic Copy Bit, Copy the Same Bit Range I Bit BMOV BMOV: Copy a block of bits BFMV BFMV: Fill a block of bits with the Word same bit value Double words Ladder BMOV BMOV: Copy Ns bits from bit address Sb into bit address D. Db = Sb = Ns =...
  • Page 154: Block Processing Instruction Details

    D320 PLC User's Manual Block Processing Instruction Details Instruction Mnemonic FOR-NEXT Loop Range FOR (DFOR): Start loop DFOR NEXT: End loop I Word NEXT I Double words Ladder FOR: Begin execution of instructions between (D)FOR and corresponding NEXT. Repeat execution D times.
  • Page 155 Chapter 6: Instructions Example Program Expression Operation Results Initial condition: W0 = 10 R0.0 M0 = 0 D = W0 Operation results: W0 = 0 D = M0 M0 = 10 NEXT When the R0.0 contact changes from Off On, execution of the FOR/NEXT loop occurs.
  • Page 156: Jmp Lbl

    D320 PLC User's Manual Instruction Mnemonic Jump by Pointer Range JMP: Jump by pointer LBL: Specify the pointer Word Double words Ladder JMP: Jump to the LBL instruction L (L = 0 to 63). LBL: Position jumped to by the JMP instruction.
  • Page 157: Jmps Jmpe

    Chapter 6: Instructions Instruction Mnemonic Jump Range JMPS JMPS: Start jump JMPE JMPE: End jump Word Double words Ladder JMPS: Jump directly to the corresponding JMPE instruction. JMPS JMPE JMPE: Position jumped to by JMPS instruction. (OUT) Description The JMPS and JMPE instruction function identically to the JMP and LBL instructions, but do not require the use of a label.
  • Page 158 D320 PLC User's Manual Example Program Expression Operation Results By executing a JMPS: R0.0 JMPS When contact R0.0 or R0.1 turns On, execution of the program jumps directly from the associated JMPS to its corresponding JMPE. JMPE R0.1 JMPS JMPE...
  • Page 159: Call Sbr Ret

    Chapter 6: Instructions Instruction Mnemonic Call Subroutine Range CALL CALL: Call subroutine SBR: Start subroutine Word RET: End subroutine Double words Ladder CALL Sb = CALL: Call subroutine Sb (Sb = 0 to 63) SBR: Start Subroutine Sb = RET: Return from Subroutine Description The subroutine instructions are used when a block of instructions needs to be called more than once, or called with different values, from the main program.
  • Page 160 D320 PLC User's Manual Example Program Expression Operation Results When contact R0.0 and/or R0.1 turns On, the CALL Sb = R0.0 CALL 3 instruction is executed and the instructions between Sb = 3 SBR Sb = 3 and RET are executed. After executing this subroutine, the program returns to the next instruction R0.1...
  • Page 161: Int Reti

    Chapter 6: Instructions Instruction Mnemonic Constant Cycle Interrupt Range Routine INT: Start of constant cycle routine RETI Word RETI: End of constant cycle Double words routine Ladder INT: Begin block of constant cycle scan instructions. Ni = Ni: The constant cycle interrupt time interval. Range: 1 to 999 (20 ms to 10 sec) RETI Time interval: (Ni + 1) ×...
  • Page 162: Special Instruction Details

    D320 PLC User's Manual Special Instruction Details Instruction Mnemonic Refresh External Input and Range Output INPR INPR: Refresh external input I Bit OUTR OUTR: Refresh external output Word Double words Ladder INPR INPR: Immediately update the state of an external input signal during Ch = program execution.
  • Page 163 Chapter 6: Instructions Example Program Expression Operation Results R0.0 INPR INPR/OUTR Normal Ch = 2 Example Operation Read Inputs Read Inputs R0.1 OUTR Ch = 3 Program Program Read R2 Input Update R3 Output Update Update Outputs Outputs When R0.0 is On, get Ch = 2 (R2 word) immediately from the external input.
  • Page 164: Wat

    D320 PLC User's Manual Instruction Mnemonic Clear Watchdog Time Range I Bit WAT: Clear watchdog time Word Double words Ladder WAT: Clears the watchdog timer while executing the program. Description This instruction clears the watchdog timer within the CPU module to prevent the program from stopping even if the scan time exceeds the maximum watchdog time.
  • Page 165: End

    Chapter 6: Instructions Instruction Mnemonic End Control Program Range END: End control program (Inserted automatically) Word Double words Ladder Description This instruction indicates the end of the control program. This instruction is automatically added by GPC. It is not programmed by the user.
  • Page 166: Read

    D320 PLC User's Manual Instruction Mnemonic Read Intelligent I/O Data Range READ Read data from the shared memory of an intelligent I/O unit. I Word Double words Ladder READ READ: Read NR3 words from slot NN5, module memory To = RR1 NNx: number address NR6, and store in words starting at RR1.
  • Page 167 Chapter 6: Instructions Example Program Expression Operation Results Read 5 words from the 0 address of the shared memory of R0.0 READ the intelligent I/O module located in the third slot of the To = W0 NN?: number backplane, and write to memory addresses starting at W0 Sz = 5 NR?: number/register Fr = 3:0...
  • Page 168: Write

    D320 PLC User's Manual Instruction Mnemonic Write Intelligent I/O Data Range WRITE Write data to the shared memory of an intelligent I/O unit I Word Double words Ladder WRITE WRITE: Read NR3 words from NR5, and write them to slot...
  • Page 169 Chapter 6: Instructions Example Program Expression Operation Results Reads two words from W10 and W11, and writes them to R0.0 WRITE word addresses 5 and 6 of the shared memory of the To = 0:5 intelligent I/O module in slot 0 (the first I/O slot). Sz = 2 Fr = W10 Slot 0 Slot 1 Slot 2 Slot 3 Slot 4...
  • Page 170: Rmrd

    D320 PLC User's Manual Instruction Mnemonic READ Remote Intelligent I/O Range Data RMRD Read data from the shared memory of an intelligent I/O unit I Word on a remote I/O drop Double words Ladder RMRD Read NR1 words from remote I/O loop NN3, station...
  • Page 171: Rmwr

    Chapter 6: Instructions Instruction Mnemonic WRITE Remote Intelligent I/O Range Data RMWR Write data to the shared memory of an intelligent I/O unit on a I Word remote I/O drop Double words Ladder Read NR5 words from NR6, and write them to RMWR Nt = NN1:NN2 NNx: number...
  • Page 172: Recv

    D320 PLC User's Manual Instruction Mnemonic Word Data Receive Range RECV Word data receive command using link network I Word Double words Ladder Read NR1 words from link network NN3, station RECV NNx: number (1 to 3) To = NR1:RR2...
  • Page 173: Send

    Chapter 6: Instructions Instruction Mnemonic Word Data Send Range SEND Word data send command using link network I Word Double words Ladder SEND Read NR5 words from NR6, and write them to link Nt = NN1:NN2 NNx: number (1 to 3) network NN1, station NN2, register type NN3, To = NN3:NR4 NRx: number/register...
  • Page 174: Recvb

    D320 PLC User's Manual Instruction Mnemonic Bit Data Receive Range RECVB Bit data receive command using link network I Word Double words Ladder RECVB Read the bit value from link network NN3, station NNx: number (1 to 3) To = BR1...
  • Page 175: Sendb

    Chapter 6: Instructions Instruction Mnemonic Bit Data Send Range SENDB Bit data send command using the link network I Word Double words Ladder SENDB Read the bit value of NB5, and write it to link NNx: number (1 to 3) Nt = NN1:NN2 NRx: number/register network NN1, station NN2, register type NN3, bit...
  • Page 176 D320 PLC User's Manual...
  • Page 177: Chapter 7: Testing And Troubleshooting

    Chapter 7: Testing and Troubleshooting Testing and Troubleshooting This chapter provides information on testing and troubleshooting the D320 PLC. This chapter discusses: • Testing procedures for the D320 PLC • How to troubleshoot the D320 PLC...
  • Page 178: Test Precautions

    D320 PLC User's Manual Test Precautions When checking the system: CAUTION: Always turn off the power whenever you install or remove a module. Check the module more than one time before exchanging the part. Include a complete description of the symptoms when you return a defective module for repair.
  • Page 179 Chapter 7: Testing and Troubleshooting Item What to Check The connection of the power • Check that the wiring is secure and intact. cable and the I/O cable. • Check that the terminal screws are tightly fastened. • Check that I/O module is firmly fixed. •...
  • Page 180: Testing Procedures

    D320 PLC User's Manual Testing Procedures When the PLC has been installed and wired, begin testing in the following order. Supply Power Initialize Mem ory Check I/O W iring Programm ing Testing Correct Program Store Program...
  • Page 181 Chapter 7: Testing and Troubleshooting Item What to Check/Do • Check that the input voltage to the power supply is within specification. Power source • Check that the control voltage to the I/O modules is within specification. • Turn on the power source. •...
  • Page 182: Correcting Errors

    D320 PLC User's Manual Correcting Errors System Check Refer to the system check flow chart when you encounter problems during startup and testing. System Check Flow Chart Go to the power supply Is power supply LED check flow chart illuminated?
  • Page 183: Power Supply Check

    Chapter 7: Testing and Troubleshooting Power Supply Check Power supply LED is not illum inated Is power being supplied? Supply power Is the power supply LED illuminated? Is the Adjust voltage within the voltage within the allowable specified range range? Is power supply LED illuminated? Is the fuse blown?
  • Page 184: Run Check

    D320 PLC User's Manual Run Check Run LED is not illuminated Is CPU mode switch set Set mode switch to Run at Run? Is the Run LED illuminated? On (normal) Place in Run mode using GPC Go to the Error check flow...
  • Page 185: Error Check

    Chapter 7: Testing and Troubleshooting Error Check Error LED is illuminated F0.0 = 1 System error. Resupply power. F0.1 = 1 System ROM error. Resupply the power. Are any of the following bit F0.2 = 1 addresses in the On state: System RAM error.
  • Page 186: I/O Check

    D320 PLC User's Manual I/O Check This page presents an example of a troubleshooting procedure to follow when errors are encountered with the external I/O. In this example, a digital input module is located in slot 0 (R0), and a digital output module is located in slot 1 (R1).
  • Page 187 Chapter 7: Testing and Troubleshooting Are the input LEDs for R0.2 and R0.3 On? Are inputs Is the input R0.2 and R0.3 On in PLC? voltage at the R0.2/R0.3 Use GPC to m onitor. terminals correct? Refer to System Check Is the wiring from the Replace the input m odule flow chart...
  • Page 188: External Environment Check

    D320 PLC User's Manual External Environment Check Check the external environm ent Is the tem perature below Lower the temperature 55°C (131°F)? Is the tem perature above Raise the tem perature 0°C (32°F)? Is the hum idity within the range of...
  • Page 189: Troubleshooting, Maintenance And Inspection Tables

    Chapter 7: Testing and Troubleshooting Troubleshooting, Maintenance and Inspection Tables The following tables list some common problems and troubleshooting procedures for the PLC system in the event of faulty operation. Additionally, a table is provided which covers the routine maintenance procedures to be followed to ensure long life of the PLC system with minimum downtime and maintenance cost.
  • Page 190 D320 PLC User's Manual Input Module Symptom Expected Cause Troubleshooting No inputs on an input module No external input power Supply power. will turn On (LEDs are not Low external input voltage Make sure full voltage is being illuminated). supplied.
  • Page 191 Chapter 7: Testing and Troubleshooting Output Module Symptom Expected Cause Troubleshooting No outputs on an output No external input power Supply power. module will turn On. Low external input voltage Make sure full voltage is being supplied. Terminal screw is loose/ Tighten screw/ Defective contact Reconnect module...
  • Page 192: Periodic Inspection And Preventive Maintenance

    D320 PLC User's Manual Periodic Inspection and Preventive Maintenance The D320 PLC Series requires regular inspection and maintenance for proper operation. The following items should be checked every six months. Item What to Check Criteria Test Equipment Supplied Does the voltage measured within the...
  • Page 193: Chapter 8: Troubleshooting Noise Problems

    Chapter 8: Troubleshooting Noise Problems Troubleshooting Noise Problems This chapter outlines the various causes of noise that affect the D320 PLC system. Installation tips and troubleshooting methods for identifying noise problems are also provided. This chapter discusses: • The causes of noise •...
  • Page 194: Noise Occurrence

    D320 PLC User's Manual Noise Occurrence Types of Noise • Radiation noise is transmitted in the form of a magnetic wave. The amplitude of the magnetic wave is measured in Gauss. • Conduction noise is transmitted through a direct path such as signal wiring or ground connections as a strong, high-voltage surge.
  • Page 195: Sources Of Noise

    There are three main sources of noise. Some of these sources generate large noise amplitudes. The occurrence time can be very short (impulse type) or continuous (power line induced). Some noise levels can damage the D320 PLC components and peripheral devices. Noise Generated by Electronic Equipment All electronic devices radiate noise in the form of a magnetic field.
  • Page 196: Advised Installation Practices

    D320 PLC User's Manual Advised Installation Practices Shield the PLC The most common method of shielding, is to install the PLC inside a grounded steel enclosure. Proper Cable Selection Use twisted, shielded-pair cable for the power cable and field wiring. Properly terminate the shields of all cables to a single-point high-quality ground.
  • Page 197: Isolation And Filtering Techniques

    Chapter 8: Troubleshooting Noise Problems Isolation and Filtering Techniques Isolation There are several methods of isolation: • Attach an isolation transformer between the PLC power supply and the VAC source to help remove noise that flows in the power cable. Try to attach the isolation transformer as near to the PLC power supply input terminal strip as possible.
  • Page 198: Filters

    D320 PLC User's Manual Filters Filters should be used to suppress high frequency noise. When using a low-pass filter specify one that is designed for power line applications. Many different types are available from simple modules to complex units. A single device is not necessarily the most cost-effective device for all applications. In specifying the proper filter one must take into account the amplitude/power level of the noise and how often the noise is present.
  • Page 199: Methods Of Handling Large Voltage Spikes Such As Lightning

    Some typical surge absorbers are listed in the following table. For actual installation and application details, refer to manufacturers manuals. Model Name Specifications Manufacturer Remarks CHSA 470 V Cutler-Hammer 120/240 V power CHSA01 490 V Cutler-Hammer 120/240 V power Burying Wire •...
  • Page 200: Shielding Cabling

    D320 PLC User's Manual Shielding Cabling • When the wiring for the I/O module is more than 165 ft (50 m), shield the wire by installing it in ferrous (steel) conduit and use shielded wire. Attach the conduit/shield to the ground at the PLC ground terminal as shown below.
  • Page 201: Methods To Handle I/O Inductive Loads

    Chapter 8: Troubleshooting Noise Problems Methods to Handle I/O Inductive Loads Several methods exist for handling I/O inductive loads. DC Input Module Attach a diode in a reverse biased direction parallel to the inductive load, as close as possible to the load.
  • Page 202 D320 PLC User's Manual Countermeasures Application Characteristics Selection of Parts Load Load Attach a surge If the load is a relay or a solenoid, For a contact voltage of 1 V and a suppressor: the load is slow to return to the contact current of 1 A, use the normal status.
  • Page 203: Warning

    Chapter 8: Troubleshooting Noise Problems Warning The following two protection methods should be avoided. Each of these methods can be effective in removing the sparks when power to the inductive load is turned off. However when power is turned on to the inductive load there will be a high inrush current applied across the relay contacts as they are mating.
  • Page 204: Troubleshooting

    D320 PLC User's Manual Troubleshooting • Noise from magnetic fields induced by other electrical/electronic equipment onto the PLC can be avoided by relocating the PLC during the design process, installing the PLC in a grounded steel enclosure, or attaching a filtering or suppression shield/circuit to the device which is generating the magnetic field.
  • Page 205: Chapter 9: External Dimensions

    Chapter 9: External Dimensions External Dimensions This chapter provides the D320 PLC system dimensions. It includes diagrams of the modules with their dimensions. This chapter contains: • The system dimensions Note: Dimensions are rounded to the nearest 0.05 inch.
  • Page 206: System Dimensions

    D320 PLC User's Manual System Dimensions Base Backplane 3.95 in. 5.95 in. (100 mm) (150 mm) 4.75 in. (120 mm) Slot type Dimension 3 Slot 10.25 in. (260 mm) 9.65 in. (245 mm) 5 Slot 13.0 in. (330 mm) 12.4 in. (315 mm) 8 Slot 17.15 in.
  • Page 207: Expansion Backplane

    Chapter 9: External Dimensions Expansion Backplane 3.95 in. 5.95 in. (100 mm) (150 mm) 4.75 in. (120 mm) Slot type Dimension 5 Slot 13.0 in. (330 mm) 12.4 in. (315 mm) 8 Slot 17.15 in. (435 mm) 16.55 in. (420 mm)
  • Page 208: Power Supply Module Dimensions

    D320 PLC User's Manual Power Supply Module Dimensions 4.45 in. (113 mm) 2.1 in. (53 mm) 5.95 in. (150 mm) CPU and Remote I/O Slave Module Dimensions 2.1 in. (53 mm) 2.1 in. (53 mm) 4.45 in. (113 mm) 5.95 in.
  • Page 209: I/O Module And Intelligent Module Dimensions

    Chapter 9: External Dimensions I/O Module and Intelligent Module Dimensions 1.35 in. 1.35 in. (34.5 mm) (34.5 mm) 4.45 in. (113 mm) 5.95 in. (150 mm) Integrated Remote I/O Drop Dimensions 4.15 in. 4.15 in. (105 mm) (105 mm) 3.45 in. (87 mm) 3.45 in.
  • Page 210 D320 PLC User's Manual...
  • Page 211: Appendix A: D320 Plc Communication Protocol

    PLC using a variety of peripheral communications equipment such as operator interfaces and computers. Additionally, the communications protocol allows for multiple Cutler-Hammer D50, D300, and D320 PLC’s to communicate to a central computer on a single network using RS-485, at distances of up to 4000 ft (1.2 km).
  • Page 212: Communication Rules

    D320 PLC User's Manual Communication Rules Communication Environment The D320 PLC communications protocol uses the following settings: • Half Duplex Asynchronous • No Parity • 1 Stop bit • Communication method: RS232C, or RS485 • Communication speed: 9600, 19200, or 38400 bps •...
  • Page 213: Step 5  Repeated Response

    RR message again. Communications Delay The D320 PLC will return a signal after receiving a Q or an RR within a specific time. However, due to errors in the communications network, CRC values, and communication speed flux, there are occasions when the PLC will not receive the signal from the peripheral device.
  • Page 214: Cpu Id

    No Service Note: Function codes $07 to $10 are used for programming and system control functions, and are beyond the scope of this manual. Please contact Cutler-Hammer technical support for more information. Note: The bit/word address assignment uses the absolute address method for reading memory...
  • Page 215: Cyclic Redundancy Checking (Crc)

    Appendix A: D320 PLC Communication Protocol Cyclic Redundancy Checking (CRC) • The CRC is a 2-byte checksum that is calculated from the data of every message and then attached to the end of the message by the sender. It is used as an error-checking device to prevent loss or corruption of data during transmission of the message.
  • Page 216: The Structure Of The Communications Frame

    D320 PLC User's Manual The Structure of the Communications Frame Query and Response Frame Length Information CRC L CRC H Length of the CRC-16 code information field (byte) (2 byte) 1-255:1-255 byte 0:256 byte Function Code Sender ID Number Receiver ID Number The frame is sent from the source address (SA) by the sender to the destination address (DA), the receiving device.
  • Page 217: Read Bits

    Appendix A: D320 PLC Communication Protocol Read Bits The following can be read: • Bits stored in the absolute address (R, L, M, K, or F). • N consecutive bit contents (On/Off). Query (Q) frame Base Number of bits to be read...
  • Page 218: Write Bits

    D320 PLC User's Manual Write Bits Writing bits allows you to: • Modify the contents of the bits stored in the absolute address (R, L, M, K, or F). • Change the bit state between On/Off. • Change multiple consecutive bytes.
  • Page 219: Read Words

    Appendix A: D320 PLC Communication Protocol Read Words • Read the content of the words (R, L, M, K, F, or W) assigned to the absolute address. • Read n consecutive words. Query (Q) Frame Base Number of words to be read.
  • Page 220: Write Words

    D320 PLC User's Manual Write Words • Changes the content of the words assigned to the absolute address (R, L, M, K, F, or W). • Can change n consecutive word contents. Query (Q) Frame Base Base+0 word values Base+N word values …...
  • Page 221: Read Bits And Words

    Appendix A: D320 PLC Communication Protocol Read Bits and Words • Reads the bits and/or word contents of the specified absolute addresses. • Can read bits and words regardless of their order and location in memory. Query (Q) Frame …...
  • Page 222: Write Bits And Words

    D320 PLC User's Manual Write Bits and Words • Changes the content of the bits or words at the specified absolute addresses. • Words and bits may be modified regardless of their order and location in memory. Query (Q) Frame …...
  • Page 223: Communication Program Example

    Appendix A: D320 PLC Communication Protocol Communication Program Example The following program is an example program written in C code to demonstrate the D320 PLC open communications protocol. This program consists of a header, the main program, and various subroutines. The buffers and a few variables needed to store the communication data are set as global variables, so that the main function and the various functions may have access.
  • Page 224 D320 PLC User's Manual variables. 2. Using the communication function codes, reads the data of the M field, reads the word values of the M0 to M127 area and stores them in the K0 to K127 word area. The K registers are the retentive registers.
  • Page 225 Appendix A: D320 PLC Communication Protocol Mword_reading(); Read the register value for the M area Kword_writing(); (M0 to M127) Store the value for the M area in the else K area (K0 to K127) exit(0); void RR_occurring(void) RR (Request Response) request function.
  • Page 226 D320 PLC User's Manual /* JobID=10 : Success communication Processing */ switch(JobID) case 0: case 5:if (port_number != 5) JobID 0,5: A frame sends the data from the if (port_number == 4) outportb(0x301,0xFF); peripheral device to the PLC. It resets else outportb(PORTADD+0x0C,(inportb(PORTADD+0x0C) | 0x02));...
  • Page 227 Appendix A: D320 PLC Communication Protocol else receiving_Index_max=receiving_frame[3]+5; else if(index==receiving_Index_max-1) receiving_frame[index]=Recport(); if(receiving_frame[index]!=lower_byte(Crc)) JobID=(JobID & 0x05); else if(index==receiving_Index_max) receiving_frame[index]=Recport(); if(receiving_frame[index]==upper_byte(Crc)) JobID++; else JobID=(JobID & 0x05); }; index++; break; case 10:Success=TRUE; JobID=10: Receiving unsigned int communication(void) If the frames that were sent have no response within 3 seconds, assumes it struct time t;...
  • Page 228 D320 PLC User's Manual Sends a function code requesting to read the M area, and stores the received data in the buffer. void Kword_writing(void) Writing Function of the K Register. Uses the communication function /* Example of Write-Register */ code 4 (writing N consecutive words) int i;...
  • Page 229: Appendix B: Pid Loop Control

    Appendix B: PID Loop Control Appendix B: PID Loop Control The D320 PLC is capable of simultaneous PID loop control of up to eight loops at a time. This appendix describes in detail the configuration and programming required to properly implement a...
  • Page 230: Overview

    D320 PLC User's Manual Overview As small Programmable Controllers gain analog and math capability, the need to perform related functions has increased. One of these functions is closed-loop control or PID. PID stands for Proportional, Integral, Derivative control, and comes from the error equation used to perform this type of control: ∆...
  • Page 231 On, the PID loop is turned On. When this bit is off, no PID loop calculations are performed. Parameter Setting Error Flag: The D320 PLC checks the value of each PID loop parameter on a continuous basis to verify that the value is not too large or too small. When one of the parameters goes out of range, this error flag is turned On.
  • Page 232 D320 PLC User's Manual The individual words of the register block define the operating parameters for the functioning of a given PID loop, as well as providing a workspace for the D320 to perform its calculations. These parameters are summarized in Table 3 below.
  • Page 233 As shown in the parameters listed in table 3, there is one special register in each block of parameters, the Status Register (word 0). This register is comprised of bit-level parameters that control and display the status of the PID operation. The bits and their meanings are shown in Table 4. Table 4 –...
  • Page 234: Parameter Descriptions

    D320 PLC User's Manual Parameter Descriptions Each parameter in the PID Loop data block provides a different function to the PID loop control. The descriptions and purposes for each parameter are listed below. STATUS REGISTER Control Bits Control Algorithm Defines PID equation used in calculation. Currently, the ISA form is not yet supported, so this bit must be set to 0.
  • Page 235 SETPOINT The desired value for the Process Value (PV). PROCESS VALUE The actual value of the input that control is being performed on. In most applications, this will be an analog value that is desired to be at a certain level (SP), such as a water level, temperature, flow rate, etc.
  • Page 236: Pid Example

    For this example, a D320 PLC is assembled consisting of the following: 5-slot rack, power supply, D320 CPU, 3 digital I/O modules, a 0-10V Analog Output module, and a 0-10V Analog Input module.
  • Page 237: Ladder Program

    The final step in setting up the example PID loop control application is programming the PLC. The following ladder was generated for the D320 using the Cutler-Hammer GPC5 Programming Software. Initialization of the PID loop parameters occur in the first scan of the program after power-on or a stop to start transition.
  • Page 238 D320 PLC User's Manual F1.0 FMOV Rung 1: Initialize the PID Loop D=W1600 Parameter Block (W1600- SZ=256 W1631) to 0’s. F1.0 F14.0 Rung 2: Disable all 8 PID Loops by resetting flags F14.0, F14.4, F14.8, F14.12, F15.0, F15.4, F15.8 and F14.4...
  • Page 239 F1.0 Rung 5: Set the initial values D=W1604 (Current, high, and low) for the Output Control Variable. D=W1606 S=10000 D=W1607 F1.0 Rung 6: Set the initial values D=W1608 for the Proportional, S=500 Integral, and Derivative terms of the PID Loop equation.
  • Page 240 D320 PLC User's Manual F1.0 Rung 9: Initialize Analog Output D=R003 value to 0. F0.15 Rung 10: Use Analog Input 0 as D=W1602 Process variable. S=R007 F0.15 Rung 11: Set the Analog Output D=R003 to the PID Control S=W1604 Output value.
  • Page 241: Appendix C: Com2 Udcp Specification

    Appendix C: COM2 UDCP Specification Appendix C: COM2 UDCP Specification The D320 PLC provides two program loader ports for communications. This appendix describes in detail the specifications and operation for the User Defined Communications Protocol capability of the second program loader port, COM2.
  • Page 242: Overview

    D320 PLC User's Manual Overview This appendix describes in detail the user-defined communications protocols supported by the second program loader port located on the D320 CPU. Through the use of internal Flags (F) and System Registers (SR), the second port can be configured to support three separate modes of operation; the D320 program loader port protocol (D320 mode), the MODBUS RTU slave protocol (MODBUS mode), and the User-Defined ASCII/Binary transmit/receive protocol (UDCP mode).
  • Page 243: Configuration Flags

    Appendix C: COM2 UDCP Specification Configuration Flags To support the three separate modes of operation for port 2 on the D320 CPU, the processor uses two special internal Flags, F11 and F12. Individual bits in these flags set the mode of operation, trigger communications, indicate status of communications, and configure the port parameters.
  • Page 244: Communication System Registers

    D320 PLC User's Manual Communication System Registers In addition to the special Flags used to configure communications, a bank of System Registers (SR298- SR373) is provided for holding the data transmitted and received. The descriptions of the system registers are contained in Table 3 below.
  • Page 245 Appendix C: COM2 UDCP Specification F11.4 MESSAGE RECEIVED UDCP Mode. When the CPU has successfully received a complete message, this flag is set to indicate to the user program that a new message is available in the Receive Data Buffer (SR334-SR369). This flag is reset by the CPU after the Clear Buffer Flag (F11.5) is set to indicate that the data has been read by the program.
  • Page 246 D320 PLC User's Manual F11.14 RESERVED This flag is not currently defined for communications and should not be used or referenced. F11.15 ENABLE AUTOMATIC CRC UDCP Mode. The CPU is capable of automatically generating a CRC-16 checksum on communications sent and received. When this flag is turned on, the CPU automatically calculates and appends a CRC-16 checksum to the transmit data stored in the Transmit Data Buffer.
  • Page 247: Description Of Operation - Modbus Rtu Mode

    MODBUS message is directly mapped to the absolute memory address in the D320 PLC. No distinction is made between the memory location of coils, inputs, holding registers, or input registers with regard to the address being requested. For example, a MODBUS Read Coil request from address 0 will reply with a single bit from D320 absolute address 0, and the value of contact R0.0...
  • Page 248: Description Of Operation - Udcp Mode

    On. The second example is an application demonstrating the use of the UDCP Mode to allow the D320 PLC to act as a master to a network of D50 PLC’s.
  • Page 249: Example 1 - Printing An Error Message From An Input

    Example 1 – Printing an Error Message from an Input As described above, sending a message out of the COM2 port on the D320 PLC is a very simple procedure. This example illustrates how to send a text message out of COM2 whenever an input condition comes true.
  • Page 250: Example 2 - D320 Master On D50 Network

    One of the special features of the UDCP Mode is the ability to act as a Master on a network of Cutler- Hammer D50, D300 and/or D320 PLC slaves. Using the Binary mode of communications, in conjunction with the Automatic CRC generation, the second port on the D320 can be programmed to transmit and receive messages to a network of PLC’s using the D50/D300/D320 standard program...
  • Page 251 Appendix C: COM2 UDCP Specification CALL Rung 3: F11.0 F11.4 M0.0 This rung handles the A=K0 SL=0 Query message. If no message is currently active, it starts the process by creating the Query, F11.0 setting the Send Request bit (F11.0), and starting a Timeout timer.
  • Page 252 D320 PLC User's Manual TC65 M0.1 F11.5 Rung 6: This rung checks the 3 second timer started after the Response Request M0.1 message was sent. If the timer times out, it increments an error counter (K2), and restarts communications. D=K2...
  • Page 253 Appendix C: COM2 UDCP Specification Rung 10: Subroutine 1 creates the SL=1 Response Request. F0.15 Rung 11: The Response Request is D=SR298 placed in the Send buffer, S=$0301 SR298 to SR300. The message data to send is: 010300010000 which translates to: Perform the previously D=SR299 requested Write operation.
  • Page 254 D320 PLC User's Manual Rung 16: This rung checks for the A=SR335 A=K0 D=K0 last Response from B=$0184 Station #3. When received, it resets communications back to the initial step. M0.1 Rung 17: End of Subroutine 10.
  • Page 255 Index Index About This Manual ii DABS 71, 111 Absolute address designation 53 DADC 71, 107 ABS 71, 111 DADCB 71, 107 AC sensor 35 DADD 71, 102, 107 Accessories 13 DADDB 71, 102, 107 ADC 71, 107 DAND 72, 112 ADCB 71, 107 DBCD 73, 124 ADD 71, 102...
  • Page 256 D320 PLC User's Manual Leakage current 38 LET 70, 78, 79, 99 Emergency stop circuit 24 Logic instructions 72, 112 ENCO 73, 127 END 77, 153 Environment 176 Error mode 47 M3.5 39 External fuse 38 Maintenance 177 Malfunctions 5...
  • Page 257 Index STR DFN 68, 85 STR DIF 68, 85 RC 74, 134 SUB 71, 104 RCT 69, 88, 91, 93, 94 SUBB 71, 104 READ 77, 154, 158 Substitution, increment/decrement instructions 70, Real-time clock (RTC) 3, 61 RECV 77, 160 SUM 74, 133 RECVB 77, 162 Support services iii...
  • Page 258 D320 PLC User's Manual...

Table of Contents