Home

D320 PLC User`s Manual

image

Contents

1. e o Pees eel el B ele le slels Tele le eee B le H is is p nd de mie Ope Cem Uem Oe U E NI E D O iB HE us i Unacceptable Horizontal mounting O e o Unacceptable Vertical mounting Avoid installation over heat generating equipment such as heaters transformers and power resistors Avoid radiation noise by leaving a minimum distance of 4 inches 100 mm from the surface of each unit to the power cable and the noise generating device motor starter solenoid etc Chapter 4 Installation and Wiring 27 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 e To prevent overheating e Foreasy replacement and wiring of the unit When using a link module leave additional space at the bottom of the unit e Leave 3 inches
2. jo s Cod C Cr 3 slot 5 slot Backplane Backplane 8 slot Backplane Chapter 2 System Configuration D320 PLC Product List CPU Name Catalog Product Description Remarks CPU D320CPU320 24K Words 0 2 us instruction 8 loop PID Realtime Clock 2 communications ports Backplanes Name Catalog Product Description Remarks D320RAK03B 3 slot type Base Backplane D320RAKO05B 5 slot type D320RAK08B 8 slot type Expansion D320RAKO5E 5 slot type Backplane D320RAKO8E 8 slot type Power Supplies Name Catalog Product Description Remarks Power Supply D320PSU230 110 220 VAC input 5 V 4 0 A 24 V 0 8 A D320PSU24DC 24 VDC input 5 V 6 0 A 10 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 D320DIM1623A 200 to 240 VAC 8 points common 32 point D320DIM3224D 12 to 24 VDC 20 pin connector x 2 Requires Adapter 16 points common sink or source Cables D320DOM1600R RELAY output 250 V 3 A 8 points 5 A common 46 point D320DOM 1600V RELAY output 250 V 3A Pn 8 points 5 A
3. Instruction Mnemonic Bit Exclusive OR Operation Range XOR Bit exclusive OR operation LI Bit DXOR E Word E Double words Ladder Process S1 and S2 in bit exclusive OR operation and store the result in D 1 2 D 0 0 0 0 1 1 1 0 1 1 1 0 Description 1 Process S1 and S2 word double word by bit exclusive OR operation and store the result 2 in D For example S1 00FF hex S2 3333 hex D 33CC hex 1 0 0 JO oJo o 0 0 1 1j 1 1 1 1 1 1 XOR Exclusive OR S2 OJ Of 1 1 0 0 1 1 0 0 41 1 0 0 1 1 me ee lt b ee L2 TEn p olo i sfo olala olol T Jo o This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results Initial conditions WO 00FF W1 3333 W2 XXXX Operation results WO 00FF W1 3333 W2 33CC Chapter 6 Instructions 115 Instruction Mnemonic Bit Exclusive NOR Operation Range XNR Bit exclusive OR NOT operation LI Bit DXNR E Word E Double words Ladder Description Process S1 and S2 in bit exclusive OR NOT operation and store the result in D 1 S2 D 0 0 1 0 1 0 1 0 0 1 1 1 Process S1 and S2 word double word by bit exclusive OR NOT operation and store the
4. m H H H mm M g g Q L g g g g 4 75 in 2 120 mm ES Slot type Dimension A B 5 Slot 13 0 in 330 mm 12 4 in 315 mm 8 Slot 17 15 in 435 mm 16 55 in 420 mm 196 D320 PLC User s Manual Power Supply Module Dimensions 4 45 in 113 mm i gt 2 1 in 53 mm A A l9 mU IL ES I stri RDI e 5 5 95 in ES 150 mm e K Ey KA Rd amp 9 E Hl rn Vv CPU and Remote I O Slave Module Dimensions 4 45 in 113 mm 2 1 in 53 mm 2 1 in 63 mm gt 1 t o i Oe uses Pe
5. F12 8 RO 0 LET PI D SR298 Ml S 4B41 LET D SR299 S 5241 LET D SR300 S 0D4C LET D SR370 S 6 F11 0 Rung 1 This rung initializes the port and communications program by F11 3 Enable End Code F12 8 UDCP Mode Rung 2 When input 0 RO 0 is first triggered the ALARM message is loaded into the Send buffer SR298 to SR301 Then the Send Request flag F11 0 is set to request the message be sent out by the PLC 238 D320 PLC User s Manual 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 loader port protocol The following program illustrates this technique In the program a single word of data is continuously transmitted from the D320 master PLC to a single D50 slave node The message to perform this Write Word s function is created using the open protocol information available in Appendix A The protocol information is also available in the D50 Hardware Manual catalog number D508A122 Ladder Program n ou wo a ou a N o o Q e
6. Le _I L c or MO00 0 M000 1 O00 at pese _ OUT M000 0 L PF M000 1 Contact M000 0 is On only when R000 1 is On and R000 2 is Off M000 0 is Off for all other cases 82 D320 PLC User s Manual Instruction Mnemonic Parallel Circuit Range OR Parallel connection E Bit ORN L1 Word L1 Double words Ladder OR NO normally open contact parallel connection lt ORN NC normally closed contact parallel connection Description 1 OR and ORN OR NOT indicate parallel connection of each contact 2 The number of ORs and ORNs used within a branch is unlimited 1 OUT Example Program Expression Time Chart R000 1 MO000 1 OUT R000 1 R000 2 R000 2 LL TT ee R000 0 T LOCS m Contact M000 1 is On if contact R000 1 is On or contact R000 2 is Off Chapter 6 Instructions 83 Instruction Mnemonic Output Range OUT Relay output W Bit SET On output L1 Word RST Off output L1 Double words Ladder 00 OUT Relay coil turns On or Off based on the state of the input conditions set _ __ SET Relay coil turns On when the input conditions are true R RST Relay coil turns Off when the input conditions are true Description For an OUT instruction you cannot use the same address twice OUT SET and RST instructions must be connected to the right bus and not in the
7. effective countermeasures Make the proper noise countermeasures environment comply with the Make the environment comply with the conditions set in Chapter 6 END Chapter 7 Testing and Troubleshooting 177 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 System Operation Symptom Expected Cause Troubleshooting Power supply LED will not illuminate Blown fuse Replace the fuse Power supply fuse blows frequently Short circuit Defective part Replace the power supply Run LED will not illuminate Program errors Correct the program Power line defect Replace the CPU module Output will not turn to On state during Run Short or open circuit Replace the CPU module I O Modules above a certain address will not operate I O bus error Replace the backplane Not all points on an I O module operate properly I O bus error Replace the backplane 178 Input Module D320 PLC User s Manual Symptom Expected Cause Troubleshooting No inputs on an input module will turn On L
8. Description 1 Every rung in the ladder program begins with either a STR or STN 2 Every rung will contain one or more contacts 3 Everyrung will end in one or more output coils or application instructions 4 When programming a ladder with NO and NC contacts GPC will automatically use the proper contact instruction STR STN AND ANN OR ORN R000 2 R004 2 OUT Start of circuit R000 2 R000 3 R000 3 R005 2 a OUT End of circuit R004 2 R005 2 Example Program Expression Time Chart R000 0 M000 0 0004 1 jit M0004 l L R000 1 M000 1 7 OUT R000 1 ee Mo00 2 Mooo 1 p gt OUT M000 2 b M000 0 has the same logic as R000 0 M000 1 M000 2 have the opposite logic as R000 1 Chapter 6 Instructions 81 Instruction Mnemonic Series Connection Range AND Series connection E Bit ANN O Word ADN O Double words Ladder AND NO normally open contact series connection Vyr ANN NC normally closed contact series connection Description 1 AND and ADN AND NOT indicate a series connection of each contact 2 The number of ANDs and ADNs used within one branch rung is unlimited R000 3 R000 4 M100 15 1 l OUT 3 M100 15 is On only when contact R000 3 is On and contact R000 4 is Off M100 15 is Off for all other cases Example Program Expression Time Chart R000 1 R000 2 M000 0 R0001
9. EXAMPLE write WORD K000 K063 Number Of Byte For Information BASE K000 0140 LOW BASE HIGH receiving frame i 2 6 lower byte K i receiving frame i 2 7 upper byte K i j if communication 0 printf WRITE K0000 K0063 OK n else printf communication error n receiving frame 2 4 EXAMPLE write WORD K064 K0127 receiving frame 3 130 Number Of Byte For Information receiving frame 4 0x80 BASE K000 0180 LOW receiving frame 5 1 BASE HIGH for i 0 i lt 63 i 1 receiving frame i 2 6 lower byte K i 64 receiving frame i 2 7 upper byte K 1 64 if communication 0 printf WRITE K0064 K0127 OK n else printf communication error n Sends a function code requesting to read the M area and stores the received data in the buffer Writing Function of the K Register Uses the communication function code 4 writing N consecutive words to store the specified value in the K000 to K063 word Note Abs address of KO 0x0140 Writing Function of the K Register Uses the communication function code 4 writing N consecutive words to store the specified value in the K064 to K127 word Note Abs address of K64 0x0180 Appendix B PID Loop Control 217 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 th
10. Pulse RO 7 Reset R0 5 Output K1 14 Output K1 15 0 Output K2 0 Output K2 1 98 D320 PLC User s Manual Comparison Instruction Details Instruction Mnemonic Comparing the Value Range A B Ais equal to B LI Bit lt gt A lt gt B Ais not equal to B gt A gt B Ais greater than B B Word gt A gt B A is greater than or equal to B lt A lt B Ais less than or equal to B E Double words A B Ais less than B A or B Constant value 0 to 65 535 or a word address R L M K W PV SV SR D is displayed when double words are input When using GPCS to program change the mode to double Ctrl T and then enter the comparison command Description 1 The comparison functions as a contact whose On Off state is determined by the result of the comparison of A and B If the comparison is true the state is On 2 Each comparison instruction can be used with the STR AND and OR instructions GPC will automatically use the correct instruction 3 Double word comparison instructions can process up to 32 bits of data 0 to 4 294 295 Example Program Expression Time Chart R7 0 R8 0 M51 K12 RO 4 RO 5 RO 6 H Chapter 6 Instructions 99 Substitution Increment Decrement Instruction Details Instruction Mnemonic Substitution Formula Range LET Direct sub
11. Disable Interrupt Initialization of USART Chip 8250 if port_number 5 1 outportb PORTADD 0x0B 0x80 Set of DLAB 1 outportb PORTADD 0x09 0x00 Set of High Byte DIVISOR outportb PORTADD 0x08 DIVISOR Set of Low Byte DIVISOR outportb PORTADD 0x0B 0x03 parity None Stop 1 Length 8 Processing communication of Read amp Write for printf nPLC ID CPU ID scanf 96d amp PlcID if PlcID lt 256 variables 2 Using the communication function codes reads the data of the M field reads the word values of the MO to M127 area and stores them in the KO to K127 word area The K registers are the retentive registers 3 Uses the communication code to read the data of the K area 4 Compares the values of the M area and the values of the K area and indicates OK when the values are the same Beginning of the main program Select the port of the peripheral device for the communication Serial 9 PIN 25PIN Parallel GPU 300 parallel port Select board rate 9600 bps max 4800 bps 2400 bps Set the communication environment delay time for the selected ports GPC 300 card Setting 8255chip setting Uses the communication card that is connected and sets the environment according to the PLC communication spec so that communication is possible Not currently offered by Cutler Hammer CPU ID Input PLC ID 0 to 255
12. BOOL sending occurring void BOOL receiving occurring void void Crcl6 unsigned int void Job void unsigned int communication void void Mword reading void void Kword writing void This program was written in Borland C It uses the peripheral device PC to read the M000 to M127 words and stores them in the K000 to K127 and then compares the two registry values and indicates the results on the screen using the OK or the FAIL notation The user may read or manipulate the various communication function codes and the information sent to control the PLC in various ways This program consists of a header the main program and various functions The buffers and variables needed to store the communication data are set as global variables so that the main and various other functions may reference them By using the COMI and COM2 ports of the computer serial communication is possible By using the GPU 300 card parallel communication is also enabled NOTE The GPU 300 card is not currently offered by Cutler Hammer The Qs QAs RRs Rs are handled in the job functions If there are communication errors or a frame breakdown retry 3 times then issue a communication error The procedure of the communication according to the JobID is 1 Q sending 2 QA receiving 3 RR sending 4 R receiving When an error occurs in a frame a retransmission should be made Major operations of the program 1 Adj
13. D W1607 S 0 LET D W1608 S 500 LET D W1609 S 30 LET D W1610 S 500 LET D W1611 S 0 LET D W1612 S 11 LET D W1613 S 10 LET D W1614 S 2200 F14 0 Q 227 Rung 5 Set the initial values Current high and low for the Output Control Variable Rung 6 Set the initial values for the Proportional Integral and Derivative terms of the PID Loop equation Rung 7 Set the initial values for feedforward bias sample time deadband and manual mode output value Rung 8 Enable PID Loop 1 by turning On flag F14 0 228 D320 PLC User s Manual LET D R003 LET D W1602 S R007 LET D R003 S W1604 Rung 9 Initialize Analog Output value to 0 Rung 10 Use Analog Input 0 as Process variable Rung 11 Set the Analog Output to the PID Control Output value Appendix C COM2 UDCP Specification 229 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 D320 PLC User s Manual Overview This appendix describes in detail the user defined communications protocols supported by
14. e Cabling that is strung from pole to pole in free space is an antenna for lightning When possible bury the cable underground The earth acts like a shield and absorbs most if not all of the lightning induced noise signals before they are able to reach the cable 188 D320 PLC User s Manual Shielding Cabling e 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 Use shield wires Ground ground resistance less than 100 Q e Separate the input and output module wiring and power circuit cables Make sure to properly ground the shields of each cable directly to ground Do not create a daisy chain of ground jumpers over several feet and then pigtail one end lead to ground This method allows multiple ground current paths to exist and can induce noise Switching Noise Crosstalk e The noise caused by the On Off switching of the relay output module especially on heavy loads could affect the CPU module and the communications module If possible avoid installing the relay output module next to the CPU or the communication module CCU SDU link modules etc Relay output module CCU or SDU module etc Communication module e Do not use the AC power input to the PLC power supply as the input signal for the AC input module The waveform could be
15. 1 F1 8 RC Reset Carry Reset carry bit F1 8 to 0 0 gt F1 8 CC Complement Carry GLL Reverse carry bit F1 8 F1 8 gt F1 8 1 gt 0 0 p 1 75 Chapter 6 Instructions Transfer Instructions Mnemonic Command Word Double Word Description LDR Load D lt Sr LDR DLDR Store value at absolute address Sr in DLDR D D D Sr Sr Register Absolute Value Address Sr STO Store D lt Sr STO DSTO Store Sr in register at absolute DSTO Srs ME address D Value Address Value 9 N D MOV Move Mov ron Sr 1 0 1 0 1 0 1 0 Ns Sr 0 0 0 01 1 1 1 SHR oo 1 1 1 1 0 0 0 0 Ns 3 Do ux 1 0 1 0 1 0 1 0 D 1 0 0 01011 1 1 D 2 1 1 1 1 0 0 0 0 FMOV Fill Move FMOV Repeatedly copy the value V Ns D 5 times to words starting at D ae Voc V value 1 0 1 0 1 0 1 0 Ns 4 B ua 1 0 110 1 0 1 0 D 1 ow 1 0 110 1 0 1 0 D 2 1 0 110 1 0 1 0 D 3 1 0 110 1 0 1 0 BMOV Bit Move BMOV Move Ns bits from bit address Sb to Pom bit address Db Ns s Sb ola Hekleo If Ns 4 ra Db ohoj ojo BFMV Bit Fill Move BFMV Repeatedly copy the bit value V N ES times to bit address D
16. Timer Counter TC0 255 The table below gives the timer counter Set Value and Present Value for each inherent address Ch SV PV Ch SV PV Ch SV PV 0 W2048 W2304 40 W2088 W2344 80 W2128 W2384 1 W2049 W2305 41 W2089 W2345 81 W2129 W2385 2 W2050 W2306 42 W2090 W2346 82 W2130 W2386 3 W2051 W2307 43 W2091 W2347 83 W2131 W2387 4 W2052 W2308 44 W2092 W2348 84 W2132 W2388 5 W2053 W2309 45 W2093 W2349 85 W2133 W2389 6 W2054 W2310 46 W2094 W2350 86 W2134 W2390 7 W2055 W2311 47 W2095 W2351 87 W2135 W2391 8 W2056 W2312 48 W2096 W2352 88 W2136 W2392 9 W2057 W2313 49 W2097 W2353 89 W2137 W2393 10 W2058 W2314 50 W2098 W2354 90 W2138 W2394 11 W2059 W2315 51 W2099 W2355 91 W2139 W2395 12 W2060 W2316 52 W2100 W2356 92 W2140 W2396 13 W2061 W2317 53 W2101 W2357 93 W2141 W2397 14 W2062 W2318 54 W2102 W2358 94 W2142 W2398 15 W2063 W2319 55 W2103 W2359 95 W2143 W2399 16 W2064 W2320 56 W2104 W2360 96 W2144 W2400 17 W2065 W2321 57 W2105 W2361 97 W2145 W2401 18 W2066 W2322 58 W2106 W2362 98 W2146 W2402 19 W2067 W2323 59 W2107 W2363 99 W2147 W2403 20 W2068 W2324 60 W2108 W2364
17. UDCP Mode In the ASCII mode of communications it is possible to define an end code to signal the end of a message Setting this flag enables the End Code mode of operation When set the CPU will look for the End Code SR373 on any message being received When the End Code is received the CPU stops storing the incoming message sets the Receive Data Length SR371 and sets the Message Received Flag F11 4 Appendix C COM2 UDCP Specification 233 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 Until this flag is reset no new data can be received F11 5 CLEAR RECEIVE BUFFER UDCP Mode This flag is set by the user program to indicate to the CPU that the received data has been read When this flag is set the Message Received Flag F11 4 is reset and the data is cleared from the Receive Data Buffer SR334 SR369 Fll 6 PORT OVERRUN ERROR When an error occurs on the Receive port e g more than 72 bytes are received this flag is set to signal that an overrun error has occurred The flag will remain set until the user program clears it F11 7 RECEIVE FAILURE This flag is set whenever an error occurs in the received message e g bad
18. W2303 SV255 SV is Set Value PV is Present Value Present Value W2304 PV000 to W2559 PV255 SV can hold values from 0 to 65535 Data Word W0000 to W2047 Word value memory area Used for tables data storage and math operations Cannot be designated with a bit System Register SROO0 to SR511 Special internal data area for CPU status and RTC Expression Example Bit number 2 digits range is 0 to 15 Word number e When used with bit number 3 digits 000 to 127 are used e When used for word number only express in 4 digits 0000 to 3071 Register Type e R L M K F or W indicates address type e The W memory contains the character area W0000 to W2047 the timer Set Value area W2048 to W2303 SV000 to SV255 the timer Present Value area W2304 to W2559 PV000 to PV255 and the System Register area W2560 to W3071 SR000 to SR511 Note The basic contact and coil instructions require a bit designation and use the 3 2 bit address format Comparison and application instructions most often use word parameters and are expressed using the 4 digit word address 52 D320 PLC User s Manual Double Word Address Designation e 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 d
19. 88 91 93 94 READ 77 154 158 Real time clock RTC 3 61 RECV 77 160 RECVB 77 162 Register 49 Repeated response 201 Response R 200 Response request RR 200 RET 76 147 148 RETI 76 149 RLC 72 116 117 118 RMRD 77 158 RMWR 77 159 ROL 72 118 ROR 72 120 Rotation instructions 72 116 RRC 72 117 120 RS232 19 44 RS485 19 44 RST 68 83 Run mode 47 S SBC 71 109 SBCB 71 109 SBR 76 147 148 SC 74 134 Scan time 46 142 149 152 SEG 73 126 SEND 77 161 SENDB 77 163 SET 68 83 Shielding 184 SHL 72 121 SHR 72 123 Special instructions 77 150 Special internal address 55 Specifications 17 SR 69 88 96 98 131 SST 69 88 90 91 93 94 STN 68 80 86 STO 75 137 Stop mode 47 152 STR 68 70 80 85 86 98 Index 245 STR DFN 68 85 STR DIF 68 85 SUB 71 104 SUBB 71 104 Substitution increment decrement instructions 70 99 SUM 74 133 Support services iii Surge absorber 187 Switches 21 T Table of contents v Terminal strip 39 Terminology 46 Testing 165 168 TIM 69 88 90 91 93 94 Timer counter 63 91 93 94 96 Timer counter SR instructions 69 88 TOF 69 88 90 91 93 94 Transfer instructions 75 135 Troubleshooting 165 177 192 U UC 69 88 91 93 94 UDC 69 88 91 93 94 UDCP 233 234 236 238 UNI 73 129 V Voltage spikes 187 WwW WAT 77 152 Watchdog timer 42 152 WinGPC 4 47 Wiring 24 31 39 40 43
20. ASCII code 42 the value 4241 is placed into SR298 The two example programs given below illustrate the usage of the UDCP Mode on the D320 PLC The first example is a very basic example that demonstrates a simple ASCII Transmit function for printing out a pre defined error message when an input turns 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 Appendix C COM2 UDCP Specification 237 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 For this example input R0 0 is defined as an error condition input When it turns On the D320 PLC will print out the simple text string ALARM on COM2 The procedure is as follows 1 Set the COM2 port into UDCP mode Also for this example the carriage return CR end code will be used 2 When the input R0 0 turns On place the text string ALARM into the Send buffer The string is created using the ASCII codes for each character as follows HAN 41 L CAB A 41 R 9 52 M 4C CR 0D 3 Set the Request Transmission flag F11 0 to send the message Ladder Program F1 0 F11 3
21. Appendix A D320 PLC Communication Protocol 213 1 Mword reading Kword writing else exit 0 j void RR_occurring void receiving_frame 2 0 receiving_frame 3 1 receiving_frame 4 0 void Trsport unsigned int data if port number 5 outportb PORTADD data else outportb PORTADD 0x08 data unsigned int Recport void unsigned int dt if port_number 5 dt inportb PORTADD else dt inportb PORTADD 0x08 return dt BOOL sending occurring void 1 BOOL tf if port number 5 tf inportb PORTADD 0x02 amp 0x80 0x80 else tf inportb PORTADD 0x0D amp 0x20 0x20 return tf BOOL receiving occurring void 1 BOOL rf if port number 5 rf inportb PORTADD 0x02 amp 0x20 0x20 else rf inportb PORTADD 0x0D amp 0x01 0x01 return rf void Crcl6 unsigned int data unsigned int i Crc Crc data amp Ox00FF for i 0 i lt 7 i 1 if Cre amp 0x0001 0x0001 Cre Cre gt gt 1 0xA001 0x0001 mult nominal expression else Crc Cre gt gt 1 j void Job void JobID 0 Change to sending Mode for Serial port JobID 1 Transmit sending Frame f JobID 2 Change to receiving Mode for Serial port JobID 3 Address Polling of ACK from CPU JobID 4 Receive ACK from CPU JobID 5 Change to sending Mode for Serial port JobID 6 Transmit RR Frame FN JobID 7 Change to receiving Mode for
22. Be certain to save the program before clearing the PLC program so it is not lost Chapter 7 Testing and Troubleshooting 173 Error Check Error LED is illurninated FO 0 1 System error pel Resupply power F0 1 1 System ROM eror gt Resupply the power of the following bit es FO 2 1 addresses in the On state gt System RAM error FO O FO 1 FO 2 FO 3 Resupply the power FO 4 FO 5 FO 6 FO 7 POS ANE User prog am error EM Download the program again No FO 4 1 Program syntax error gt Correct program and download again FO 5 1 Module address error m Corect program and resupply the power F0 6 1 Module change error m Check module and resupply the power FO 7 1 Unidentified module installed p Check module type and resupply the power No of the above bit addresses in F Yes Beri uM the On state a resupply the power Is bit F1 7 in Is the Error LED Yes illuminated Replace the CPU module Replace the CPU module 174 D320 PLC User s Manual l 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 RO and a digital output module is located in slot 1 R1 This flow chart is ba
23. Cre Cre gt gt 1 0xA001 else Crc Cre gt gt 1 204 D320 PLC User s Manual The Structure of the Communications Frame Query and Response Frame Length of the information field byte CRC 16 code 1 255 1 255 byte 2 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 For the query Q and the response request RR the SA is the address of the peripheral device and the DA is the address of the PLC to which the message is being sent For the query answer QA and the response R the PLC becomes the sender of the message and so the PLC address is the SA and the peripheral device s address is the DA Query Acknowledge Frame Constant Response Request Frame Constant Response Frame for an Error Error 1 Wrong communication function code Error 2 Out of range Error 3 Wrong frame structure Error 4 CPU did not perform Error 5 Frame too long Appendix A D320 PLC Communication Protocol 205 Read Bits The following can be read e Bits stored in the absolute address R L M K or F e N consecutive bit contents On Off Query Q frame Length of Number of bits to be read information bit Absolute bit address Function Code address of first bit to read For example K127 12 address K127 s 12th bit Peripheral Device Absolute bit addres
24. D1 W101 613 Ey 25 88 17 09 D2 W102 614 E you get from input es module R001 word in EB sequence into W100 T gs W199 See the following lel D98 W198 710 Eg eme D99 W199 711 EE a 138 D320 PLC User s Manual Example Program Expression Operation Results RO 0 INC Initial conditions W0 611 RO 0 bit R1 word process measurement WO 611 Store in Store in Store in Store in Store in W100 W101 W102 W198 W199 Chapter 6 Instructions 139 Instruction Mnemonic Duplicate Word Duplicate the Range Same Word MOV MOV Copy a block of words O Bit FMOV FMOV Fill a block of words with E Word the same value L1 Double words Ladder MOV Copy Ns words from Sr to D FMOV Repeatedly copy the value V Ns times to words starting at register address D Description 1 MOV Copy a total of Ns registers from registers starting at Sr word into registers starting at D This instruction is used for mass duplication of blocks of registers 2 FMOV Copy the constant number V Ns times into registers starting at D This instruction is useful for initializing the internal and external memory of certain areas when initializing a program Sr is 1 0 1 0 1 0 1 0 V value 1 0 110 1 0 1 0 Sr 1 0 0 0 0 1 1 1 Ns 4 Sr2 11111 1 0 0 0 0 D 1lololtloltlo MOV Ns 3 FM
25. Example Program Expression Operation Results ane Initial condition M0000 OFOF M0001 SOFOF M0002 SOFOF Operation results MO 8787 M1 C3C3 M2 C3C3 0 O O O 1 afi 1 0 0j0 o 1 1 1 1 MOCOCOCCCO C Cx p gt Lilololofols T lolo o oT Ti 1 1 0 0 o o 1 1 1 1 o o o on 118 D320 PLC User s Manual Instruction Mnemonic Rotate to the Left Range ROL Rotate the specified address to LI Bit DROL the left with the carry flag B Word E Double words Ladder ROL D Register address 7 N N Number of bits to rotate MSB 15 1413121110 987654321 0 LSB am Eeer kiek ee Description 1 Order Shift N bits to the left from low order bit to high order bit including the carry bit The MSB most significant bit moves to the carry bit F1 8 nput F1 8 carry bit in the LSB least significant bit 2 This instruction is different from the RLC instruction because it sends the MSB to the carry bit and the carry bit moves to the LSB The input to the LSB can be changed by setting or clearing the carry bit 3 The D register is either a word or a double word For ROL word N 0 to 15 For DROL double word N 0 to 31 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Chapter 6 Instructions 119 Example Program Expression Opera
26. X 163 Chapter 7 Testing And Troubleshooting 165 Test PLE CAULLOMS 0259 24 026 20 recs deett oit tune Ne sets ilb eese tote aes 166 System Checks eene ee ORENSE UR IE DTI Re S Ge HL SU ened 166 Testing Proced res edente ien indie Ide I dere te de i I eS ET 168 Correcting Errors d ee eere B RI e p rev I I eet eae 170 System Check 3 eee rede Ie CUIRE UL E ERR RERO ene 170 Power Supply Check ket eR ER EIE HERE PAESE TERES CLER RE E RUE 171 Run Check 5 endende IN ani IE 172 Error Check s zn ie EH RE RE UR TRU EUER OE e ee OE E EORR ER EREUE 173 TWO CME dc M M 174 External Environment Check i eet est e Heap e URL e EUER 176 Troubleshooting Maintenance and Inspection Tables essere 177 Periodic Inspection and Preventive Maintenance cccccsseessesscesscesceseceecesecesecsecsaecsaecaeeeaeeeaeeeeeseeeeeeeees 180 Chapter 8 Troubleshooting Noise Problems 181 Noise OCcUITellCe 4 S ete date eria erba poe tdem ore 182 Types of NOISe c s oreet t ette it t leue desired ata a dei 182 Electrical Noise Fundamental Definitions sess ener ener nnne nnns 182 Sources OF NOIse men inepta ete dept e a e Agree ien e uee es 183 Advised Installation Practices tet eee nte eerte e e re A SER DECERTARE UNS EAETH 184 Shield the BEC nomen dep Ee IRE cade Rede mee re dama seed 184 Proper Cable Selection 36 d
27. common varistor protection D320DOM1624D TR output NPN 12 to 24 VDC 0 6 A Output 8 points 4 A common Module D320DOM1615A SSR output 100 to 220 VAC 0 5 A 8 points 2 A common D320DOM3200R RELAY output 250 V 1A Requires Adapter 32 point 20 pin connector x 2 16 points common Cables D320DOM3224D TR output NPN 12 to 24 VDC 0 4 A Requires Adapter 20 pin connector x 2 16 points common Cables Note 32 point modules require 20 pin cable connection for breakout to standard screw terminals Refer to Accessories Table for additional information Analog and Intelligent Modules Chapter 2 System Configuration 11 Name Catalog Product Description Remarks 8 Ch 16 bit A D converter 10 V Oto 5 V D320AIM810V Conversion speed 1 25 ms Ch Analog Input Resolution 1 20 000 1 mV 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 uA 4 Ch voltage output 14 bit D A converter 10 V D320AOM410V 5V 0to 10V Oto 5 V Analog Output Resolution 1 mV 1 bit 4 Ch 4 Ch current output 14 bit D A converter 4 to 20 mA D320A0M420C Conversion speed 2 5 ms Ch Resolution 4 uA 1 bit RTD Input D320RTD800 8 Ch 24 bit X A A D converter 3 wire 0 1 C Pt 100 JPt 100 60 ms Ch Thermocouple D320TC800 8 Ch 24 bit X A A D converter 0 1 C type Input B R S N K E J T 80 ms Ch High speed D320HSC100 1 Ch 100 kH
28. e The sender of the message calculates and attaches the CRC when it generates and sends the message The receiver should also calculate the CRC from the data of the message and compare the calculated value to the CRC that was sent If the calculated CRC does not match the CRC received an error has occurred in the message during transmission CRC Calculation Range CRC Calculation Range The following subroutines illustrate the program code required to calculate the CRC for a message The initial value of the CRC CRC Sum is set to 65535 SFFFF Then one of these subroutines would be called once for each byte data of the CRC calculation range shown above CRC 16 Calculation Subroutine BASIC CRC_Sum CRC 16 reserve code after the calculation CRC content to be sent at end of message Data CRC 16 Data input to be calculated Byte Data from message 1000 CRC_Sum CRC_Sum XOR Data 1010 FOR F 1 to 8 1020 CARRY CRC Sum AND 1 1030 CRC Sum CRC Sum SHR 1 1040 IF CARRY 1 THEN CRC Sum XOR 0A001H 1050 NEXTI 1060 RETURN CRC 16 Calculation Subroutine PASCAL Procedure CRC16 Data Byte Vari Byte Begin CRC Sum CRC Sum x or Data fori 1 to 8do begin if CRC_Sum and 1 1 then CRC_Sum CRC_Sum shr 1 xor A001 else CRC_Sum CRC Sum shr 1 end End CRC 16 Calculation Subroutine C void Crcl6 unsigned int Data unsigned int i Crc Crc Data amp 0x00FF for i 0 i lt 7 H 1 if Cre amp 0x0001 0x0001
29. hex to the function code sent by the query e The function code of the R message can be used by the peripheral device to verify that the correct Q message has been received by the PLC Communication function notes hexadecimal notations Communication Function Query Function Code Response Function Code Read Bits 01 81 Write Bits 02 82 Read Words 03 83 Write Words 04 84 Read Bits and Words 05 85 Write Bits and Words 06 86 Read Program 07 87 Write Program 08 88 Read Instruction 09 89 Change Instruction 0A 8A Change Parameter 0B 8B Insert Instruction 0C 8C Delete Instruction 0D 8D Find Instruction 0E 8E Find Parameter 0F 8F Delete Section 10 90 No Service 00 00 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 locations See Chapter 5 for memory map Appendix A D320 PLC Communication Protocol 203 Cyclic Redundancy Checking CRC e 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
30. 0 When this occurs execution goes directly the instruction following the NEXT instruction 144 D320 PLC User s Manual Instruction Mnemonic Jump by Pointer Range JMP JMP Jump by pointer LI Bit LBL LBL Specify the pointer L1 Word O Double words Ladder JMP Jump to the LBL instruction L L 0 to 63 LBL Position jumped to by the JMP instruction Description dt This instruction is used to conditionally perform a set of instructions in the program When the input condition to the JMP instruction is true execution will jump over the following instructions directly to the corresponding LBL label When the input condition is false the instructions following the JMP will be executed normally and no jump occurs 2 The range of L is 0 to 63 allowing 64 jumps to be used 3 The given L label may only be used once in a program It may not be duplicated 4 Fora given JMP with parameter L there MUST be a corresponding LBL with the same L value Also the LBL instruction must come after the JMP instruction in the program If either of these two conditions is not satisfied an error will occur preventing execution of the program 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results When contact RO 0 turns On
31. 0000 LET D SR370 S 5 LET D SR371 S 5 RET SBR SL 10 AND D W10 S1 SR334 S2 00FF LET A SR335 B 0180 E Rung 10 Subroutine 1 creates the Response Request Rung 11 The Response Request is placed in the Send buffer SR298 to SR300 The message data to send is 010300010000 which translates to Perform the previously requested Write operation This message is always the same See Appendix A for a detailed explanation After creating the message the send length is placed in SR370 and the expected receive length is placed in SR371 Rung 12 End of Subroutine 1 Rung 13 Subroutine 10 processes the responses Query Acknowledge Response from the network Rung 14 This rung masks out the Source Address from the received message into W10 Rung 15 This rung checks for the Query Acknowledge from Station 3 When received it proceeds to the next step by incrementing the step counter KO and resetting the internal flag MO O 242 D320 PLC User s Manual A SR335 B 0184 A KO B 1 LET D KO S 0 MO 1 RET Rung 16 This rung checks for the last Response from Station 3 When received it resets communications back to the initial step Rung 17 End of Subroutine
32. 1 the second is 2 and the third is link network 3 3 The RECV instruction can read up to 56 words at a time NRI 1 to 56 4 The RECV instruction can only by executed once in a given scan To prevent reading over the link network more than once per scan place the RECV instruction at the end of the program Example Program Expression Operation Results F33 F3 10 REGY Verify that the first link module has been installed F3 3 I and sent through the first module F3 10 Then from link network 1 station 3 Nt 1 3 register type F address 1 Fr 7 1 read one word and write it to register R2 To 1 R2 Chapter 6 Instructions 161 Instruction Mnemonic Word Data Send Range SEND Word data send command using O Bit link network B Word L1 Double words Ladder SEND Nh Hurabee 1 t03 Read NR5 words from NR6 and write them to link NRx number register network NNI station NN2 register type NN3 aue address NR4 Nt NN1 NN2 To NN3 NR4 Fr NR5 NR6 Description 1 NNI Link network number number NN2 Station number on the link network number NN3 Register type to write number 0 L register 1 M register 2 R register 3 K register 4 T C Setting Value SV 5 T C Present Value PV 6 W register 7 F register NR4 Starting address of the register to write number register NR5 Number of words to write number register NR6 St
33. 1 N using RS485 e Maximum communication delay time 3 sec Communication Protocol Step 1 Query Q Set the network ID number for the PLC to communicate with and send a Q signal from the peripheral device to the PLC Step 2 Query Acknowledge QA A QA signal is sent from the PLC to the peripheral device indicating that the Q signal from the peripheral device was received Step 3 Response Request RR An RR signal goes from the peripheral device to the PLC indicating that the QA signal from the PLC was received and requesting the final data response This signal is sent when Q gt QA is normal Step 4 Response R When the PLC receives the RR from the peripheral device it sends an R signal which gives the results of the original Q signal sent by the peripheral device The communication cycle for one function code ends when the PLC sends the R Appendix A D320 PLC Communication Protocol 201 Step 5 Repeated Response Once the original Q has been sent to the D320 PLC the R message containing the requested data for that query can be repeatedly received by sending only the 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 The peripheral device should al
34. 10 Index A About This Manual ii Absolute address designation 53 ABS 71 111 AC sensor 35 Accessories 13 ADC 71 107 ADCB 71 107 ADD 71 102 ADDB 71 102 Alarm output 42 ANB 68 86 AND DEN 68 85 AND DIF 68 85 AND 68 70 72 80 81 85 98 112 Arithmetic instructions 71 102 B Backplane configuration 7 Backplanes 15 Backup 3 Basic instructions 68 80 BCD 70 71 73 100 101 102 104 105 106 107 109 124 BFMV 75 141 BIN 73 124 Bit conversion instructions 74 131 Block processing instructions 76 142 BMOV 75 141 BNOT 74 131 Brownouts 24 25 BRST 74 131 BSET 74 131 BTST 74 131 C CALL 76 142 147 148 Capacitive load 38 CC 74 134 Communication 158 159 Comparison instructions 52 70 98 CPU 152 CPU operation mode 47 CPU processing 48 Cyclic redundancy checking CRC 203 231 234 Index 243 D DABS 71 111 DADC 71 107 DADCB 71 107 DADD 71 102 107 DADDB 71 102 107 DAND 72 112 DBCD 73 124 DBIN 73 124 DC 69 88 91 93 94 DC sensor 33 DDEC 70 101 DDECB 70 101 DDIV 71 106 DDIVB 71 106 DEC 70 101 DECB 70 101 DECO 73 127 DFOR 76 142 Dimensions 2 193 DINC 70 100 DINCB 70 100 DIS 73 129 DIV 71 106 DIVB 71 106 DLDR 75 135 DLET 70 78 79 99 DMUL 71 105 DMULB 71 105 DNEG 71 111 DNOT 71 111 DOR 72 113 Double word address designation 52 DRLC 72 116 117 DROL 72 118 DROR 72 120 DRRC 72 117 DSBC 71
35. 109 DSBCB 71 109 DSHL 72 121 DSHR 72 123 DSTO 75 137 DSUB 71 104 DSUBB 71 104 DXCHG 73 125 DXNR 72 115 DXOR 72 114 244 D320 PLC User s Manual E Emergency stop circuit 24 ENCO 73 127 END 77 153 Environment 176 Error mode 47 External fuse 38 F Filtering 192 FMOV 75 139 FOR 76 142 143 G GPC 4 47 77 79 80 86 88 98 153 GPC5 4 47 98 Grounding 31 184 H Hexadecimal 46 78 162 163 I O address designation 54 I O configuration 7 I O modules 158 159 NC 70 100 143 NCB 70 100 ductive load 37 189 NPR 77 150 nspection 180 nstallation 23 184 NT 76 149 Internal external address designation 64 Isolation 24 185 J JMP 76 142 144 145 JMPE 76 145 146 JMPS 76 145 146 SS L LBL 76 144 145 LDR 75 135 Leakage current 38 LET 70 78 79 99 Logic instructions 72 112 M3 5 39 Maintenance 177 Malfunctions 5 MCR 68 87 MCS 68 87 Memory 3 51 155 157 Memory map 53 MODBUS 230 231 234 235 Module cover 39 MOV 75 139 MUL 71 105 MULB 71 105 N NEG 71 111 NEXT 76 142 143 Noise 26 182 183 188 NOT 68 71 O Operating ranges 17 OR 68 70 OR DEN 68 85 OR DIF 68 85 ORB 68 86 ORN 68 80 82 OUT 68 83 OUTR 77 150 P Pause mode 47 PID loop control 3 217 218 224 225 Power failures 25 Preface i Preventive Maintenance 180 Q Query Q 200 Query acknowledge QA 200 R RC 74 134 RCT 69
36. 15 The timer counter contact is represented by the TC label followed by three digits The three digits indicate the channel number of the timer counter TC000 to TC255 A word address is composed of a character R L M K W and a four digit number i e W0000 to W2047 Special areas of word memory have alternate designations For example words W2560 to W3071 are also referred to as the System Registers and can be represented as SR0000 to SROS11 The bit address indicates an On 1 or Off 0 state The word address is composed of 16 bits that holds data values of 0 to 65 535 The double word address is composed of 32 bits that holds data values of 0 to 4 294 967 295 Chapter 5 CPU Operation and Memory 51 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 1024 points 64 words Internal Contact M000 0 to M127 15 Internal auxiliary contact memory area 2048 points 128 words Retentive Contact K000 0 to K127 15 Retentive internal auxiliary contact memory area 2048 points 128 words System Flag F000 0 to F015 15 Special internal contact memory area 256 points 16 words Timer Counter TCO000 to TC255 256 channel common use Set Value W2048 SV000 to TC is contact signal or Done bit
37. 44 Word conversion instructions 73 124 WRITE 77 156 159 X XCHG 73 125 XNR 72 115 XOR 72 114 246 D320 PLC User s Manual
38. 7 PLC power Oo O ale gt Load Breaker O AC power 186 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 When the proper device is selected it is best to place the device as close to the PLC power supply connections as possible Below is an example of how to install a filter The chart lists a typical midrange power line filter for reference Triple ground Less than 100 Q of ground resistance For installation and application details refer to the manufacturers manuals Model Name Manufacturer Remarks PQI 3120N12 Superior Electric DANA Used for 120 V power Warner Electric Division PQI 3220N12 Superior Electric DANA Used for 240 V power Warner Electric Division The PQI 3120N12 and PQI 3220N12 come in a NEMA 12 rated enclosure Chapter 8 Troubleshooting Noise Problems 187 Methods of Handling Large Voltage Spikes Such as Lightning Surge Absorber e A surge absorber reduces the electrical shock to the PLC by taking high voltage spikes to ground Attach
39. COM1 Off Off 9600 bps COM2 On Off 19200 bps COM2 Off On 38400 bps COM2 On Off Reserved Resistors COM2 Resistors 1 2 3 switch select communication speed 9600 to 38400 bps D320 CPU Module Communication Specification Connection RS 485 RS 232C Remarks Specification Transfer distance max 4000 ft 1 2 km 50 ft 15 m Transfer speed 38400 19200 9600 COM 1 9600 19200 Dip switch setting COM2 9600 19200 38400 Protocol Half duplex asynchronous polling Parity No parity Stop bit 1 Stop bit Cable type Twisted pair cable Use Shielded cable Program Loaders D320PGM500 GPC5 WinGPC D320PGM500 44 D320 PLC User s Manual Reference e RS232C RS485 common cable diagram D320CBL20 6 feet 2 m e RS232C shared cable wiring diagram D320CBL50 15 feet 5 m D320CBL20 IBM PC computer PLC 9 Pin D sub cable 9 Pin D sub cable female male D320CBL50 2 P eet de 3 3 40 4 L 5 M CES 200 IBM PC computer PLC 25 pin female 9 pin male Chapter 5 CPU Operation and Memory 45 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 e The terminology used in the D320 PLC manual e CPU operation and processing e Internal external address designation e Special function in
40. D320DOM3224D D320CBL32RO Relay OUT 32 points connector harness 5 ft For 1 5 m D320DOM3200R 14 D320 PLC User s Manual D320 PLC I O Configuration Intelligent Module SDU A D D A RTD TC I O Module Power High speed 16 point Supply CPU counter 32 point AC Type 24K words Link module 110 220V 25 x DC Type pe d Backplane Of 3 slot 5 slot 8 slot o6 lo e o o EL LE Lu Module Placement Requirements The power supply and CPU modules have assigned slots Most other modules may be installed in any available slot in any order but there are certain restrictions that may apply The following table gives those limitations Module Type Position of Installation Base System Power Supply Slot to extreme left CPU Module Second slot from left I O Module Any slot to right of CPU Serial Data Unit SDU Any slot to right of CPU Remote O Slave Install in the CPU module position second slot from left Wire Link Module Any slot to right of CPU in the base rack
41. Done Contact TC channel no reset 1 SR Shift Register Shift register Sb Eb M K bit address rot 1 bit shift by each p input Max of bits 256 70 D320 PLC User s Manual Comparison Instructions Mnemonic Command Word Double Word Description STR START Fe De On if A C value and B D value are AND AND B the same OR OR STR lt gt START lt gt x De On if A C value and B D value are AND lt gt AND lt gt lt gt D different lt gt means the same as OR lt gt OR lt gt STR gt START gt X De On if A C value is greater than B D AND gt AND gt gt B value OR gt OR gt STR gt START gt 5 D C On if A C value is greater than or AND gt AND gt gt B gt D equal to B D value OR gt OR gt STR lt START lt me On if A C value is less than or equal AND lt AND lt lt B lt D to B D value OR lt OR lt STR lt START lt x DG On if A C value is less than B D AND lt AND lt lt B value OR lt OR lt Substitution Increment Decrement Instructions Note Application instructions that operate on double words 32 bit are designated with a D in front of the single word instruction For example DINC refers to double word decimal increment DDEC refers to double word decimal decrement etc Mnemonic Command Word Double Word Description LET Let Su
42. Go to the Run check flow chart Go to the Error check flo chart Go to the I O check flow chart Go to the external environment check flow chart Chapter 7 Testing and Troubleshooting 171 Power Supply Check Power supply LED is not illuminated Supply power No mc Yes Is the power supply LED illuminated Is power being supplied Adjust voltage within the voltage within the allowable specified range Yes Is power supply LED illuminated Yes Is power supply LED illuminated Is the Tighten the terrrinal screw or replace the power cable No puc Yes l gt IS power supply LED illuminated cable loose Replace the power supply module END 172 D320 PLC User s Manual Run Check Run LED is not illuminated Is CPU mode switch set at Run Set mode switch to Run Place in Run mode On normal using GPC Is the Error LED illuminated Yes Set the CPU mode switch to Prog Clear the PLC program Set the CPU mode switch to Run Is the Run LED illuminated Check the PLC program again Is the Error LED illuminated Sis Error check fion Wo NE DM Is the Run LED illuminated END Exchange the CPU module
43. Intelligent I O Data Range WRITE Write data to the shared memory O Bit of an intelligent I O unit B Word O Double words Ladder R kim WRITE Read NR3 words from NRS and write them to slot SS d qus Une el NNI module memory address NR2 Fr NR5 RRx register Description 1 NNI Slot number of the intelligent I O module to write to The first slot in the backplane is slot 0 NR2 Starting address to write to on the shared memory of the intelligent I O module number register NR3 Number of words to write number register NRS Starting address of the data to write number register 2 This instruction is used to write data to the shared memory of an intelligent I O module such as the high speed counter SDU module analog module or position control module Refer to the specific intelligent I O module user s manual for detailed instructions on using the WRITE instruction with the given module 3 Ifthe NR5 parameter is a constant value instead of a register address then this constant value will be written to all of the shared memory locations specified This function is useful for initializing the shared memory of an intelligent I O module 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Chapter 6 Instructions 157 Example Program Expression Operation Results ROO ue Reads two words
44. JMP 1 occurs and execution jumps directly to LBL 1 the instructions between the JMP and LBL are not executed When contact RO 1 turns On execution of the program jumps directly from JMP 3 to LBL 3 JMP Chapter 6 Instructions 145 Instruction Mnemonic Jump Range JMPS JMPS Start jump LI Bit JMPE JMPE End jump L1 Word L1 Double words JMPS Jump directly to the corresponding JMPE instruction JMPE Position jumped to by JMPS instruction Description 1 The JMPS and JMPE instruction function identically to the JMP and LBL instructions but do not require the use of a label Additionally the JMPS JMPE pair may be used more than once in a program 2 This instruction is used to conditionally perform a set of instructions in the program When the input condition to the JMPS instruction is true execution will jump over the following instructions directly to the corresponding JMPE When the input condition is false the instructions following the JMPS will be executed normally and no jump occurs 3 Forthe JMPS instruction there MUST be a corresponding JMPE Also the JMPE instruction must come after the JMPS instruction in the program If either of these two conditions is not satisfied an error will occur preventing execution of the program 4 The JMPS JMPE instructions may NOT be nested after each JMPS instruction there must be a JMPE instruction before the next JMPS instruction may be
45. Limit three modules system Chapter 2 System Configuration 15 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 A maximum of 256 control points are available with one backplane This is achieved by using 32 point I O modules with an 8 slot backplane The expansion backplane has two different slot types 5 slot and 8 slot A maximum of three expansion backplanes can be installed in addition to the base backplane A maximum of 1 024 local control points are available This is achieved by using four 8 slot backplanes consisting entirely of 32 point I O modules An additional 1 024 control points 2 048 total maximum are available by using a remote I O system The remote I O is connected with two wire twisted pair cables l 16 point I O 32 point I O configuration configuration 128 point 256 point Expansion cable 9 TT I 256 point 512 point o e e Expansion cable iiy D 384 point 786 point e Expansion cable 512 point 1 024 point 16 D320 PLC User s Manual Chapter 3 Product Specification 17 Product Specification This chapter outlines the environmental conditions for D320 PLC operation and the performance specific
46. Link error Link error information data SR379 SR380 to Reserved System use SR511 60 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 The error lamp also turns On There are two error correction methods Method 1 Find the error in the CPU online mode then correct the program Method 2 Use the syntax checking function then correct the program Word Bit Detail 0 On if the I O number range of bit process instruction is beyond the specified range or designates an external contact output module which is not installed On if the channel number of the timer or the counter exceeds 255 or is duplicated 2 On if the bit or word number in the application program is beyond the specified range or if it designates a module which is not installed 3 On if a word number in the refresh instruction INPR OUTR is beyond the specified range or if it designates a module which is not installed 4 On if an undefined instruction exists 5 On in the event of a user program memory error 6 On in the event of miscellaneous errors 7 On if the user program memory is destroyed 8 On if an external I O module register address is impro
47. Q F11 4 CALL SL 10 F11 5 Rung 1 This rung initializes the port and communications program by F11 13 Set Binary Mode F11 15 Enable CRC F12 8 UDCP Mode Internal contacts MO 0 and MO 1 and internal word KO are used for proper sequencing of the Query and Response messages Rung 2 The Receive Flag F11 4 is continuously checked for an incoming message If detected Subroutine 10 is called to process the message F11 0 F11 4 MO 0 CALL A KO SL 0 B 0 F11 0 S MO 0 S MO 0 TIM CH 64 _ SV 30 F11 0 F11 4 MO 1 CALL A KO SL 1 B 1 F11 0 MO 1 S MO 1 TIM CH 65 HEN SV 30 TC64 MO0 0 F115 fa Emi S MO 0 Q INC D K1 Appendix C COM2 UDCP Specification 239 Rung 3 This rung handles the Query message If no message is currently active it starts the process by creating the Query setting the Send Request bit F11 0 and starting a Timeout timer Rung 4 This rung handles the Response Request message If the Query has been successfully sent and Acknowledged it starts the process by creating the Response Request then setting the Send Request bit F11 0 and starting a Timeout timer Rung 5 This rung checks
48. Scan On contact F1 0 During every consecutive scan the analog input value which comes in through I O register R7 is stored in the PV register W1602 while the CV register W1604 is sent out to the analog output I O register R3 To observe the operation of the PID loop control simply monitor the PID register block W1600 to W1631 paying special attention to the interaction of the PV SP and CV Changing the SP value will cause the PID loop to recalculate on a continuous basis the necessary CV to achieve the desired PV Modification of the Proportional Integral and Derivative terms will modify the reaction speed and stability of the PID process 226 D320 PLC User s Manual F1 0 FMOV D W1600 SZ 256 V 0 F1 0 F14 0 R F14 4 R F14 8 R F14 12 R F15 0 F15 4 R F15 8 R F15 12 S RJ F1 0 LET D SRO08 S 1600 F1 0 LET D W1601 S 1000 LET D w1602 S 0 Rung 1 Initialize the PID Loop Parameter Block W1600 W1631 to 0 s 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 F15 12 Rung 3 Set the Starting Address of the PID Loop Parameter Blocks to W1600 Rung 4 Set the initial values for the Setpoint and Process Variable LET D W1604 S 0 LET D W1606 S 10000 LET
49. Ser RUN QUI 8 Ke II o Bu E 5 95 in OO 7 murus 33 150 mm S a c3 al CPU Module Slave Module Chapter 9 External Dimensions 197 I O Module and Intelligent Module Dimensions 1 35 in 1 35 in 34 5 mm 34 5 mm 4 45 in 113 mm gt ce F i E S E Ht E2 ES 8 p E dn ae ql 5 95 in ES ES d 150 mm E2 CS nn E3 E n EXE l i Ble d n a MI 5 um L8 Integrated Remote I O Drop Dimensions e e
50. Serial port JobID 8 Address Polling of RES from CPU JobID 9 Receive RES from CPU i Read the register value for the M area MO to M127 Store the value for the M area in the K area KO to K127 RR Request Response request function Sends data to the communication port Reads the received data from the communication port Outputs the data when a send event Occurs Inputs the data when a Receive event Occurs CRC Calculation Encodes the communication data in the byte stream When one communication function is complete it is attached to the most recent frame or is compared with the attached CRC to check for data errors Communication sequence functions Job ID 0 4 Q QA Frame handling Job ID 5 9 RA R Frame handling 214 D320 PLC User s Manual JobID 10 Success communication Processing switch JobID case 0 case 5 if port_number 5 1 if port number 4 outportb 0x301 0xFF else outportb PORTADD 0x0C inportb PORTADD 0x0C 0x02 delay sending delay if JobID 5 RR occurring watchdog 0 index 0 sending Index max 5 Crc OxFFFF JobID break case 1 case 6 if receiving occurring data Recport if sending occurring if indexcsending Index max 1 Trsport receiving frame index Crel6 receiving frame index if index 3 if receiving_frame 3 0 sending_Index_max 256 5 else sending_Index_max recei
51. The terminal strip is removed by releasing the screws located at the top and bottom of the terminal strip Be certain to tighten these mounting screws firmly when reattaching the terminal strip after wiring or replacing the I O module Screw Terminal strip 40 D320 PLC User s Manual 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 e D320DIM3224D DC In 32 point e D320DOM3224D TR Out 32 point e D320DOM3200R Relay 32 point The harness cable consists of a 20 pin connector at one end for connection to the I O module and 20 separate open type screw connectors at the other for connecting the field devices The cable is 5 feet in length Product Product Code Product Specification Name D320CBL32IN DC In 32 point connector harness cable 5 feet 1 5 m D320CBL32TO TR Out 32 point connector harness cable 5 feet 1 5 m D320CBL32RO Relay Out 32 point connector harness cable 5 feet 1 5 m Cable ASS Y Connector Module Wiring Fit Cable Connector When using the I O ribbon cables D320CBL32xx for wiring field devices pay careful attention to the I O addressing associated with th
52. VDC type input module Off voltage 2 5 V input impedance 3 kQ DC Input Module I Leakage current of the sensor o Input R Bridge resistance value Terminal 03s 0 e5 If the Off voltage of the input is 2 5 V set R so that the voltage between the input terminal is below 2 5 V Input impedance is 3 kQ The leakage current I for a given sensor will be provided by the manufacturer of the sensor Using the specification for the sensor R can be calculated from the following equations 1x 3R 3 R lt 2 5 R 7 5 1 2 5 kQ 36 D320 PLC User s Manual The power rating W required for the bridge resistor R can be calculated as follows W Power Voltage R 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 Connecting the bridge resistance as shown in the figure below may help solve these problems Example D320DIM1624D 12 24 VDC type input module Off voltage 2 5V input impedance 3kQ LED Limit Switch DC Input Module Input Q Bridge d Terminal r Internal resistance kQ of limit switch Resistance R Bridge resistance value kQ 9 Terminal For many sensors the manufacturer will provide the value of the internal resistance r in which case the leakage current I can be directly cal
53. Value System Output CV 327 67 327 67 5 Control Value Scaled System Output CV 327 67 327 67 6 Control Value Maximum User Input CVmax 327 67 327 67 7 Control Value Minimum User Input CVmin 327 67 327 67 8 Proportional Term User Input Kp 0 327 67 9 Integral Term User Input Ki 0 327 67 10 Derivative Term User Input Kd 0 327 67 11 FeedForward or Bias User Input FF Bias 327 67 327 67 12 Sampling Cycle Time unit 10ms User Input Dt 0 01s 327 67s 13 Dead Band User Input DB 327 67 327 67 14 Manual CV Setting User Input CVm 327 67 327 67 15 Reserved 16 Reserved 17 Maximum Scaling Value User Input Smax 327 67 327 67 18 Minimum Scaling Value User Input Smin 327 67 327 67 19 Number of PID Operations System Output 0 65535 20 31 Reserved 221 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 Status Register Bit Function Remarks 0 PID Control Algorithm 0 Independent 1 ISA ISA Not Currently Supported 1 Reserved 2 Normal Reverse Operation 0 Normal 1 Reverse 3 Output Limiting O No 1 Yes Not Currently Supported 4 Reserved 5 Sc
54. W2427 169 W2217 W2473 215 W2263 W2519 124 W2172 W2428 170 W2218 W2474 216 W2264 W2520 125 W2173 W2429 171 W2219 W2475 217 W2265 W2521 126 W2174 W2430 172 W2220 W2476 218 W2266 W2522 127 W2175 W2431 173 W2221 W2477 219 W2267 W2523 128 W2176 W2432 174 W2222 W2478 220 W2268 W2524 129 W2177 W2433 175 W2223 W2479 221 W2269 W2525 130 W2178 W2434 176 W2224 W2480 222 W2270 W2526 131 W2179 W2435 177 W2225 W2481 223 W2271 W2527 132 W2180 W2436 178 W2226 W2482 224 W2272 W2528 133 W2181 W2437 179 W2227 W2483 225 W2273 W2529 134 W2182 W2438 180 W2228 W2484 226 W2274 W2530 135 W2183 W2439 181 W2229 W2485 227 W2275 W2531 136 W2184 W2440 182 W2230 W2486 228 W2276 W2532 137 W2185 W2441 183 W2231 W2487 229 W2277 W2533 138 W2186 W2442 184 W2232 W2488 230 W2278 W2534 139 W2187 W2443 185 W2233 W2489 231 W2279 W2535 140 W2188 W2444 186 W2234 W2490 232 W2280 W2536 141 W2189 W2445 187 W2235 W2491 233 W2281 W2537 142 W2190 W2446 188 W2236 W2492 234 W2282 W2538 143 W2191 W2447 189 W2237 W2493 235 W2283 W2539 144 W2192 W2448 190 W2238 W2494 236 W2284 W2540 145 W2193 W2449 191 W2239 W2495 237 W2285 W2541 146 W2194 W2450 192 W2240 W2496 238 W2286 W2542 147 W2195 W2451 193 W2241 W2497 239 W2287 W2543 148 W2196 W2452 194 W2242 W2498 240 W2288 W2544 149 W2197 W2453 195 W2243 W2499 241 W2289 W2545 150 W2198 W2454 196 W2244 W2500 242 W2290 W2546 151 W2199 W2455 197 W2245 W2501 243 W2291 W2547 152 W2200 W2456 198 W2246 W2502 244 W2292 W2548 153 W2201 W2457 199 W2247 W2503 245 W22
55. and press the Initialize Key to clear the Error 48 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 Run xt e Disabled Enabled x Run Run 1 Stop e XE Enabled Enabled x Run Run Xi cxt Enabled Enabled x Run Remote i Pause 3 CE Enabled Enabled x Pause Prog Stop 9 xt Enabled Enabled Oo Stop When the Prog LED is on you can change the user program The Initialize switch clears errors when the mode switch is set to Prog When the mode switch is set to Remote and power is switched from Off to On the previous mode of operation is restored When debugging the user program the mode switch should be set to Remote CPU Processing Procedure Program Processing Procedure 1 Mandatory input output wu l input output 3 Watchdog time gt 0 4 Program analysis 5 Peripheral device signal processing The diagram indicates the PLC program processing procedure The CPU regularly repeats procedure 1 through 5 This cycle is called 1 scan time l Mandatory input output processing The internal force table is applied to internal external I O turning forced I O On or Off Input output processing Preserves the On Off state of the external I O and uses it as input in the next scan For a
56. by 4 bit units DIS DIS Dissemble by 4 bit units LI Bit UNI UNI Unify by 4 bit units E Word O Double words Ladder DIS DIS Separate Sr into Nd 1 units of 4 bits each and store in the R D s Nd low 4 bits of words starting at D Sr UNI Combine the low 4 bits of Nd 1 words starting at Sr and store in D zZ U D S N ar Description 1 DIS Separate the word value in register Sr into Nd 1 units of 4 bits each and store these 4 bit units in sequence into registers starting at D The 12 remaining high order bits in each register become 0 UNI Combine the low order 4 bit units from Nd 1 registers starting at Sr and store in D soo oT DE 0000 J 1 41 1 0 Nd 1 represents the number of 4 bit segments to dissemble or unify The range for Nd is Nd 0 to 3 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 130 D320 PLC User s Manual Example Program Expression Operation Results RO 0 DIS Initial conditions Operation results MO 74E5 hex W10 0123 hex W11 456F hex W12 789A hex W13 7654 hex MO 74E5 hex W10 0123 hex W11 456F hex W12 789A hex W13 7654 hex WO 1111 hex W1 2222 hex W2 3333 hex W3 4444 hex M10 ABCD hex WO 0005 hex W1 000E hex W2
57. can destroy the relay contacts Below 1s a chart of some methods to protect the relay contacts 190 D320 PLC User s Manual Countermeasures Application Characteristics Selection of Parts AC DC Load Load Attach a surge O O 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 Kelyan normal status When using a DC following C and R values Inductive load module power source place the surge C 0 5 1 0 uF p suppressor across the inductive No O RM load R 0 5 1 0 Q Pai When using an AC power source Another example for a contact place the surge suppressor across current of 0 5 A and a contact the switching relay contacts voltage of 200 VAC use the following C and R values The example shows how to connect pops Spr the surge suppressor for a DC R 100 200 Q BOS Pray OS For DC circuits use a minimum of a 250 V rated capacitor For AC circuits use a minimum of a 1000 V rated capacitor Attach a flyback x O The diode connected in parallel Use diodes with low reverse diode allows the energy accumulated in leakage current and with a reverse as cae the inductive load to flow back into voltage value that is at least three Inductive load Module the inductive load in the form ofan times greater than the nominal electrical current The energy is applied voltage Verify the diode E then dissipated as heat based
58. condition used to set the initial value of MO to FFFF 124 D320 PLC User s Manual Word Conversion Instruction Details Instruction Mnemonic BCD Conversion Range Binary Conversion BCD BCD Convert binary to BCD LI Bit DBCD BIN Convert BCD to binary E Word BIN E Double words DBIN Ladder BCD Convert the S value from binary into BCD and store in D BIN Convert the S value from BCD into binary and store in D Description l BCD Convert S which is expressed in binary word double word into BCD and store in D The range is as follows Word conversion S 0 to 270F hex 9999 decimal D 0 to 9999 hex 39321 decimal Double word conversion S 0 to 05FSEOFF hex 99999999 decimal D 0 to 99999999 hex 2576980377 decimal 2 BIN Convert S which is expressed in BCD word double word into binary binary code and store in D The range is as follows Word conversion S 0 to 9999 hex 39321 decimal D 0 to 270F hex 9999 decimal Double word conversion S 0 to 99999999 hex 2576980377 decimal D 0 to 05F5EOFF hex 99999999 decimal 3 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results R0 0 Initial conditions WO0 07CC 1996 decimal W1 1996 655
59. execution of program Ch is external input word address OUTR Output Refresh OUTR Refresh external output Send output Ch signal during execution of program Ch is external output word address WAT Watchdog Timer WAT Clear watchdog elapsed value END END END End program This instruction is automatically added by GPC READ Read data READ Read NR3 words from slot NN5 intelligent I O unit To RR1 module memory address NR6 and shared memory E NRS iR store in words starting at RR1 WRITE Write data WRITE Read NR3 words from NR5 and write intelligent I O unit To NN1 NR2 them to slot NN1 module memory shared memory 2 ane address NR2 RMRD Read data remote RMRD Read NR1 words from remote I O I O intelligent I O To NRT RR2 loop NN3 station NN4 slot NN5 unit shared es NIRE module memory address NR6 and memory store in words starting at RR2 RMWR Write data remote RMWR Read NR5 words from NR6 and write I O intelligent I O Nt NNTINN2 them to remote I O loop NN1 station unit shared E Noe tine NN2 slot NN3 module memory memory address NR4 RECV Receive data Link RECV Read NR1 words from link network Network JO NRAERRZ NN3 station NN4 register type NN5 A ARS address NR6 and write them to words starting at RR2 SEND Send data Link SEND Read NR5 words from NR6 and write Network NE ENNTNNZ them to link network NN1 station Hs Nee ce NN2 register type NN3 address NR4 RECVB Receive data Link RECVB
60. from W10 and W11 and writes them to R HUS word addresses 5 and 6 of the shared memory of the z 2 Fr W10 intelligent I O module in slot 0 the first I O slot SlotO Slot 1 Slot 2 Slot 3 Slot 4 O w8 0011 w9 2233 W10 4455 w11 6677 W12 8899 W13 AABB Shared Memory Before Operation After Operation 3 1111 3 1111 4 2222 4 2222 5 3333 5 4455 6 4444 6 6677 7 5555 7 5555 8 6666 8 6666 158 D320 PLC User s Manual Instruction Mnemonic READ Remote Intelligent I O Range Data RMRD Read data from the shared LI Bit memory of an intelligent I O unit B Word on a remote I O drop O Double words Ladder e enber Read NR1 words from remote I O loop NN3 station NRx number register NN4 slot NN5 module memory address NR6 and Fr NN5 NR6 RRx register P store in words starting at RR2 Description 1 NRI Number of words to read number register RR2 Starting address for storing read data register NN3 Remote I O network number number NN4 Station number on the remote network number NNS Slot number of the intelligent I O module to read from number NR6 Starting address of the shared memory to read number register 2 This instruction is used to read data from the shared memory of intelligent I O modules installed
61. 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 See section on shielding Ground the PLC The purpose of grounding the PLC is to protect the electronic equipment from electric shock and harmful noise To ground the PLC connect a 12 to 16 gauge wire from the frame ground terminal strip screw of the power supply to a high quality earth ground less then 2 Q Since electrical currents always take the path of least resistance the noise currents induced by a magnetic field will flow through the PLC frame ground terminal screw to earth ground This essentially draws the noise away from the PLC modules The most effective method of grounding the PLC frame is to ground the PLC independent of other equipment Avoid grounding the PLC through a daisy chain of wire connections with other equipment See figures below for good and bad examples PLC Others REC Otrers The length of the ground cable should not exceed 65 feet 20 m For best results the resistance of the ground cable should be less than 2 Q If single grounding is not possible connect the frame ground terminal of the PLC power supply to the equipment panel metal chassis via one of the PLC rack panel base mounting screws Chapter 8 Troubleshooting Noise Problems 185 Isolation and Filtering Techn
62. mode e The alarm output terminal has two relay contacts These contacts are the NO Normally Open contact and the NC Normally Closed contact They are located on the terminal strip of the power supply These contacts are provided for use as either an external alarm indication for system fault or for wiring as part of the emergency stop circuit for the system They provide a PLC independent method of indication that the system is in fault Power Module Alarm signal of lamp Watchdog Timer e The watchdog timer detects program errors or hardware errors The timer is On when the scan time exceeds a user defined time limit of up to 3 seconds e When the watchdog timer detects a fault the Error LED is lit and the alarm contact of the power supply turns On PLC Communications Wiring Connecting the PLC to a PC Chapter 4 Installation and Wiring 43 The D320 PLC communication ports COMI COM2 support both RS 232C and RS 485 communications The diagram below shows local communications connections for the D320 PLC IBM PC compatible type D320 CPU module 9 8 O test D320CBL20 D320CBL50 oe RS 232 485 communication cable On On RS485 Termination Connected Off Off RS485 Termination Disconnected RSe3ec 485 come RS4B5 1 2 3 Baud Rate Off 9600 bps COM1 On 19200 bps
63. msec to a maximum of 10 sec The constant cycle time is indicated by the Ni parameter The time calculation is Nit 1 x 10 msec 3 The constant cycle routine is controlled by the F0 11 contact If the F0 11 contact is On the constant cycle routine is executed If it is Off the constant cycle routine block is ignored Only one constant cycle routine can be made within a program 5 The time required to execute the constant cycle routine instructions MUST be less than the overall scan time of the main program If the execution time of the constant cycle routine is greater than the overall scan time the program will not operate properly For this reason the constant cycle routine should be limited to a minimum number of steps Example Program Expression Operation Results Ifthe RO O input is On the constant cycle interrupt routine will be executed Instructions between INT RETI shall be executed on a constant time base Pree arate nent of 9 1 x 10 msec 100 msec The constant cycle routine every 100 msec interrupt is controlled in the main program using the RO 0 contact FO0 11 is the system flag that controls the execution of the INT routine 150 D320 PLC User s Manual Special Instruction Details Instruction Mnemonic Refresh External Input and Range Output INPR INPR Refresh external input E Bit OUTR OUTR Refresh external output L1 Word O Double words INPR Immediately update the s
64. on has the proper power rating the resistance of the inductive load The steady state current that flows The time required to return to the when the inductive load is turned on normal status is longer than the should be greater than the current surge suppressor method produced when the inductive load is turned off Attach a varistor O O A varistor functions as a voltage To specify the varistor do the Relay output clamping device When the applied following Inductive load module ce the ties voltage Chose a maximum continuous Kine on eanga snot aut vote rating just above the i ted lied voltage connection across the inductive Se APR im ee load Chose a varistor that can handle A the energy level that will be d method has a slow recovery generated by the inductive load Ime BUT avoid overspecifying As the When using a DC power source varistors energy level capability place the varistor across the goes up so does the capacitance inductive load which will slow down the response When using an AC power source time of the system place the varistor across the switching relay contacts Chapter 8 Troubleshooting Noise Problems 191 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 rela
65. on remote I O drops Intelligent modules include the high speed counter analog module SDU module or positioning module Refer to the specific intelligent I O module user s manual for detailed instructions on using the RMRD instructions with the given module 3 The remote I O network is a number from 1 to 3 The first remote I O module in the base rack is assigned network ID 1 the second is 2 and the third is remote I O network 3 4 Each intelligent I O module on a remote I O network may only be read from once in a given scan To prevent reading from a module more than once per scan place the RMRD instruction at the end of the program Example Program Expression Operation Results F8 0 F88 FB84 m The first remote master F8 0 is installed and there are no initialization errors F8 8 The communication is completed F8 14 Once these conditions are true the program reads 16 words from shared memory address 0 slot 4 remote I O station 5 on remote I O network 1 This data is written to registers starting at MO I A Chapter 6 Instructions 159 Instruction Mnemonic WRITE Remote Intelligent I O Range Data RMWR Write data to the shared memory O Bit of an intelligent I O unit on a B Word remote I O drop L1 Double words Ladder RMW Read NR5 words from NR6 and write them to Nt NN1 NN2 NNx number A R To NN3 NR4 NRx number register remote I O loop NNI station NN
66. outside the range of 0 to 55 C 32 to 131 F e Humidity levels outside the range of 30 to 85 e Abrupt temperature variations which lead to the formation of dew e Presence of corrosive or flammable gases e Presence of dense dust salt and iron concentrations e Presence of corrosive solutions such as benzene thinner alcohol ammonia and caustic soda 26 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 Do not place near wireless communications devices with transceivers such as walkie talkies cellular phones or shortwave radios Control Panel Installation Leave enough space at the top of unit from other devices or wiring ducts to allow ventilation space and easy replacement and wiring of the unit see the following diagrams Do not mount the PLC system vertically or facing up or down This will prevent proper air cooling of the PLC CPU which will cause abnormal overheating inside the PLC see the following diagrams
67. program A total of 64 subroutines are available Sb 0 to 63 4 The same subroutine SBR Sb can be called by multiple CALL instructions However each subroutine number may only be used once by an SBR instruction 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 148 D320 PLC User s Manual Example Program Expression Operation Results When contact RO 0 and or RO 1 turns On the CALL Sb 3 instruction is executed and the instructions between SBR Sb 3 and RET are executed After executing this subroutine the program returns to the next instruction after the CALL Chapter 6 Instructions 149 Instruction Mnemonic Constant Cycle Interrupt Range Routine INT INT Start of constant cycle LI Bit RETI routine L1 Word RETI End of constant cycle O Double words routine Ladder INT Begin block of constant cycle scan instructions Ni The constant cycle interrupt time interval Range 1 to 999 20 ms to 10 sec Time interval Ni 1 x 10 msec RETI End block of constant cycle scan instructions Description 1 The INT RETI instructions are used to mark a block of instructions that are to be executed on a constant time cycle asynchronous with the scan time of the PLC 2 The time interval of the constant cycle routine can be set from a minimum of 20
68. programmed 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 146 D320 PLC User s Manual Example Program Expression Operation Results RO 0 rine By executing a JMPS When contact RO O or RO 1 turns On execution of the program jumps directly from the associated JMPS to its corresponding JMPE Chapter 6 Instructions 147 Instruction Mnemonic Call Subroutine Range CALL CALL Call subroutine O Bit SBR SBR Start subroutine L1 Word RET RET End subroutine O Double words Ladder CALL CALL Call subroutine Sb Sb 0 to 63 SBR Start Subroutine RET Return from Subroutine Description 1 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 2 The subroutine to be called is specified by the Sb parameter in the CALL and SBR instructions The CALL instruction causes execution to jump to the specified SBR instruction After executing the instructions between SBR and RET program execution is returned to the instruction following the CALL instruction that called the subroutine 3 The subroutine defined by the SBR and RET instructions must come after the associated CALL instruction All subroutines must be defined and programmed at the end of the control
69. result in D For example S1 00FF hex S2 3333 hex D CC33 hex st offo ofof of ofof f s 1 1 s 3 XNR Exclusive OR NOT s2 oloi ojo t 1 ojolt 1 oo 11 o RBIdonmrrepoterVpoloniY 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression R0 0 XNR Operation Results Initial conditions Operation results WO 00FF W1 3333 W2 XXXX WO 00FF W1 3333 W2 CC33 116 D320 PLC User s Manual Rotation Instruction Details Instruction Mnemonic Rotate to the Left Without Carry Range RLC Rotate specified address to the O Bit DRLC left low to high B Word E Double words Ladder RLG D Register address R i N N Number of bits to rotate S Eh Ele BER PUPPET EEE LSB 15 1413121110 9876543210 el Description 1 Order Shift by N bits to the left from low order bit to high order bit Fill the carry bit F1 8 with the MSB most significant bit Shift the MSB to the LSB least significant bit 2 Shiftthe register specified as D to the left by N bits Each bit will move one bit position higher in the register 3 TheD register is either a word or a double word For RLC word N 0 to 15 For DRLC double word N 0 to 31 4 This operation w
70. run state Off when Stopped or paused Normal On Chapter 5 CPU Operation and Memory F1 0 to F1 15 F1 word register Special Application Functions 57 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 program 1Scan On 1Scan Off F1 2 0 02 sec Clock 10 ms On 10 ms Off Toms i0ms 10ms F1 3 0 1 sec Clock 50 ms On 50 ms Off Sons Soms Soms F1 4 1 sec Clock 500 ms On 500 ms Off S oms S00ms S00ms F1 5 Instantaneous interrupt On when power is off for over 20 ms Maintained F1 6 Execute status On when the CPU is in the run state F1 7 Keep error display On when the K retentive data is destroyed and or changed F1 8 Carry Flag On in the event of carry when performing math instructions ADD SUB etc F1 9 Division by zero error On when the denominator of division commands is zero F1 10 Range designation error On when the absolute address exceeds the specified range F1 11 Reserved System use Do not use F1 12 Reserved System use Do not use F1 13 Reserved System use Do not use F1 14 Reserved System use Do not use F1 15 Reserved System use Do not use Note The 16 bits in the F1 address provide the CPU s special function and self diagnosis result They are used for s
71. support engineers are available for calls during regular business hours 8 am 5 30 pm EST by calling 1 800 809 2772 International calls can be made to either the Tech Line at 1 800 809 2772 toll call or the Cutler Hammer main business line at 614 882 3282 Emergency Technical Support 1 800 809 2772 Because machines do not run on a nine to five schedule we offer emergency after hours technical support A technical support engineer can be paged for emergencies involving plant down situations or safety issues Emergency support calls are automatically routed directly to our answering service after hours 5 30 pm 8 am EST and weekends For emergency technical support call 1 800 809 2772 Does not currently include product repairs or shipping outside normal business hours Technical Support Fax 614 882 0417 You can also contact our technical support engineers by faxing your support requests directly to APSC Westerville at 614 882 0417 Information Fax Back Service 614 899 5323 The latest Cutler Hammer product information specifications technical notes and company news is available to you via fax through our direct document request service at 614 899 5323 Using a touch tone phone you can select any of the info faxes from our automated product literature and technical document library punch in a fax number and receive the information immediately Bulletin Board Service 614 899 5209 Parameters 8 data bits 1 stop bit parity no
72. the 3 second timer started after the Query message was sent If the timer times out it increments an error counter K1 and restarts communications 240 TC65 MO 1 D320 PLC User s Manual mn a QE e INC 9 SBR SL 0 LET D SR298 S 0301 LET D SR299 S 0404 LET D SR300 0002 LET D SR301 S R2 LET D SR370 S 8 LET D SR371 S 5 RET Rung 6 This rung checks the 3 second timer started after the Response Request message was sent If the timer times out it increments an error counter K2 and restarts communications Rung 7 Subroutine 0 creates the Query message Write Word Rung 8 The Query message is placed in the Send buffer SR298 to SR301 The message data to send is 010304040002 which translates to Write 1 word of data with the value to WO in PLC station 3 See Appendix A for a detailed explanation For this example the value in register R2 is being sent to PLC 3 After creating the message the send length is placed in SR370 and the expected receive length is placed in SR371 Rung 9 End of Subroutine 0 Appendix C COM2 UDCP Specification 241 SBR SL 1 LET D SR298 S 0301 LET D SR299 0100 LET D SR300
73. 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 Port Configuration Communications port 2 on the D320 CPU module is user configurable for a variety of protocols baud rates parities and so on The port contains line driver support for both RS232 and RS485 hardware communications The CPU auto detects the incoming signal and uses the correct hardware protocol as required Refer to Chapter 4 for a detailed pin out of the 9 pin D connector Baud rates supported by Comm Port 2 are 4800 baud to 38 400 baud The baud rate at which the port communicates is configured through the use of a bank of dip switches located on the CPU module between ports 1 and 2 Table 1 shows the proper dip switch settings for the given baud rate Additionally when using RS 485 communications the nodes at the end of the RS 485 communications network should always be terminated with impedance matching resistors These Terminating Resistors match the natural resistance of the communications line and prevent reflected voltages from disrupting communications along the line When the CPU module is at the end of the communications line dip switches
74. to be transmitted SR371 Receive Data Length Number of Bytes that have been received SR372 Start Code Start code for ASCII Comm one byte high byte unused SR373 End Code End code for ASCII Comm one byte high byte unused Descriptions of Configuration Flags and Registers Each of the Flags and Registers has a specific purpose based on the mode of communications The following paragraphs describe in greater detail the operation and use of each flag and register F11 0 REQUEST TRANSMISSION UDCP Mode Once the ladder program has filled the Transmit Data Buffer SR298 SR333 and set the number of Bytes to send SR370 the program sets this flag to indicate to the CPU that it is time to send the data Once the CPU has sent the number of bytes indicated this bit is automatically reset by the CPU F11 1 TRANSMISSION FAILURE UDCP Mode Ifthe CPU encounters a failure in transmitting the data indicated e g the number of Bytes to send gt 72 this flag is set This flag is not automatically reset and must be reset by the user program after each occurrence F11 2 ENABLE START CODE UDCP Mode In the ASCII mode of communications it is possible to define a start code to signal the beginning of a message Setting this flag enables the Start Code mode of operation When set the CPU will look for the Start Code SR372 on any message received before storing the data into the Receive Data Buffer SR334 SR369 F11 3 ENABLE END CODE
75. turned On When the flag is 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 CV Value Setting Mode This bit determines whether the Output Value CV of the PID loop calculation is calculated by the PID loop equation or set to a given constant value defined by word 14 of the PID loop block see below PID Execution Completion Flag The PID loop is executed on a constant time basis While the PID loop is calculating this bit is set Off When the PID loop has completed its calculation the bit is turned On until the next calculation occurs 220 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 TABLE 3 PID Parameter Block Word Description Type Abbrev Range 0 Status Register System Output SR See Table 3 1 Setpoint User Input SP 327 67 327 67 2 Process Value System Input PV 327 67 327 67 3 Process Value Scaled System Input PVs 327 67 327 67 4 Control
76. 0 decimal W2 XXXKX W3 XXXKX Operation results Wo 07CC W1 1996 W2 1996 6550 decimal W3 07CC 1996 decimal BCD Chapter 6 Instructions 125 Instruction Mnemonic Data Exchange Range XCHG Exchange registers of D1 D2 with L1 Bit DXCHG each other E Word E Double words Ladder Exchange registers D1 and D2 word double word with each other D1 gt D2 D2 gt DI oi Jo Jo Xx L Joo i 1 p2 o o 1 1 val o 1lo 1 Description 1 Exchange registers D1 and D2 with each other word double word For example Word operation D1 1234 hex D2 5678 hex D1 5678 hex D2 1234 hex Double word operation D1 12345678 hex D2 9ABCDEFO hex D1 9ABCDEFO hex D2 12345678 hex 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results Initial conditions WO 1234 W1 5678 W10 5678 W11 1234 W12 DEFO W13 9ABC Operation results WO 5678 W1 1234 W10 DEFO W11 9ABC W12 5678 W13 1234 RO 0 RI 126 D320 PLC User s Manual Instruction Mnemonic 7 Segment Decoder Range SEG Convert the low order 4 bits of S O Bit into 7 segment display format and B Word store in D O Double words Ladder BEC Convert t
77. 0 msec pulse duration e Surge noise is electrical energy that has a pulse duration of 200 msec to 2 sec e Transient noise is electrical energy that has an extremely short duration usually lasting only a few nanoseconds 1 x 10 Electrical Noise Fundamental Definitions e Isolation means to physically separate the connection between areas Isolation is effective for common mode noise e Filters are effective against conduction noise such as impulses Filtering is used to remove normal mode noise and common mode noise that has been imprinted onto the signal or power cables A low pass filter passes only low frequency signals Low pass filters are classified as either LC L inductor and C capacitor filters or RC R resistor and C capacitor filters according to the electrical parts that form the filter e Surge absorbers are devices that protect electronic equipment by clamping down extremely high voltage spikes lightning strikes in power cables to a safe level e Charge is an excess or deficiency of electrons in an object When an object becomes charged a magnetic field forms around the object and can radiate noise as the amplitude of the charge is varied e An inductive load is a device which creates a large magnetic field that opposes any change in the voltage applied across the device Devices that act as inductive loads are relay coils motor coils starter coils and actuator coils e Stray capacitance and inductance is cr
78. 0004 hex W3 0007 hex M10 4AF3 hex Bit Conversion Instruction Details Chapter 6 Instructions 131 Instruction Instruction Bit Set Reset Reverse Test Range BSET BSET Nth bit set O Bit BRST BRST Nth bit reset E Word BNOT BNOT Nth bit reverse O Double words BTST BTST Nth bit test Ladder BSET BNO D R D R N N BRST BTST D R D BSET Set the Nth bit in the D register X291 BNOT Reverse the Nth bit in the D register 051 1 0 BRST Reset the Nth bit in the D register X0 BTST Copy the Nth bit to the carry bit in the D register X F1 8 Description 1 BSET Set the Nth bit of register D to 1 2 BRST Reset the Nth bit of register D to 0 3 BNOT Reverse the state of the Nth bit of register D 4 BTST Setthe carry bit F1 8 to the state of the Nth bit of register D 5 These instructions are useful when it is necessary to perform bit level operations on word only memory addresses such as W PV SV and SR BSET D og BRST D o 1 o 1 o 1 0 O erst p BNor D if N 5 AS 1 if N lo 1 0 o ofo 132 D320 PLC User s Manual Example Program Expression R0 0 Operation Results Initial conditions Operation results MO 0001 0010 0001 1100 binary MI 0011 0100 0101 1100 binary M2 0101 0110 0111 0100 binary M3 0111 1000 0111 0100 binary F1 8 0 Off MO 0001 0010 0011 1100 bina
79. 10 F11 11 F11 12 F11 13 F11 15 See Table 2 above 2 Setthe Start Code SR372 and End Code SR373 as required by the application 3 Fill the Transmit Data Buffer SR298 SR333 with up to 36 words of data to be transmitted 4 Setthe Transmit Data Length SR370 indicating the number of bytes to send 5 Setthe Receive Data Length SR371 indicating the expected number of bytes in the response 6 Setthe Request Transmission Flag F11 0 to begin transmission of the data 7 When the CPU has finished it will reset the Request Transmission Flag F11 0 8 As data is received it will be placed in the Receive Data Buffer SR334 SR369 When the number of bytes indicated by the Receive Data Length SR371 have been received the CPU will set the Message Received Flag F11 4 9 After moving and using the received data as required clear the Receive Data Buffer SR334 SR369 by setting the Clear Buffer Flag F11 5 10 The CPU will reset the Message Received Flag F11 4 11 Repeat steps 3 through 10 as required by the application IMPORTANT When transmitting and receiving data by placing data into and retrieving data out of the send and receive buffers the data is in low byte high byte order The low byte always comes before the high byte For example to send the characters AB in that order the A is placed into the low byte of SR298 and the B is placed into the high byte Since A is ASCII code 41 and B is
80. 100 W2148 W2404 21 W2069 W2325 61 W2109 W2365 101 W2149 W2405 22 W2070 W2326 62 W2110 W2366 102 W2150 W2406 23 W2071 W2327 63 W2111 W2367 103 W2151 W2407 24 W2072 W2328 64 W2112 W2368 104 W2152 W2408 25 W2073 W2329 65 W2113 W2369 105 W2153 W2409 26 W2074 W2330 66 W2114 W2370 106 W2154 W2410 27 W2075 W2331 67 W2115 W2371 107 W2155 W2411 28 W2076 W2332 68 W2116 W2372 108 W2156 W2412 29 W2077 W2333 69 W2117 W2373 109 W2157 W2413 30 W2078 W2334 70 W2118 W2374 110 W2158 W2414 31 W2079 W2335 71 W2119 W2375 111 W2159 W2415 32 W2080 W2336 72 W2120 W2376 112 W2160 W2416 33 W2081 W2337 73 W2121 W2377 113 W2161 W2417 34 W2082 W2338 74 W2122 W2378 114 W2162 W2418 35 W2083 W2339 75 W2123 W2379 115 W2163 W2419 36 W2084 W2340 76 W2124 W2380 116 W2164 W2420 37 W2085 W2341 77 W2125 W2381 117 W2165 W2421 38 W2086 W2342 78 W2126 W2382 118 W2166 W2422 39 W2087 W2343 79 W2127 W2383 119 W2167 W2423 64 D320 PLC User s Manual Internal external address designation Ch SV PV Ch SV PV Ch SV PV 120 W2168 W2424 166 W2214 W2470 212 W2260 W2516 121 W2169 W2425 167 W2215 W2471 213 W2261 W2517 122 W2170 W2426 168 W2216 W2472 214 W2262 W2518 123 W2171
81. 2 When using SUB and SUBB the calculation ranges are as follows Sl 0to 65 535 0000 to SFFFF S2 0to 65 535 0000 to SFFFF D 0 to 65 535 0000 to SFFFF 3 When using DSUB and DSUBB the calculation ranges are as follows 1 0 to 4 294 976 295 0 to SFFFFFFFF 2 0 to 4 294 976 295 0 to SFFFFFFFF D 0 to 4 294 976 295 0 to SFFFFFFFF 4 Ifthe result exceeds the range of calculation a carry occurs The carry flag F1 8 is changed to On 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results RO SUB Initial conditions W0 00016 0010 W1 00002 0002 W2 00007 0007 W3 00001 0001 Operation results W10 00009 0009 W11 0000065545 00010009 W13 00003 0003 Chapter 6 Instructions 105 Instruction Mnemonic Multiplication Range MUL Decimal multiplication MUL LI Bit DMUL DMUL E Word BCD multiplication MULB MULB DMULB E Double words DMULB Ladder D 5S1 x82 Decimal S1 3 and S2 7 Hexadecimal S1 03 and S2 07 MUL Example Decimal 3x7 21 MULB Example BCD 03 x 07 21 Description 1 Multiply the data in the S1 and S2 addresses then store the result in the D register 2 When using MUL and MULB the calculation ranges are as follows Sl 0to 65 5
82. 2 slot NN3 module Fr NR5 NR6 RRx register memory address NR4 Description 1 NNI Remote I O network number number NN2 Station number on the remote network number NN3 Slot number of the intelligent I O module to write to number NR4 Starting address of the shared memory to write number register NR5 Number of words to write number register NR6 Starting address of the data to write number register 2 This instruction is used to write data to the shared memory of intelligent I O modules installed on remote I O drops Intelligent modules include the high speed counter analog module SDU module and positioning module Refer to the specific intelligent I O module user s manual for detailed instructions on using the RMWR instructions with the given module 3 Ifthe NR6 parameter is a constant value instead of a register address then this constant value will be written to all of the shared memory locations specified This function is useful for initializing the shared memory of an intelligent I O module on a remote I O drop 4 The remote I O network is a number from 1 to 3 The first remote I O module in the base rack is assigned network ID 1 the second is 2 and the third is remote I O network 3 5 Each intelligent I O module on a remote I O network may only be written to once in a given scan To prevent writing to a module more than once per scan place the RMWR instruction at the end of the program Exam
83. 2 0to 65 535 0000 to FFFF D 0 to 65 535 0000 to SFFFF 3 When using DDIV and DDIVB the calculation ranges are as follows 1 0 to 4 294 976 295 0 to SFFFFFFFF S2 0to 4 294 976 295 0 to SFFFFFFFF D 0 to 4 294 976 295 0 to SFFFFFFFF 4 The quotient is stored in the D register and the remainder in special register SR22 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results RO BN Initial conditions W0 00024 0018 W1 00002 0002 W2 00004 0004 W3 00001 0001 Operation results W10 00006 0006 W11 00002 0002 W13 00004 0004 Chapter 6 Instructions 107 Instruction Command Addition with Carry Range ADC Decimal addition with carry ADC L1 Bit DADC DAD E Word BCD addition with carry ADCB ADCB DADCB E Double words DADCB Ladder D S1 S2 carry Decimal S1 7 21 and S2 22 Hexadecimal S1 15 and S2 16 Carry Flag F1 8 On ADC Example Decimal 21 22 1 44 ADCB Example BCD 15 16 1 32 Description 1 Add the data in the S1 and S2 addresses If the carry flag F1 8 is On add 1 otherwise add 0 Then store the result in the D register 2 Whenusing ADC and ADCB the calculation ranges are as follows Sl 0to 65 535 0000 to S
84. 2 addresses then store the result in the D register 2 When using ADD and ADDB the calculation ranges are as follows 1 0 to 65 535 0000 to SFFFF S2 0to 65 535 0000 to SFFFF D 0 to 65 535 0000 to SFFFF 3 Whenusing DADD and DADDB the calculation ranges are as follows Sl 0to4 294 976 295 0 to SFFFFFFFF 2 0to 4 294 976 295 0 to SFFFFFFFF D 0 to 4 294 976 295 0 to SFFFFFFFF 4 Ifthe result exceeds the range of calculation a carry occurs The carry flag F1 8 is changed to On 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Chapter 6 Instructions 103 Example Program Expression Operation Results Initial conditions W0 00017 0011 W1 00001 0001 W2 00025 0019 W3 00002 0002 Operation results W10 00042 002A W11 0000196650 0003002A W13 00048 0030 RO R 104 D320 PLC User s Manual Instruction Mnemonic Subtraction Range SUB Decimal subtraction SUB DSUB O Bit DSUB BCD subtraction SUBB DSUBB Ill Word SUBB E Double words DSUBB Ladder D SI1 S2 Decimal 1 34 and S2 19 Hexadecimal S1 22 and S2 13 SUB Example Decimal 34 19 15 SUBB Example BCD 22 13 09 Description 1 Subtract the data in S2 from S1 then store the result in the D register
85. 2 word immediately from the external input IfR0 1 is On send out Ch 3 R3 word immediately to the external output For this example R2 is an external input module and R3 is an external output module 152 D320 PLC User s Manual Instruction Mnemonic Clear Watchdog Time Range WAT WAT Clear watchdog time W Bit L1 Word O Double words Ladder C a WAT Clears the watchdog timer while executing the program Description 1 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 The default watchdog time is 3 seconds 2 Under normal operation the PLC executes the following process Read external inputs Process the control program Update the external outputs One execution of this process is termed a scan When the time it takes to process a single scan the scan time is excessively long abnormal results may occur caused by the delay in reading inputs and updating outputs For this reason a watchdog time is set by the PLC which when exceeded indicates that an error has occurred When this happens the PLC stops the program to prevent abnormal operation 3 Under certain circumstances extremely lengthy scan times may be allowable The WAT instruction allows the user to reset the watchdog timer to prevent the PLC from automatically going into the error condition and stop mode when the
86. 224D 32 points TR OUT connector type D320RIO3224D 32 points DC IN TR OUT mixed connector type Programming Equipment Chapter 2 System Configuration 13 troubleshooting and diagnostic features Name Catalog Product Description Remarks Write edit monitor program mnemonic only Does not include Handheld cable Program D320PGM500 Memory BACK UP function Loader Backlit LCD screen Supports RS 232C 485 communication Name Catalog Product Description Remarks GPC5 DOS D50CCS35 Software for computer which provides programming For MS DOS WinGPC D50WINCS35 monitoring uploading downloading online editing For Windows 3 1 Windows error checking PLC status monitoring and other 95 98 NT Note Programming Cables When this manual uses the term GPC either GPC5 or WinGPC can be used Name Catalog Product Description Remarks RS232C 485 D320CBL20 Handheld Program Loader PGM500 6 ft 2 m Cable For IBM PC communication GPC RS232C Cable D320CBL50 For IBM PC communication GPC 15 ft 5 m Accessories Name Catalog Product Description Remarks Dummy Module D320BNK300 Blank module for D320 backplane empty slot D320CBL32IN DC IN 32 points connector harness 5 ft 1 5 m For 32pt I O Cable D320DIM3224D Harnesses D320CBL32TO TR OUT 32 points connector harness 5 ft 1 5 m For
87. 35 0000 to FFFF S2 0to 65 535 0000 to FFFF D 0 to 65 535 0000 to SFFFF 3 When using DMUL and DMULB the calculation ranges are as follows 1 0 to 4 294 976 295 0 to SFFFFFFFF 2 0to 4 294 976 295 0 to SFFFFFFFF D 0 to 4 294 976 295 0 to SFFFFFFFF 4 Ifthe result exceeds the range of calculation a carry occurs The carry flag F1 8 is changed to On The high word of the result that exceeds the range of D is automatically stored in SR20 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results RO Mat Initial conditions W0 00002 0002 W1 00001 0001 W2 00006 0006 W3 00001 0001 Operation results W10 00012 000C W11 0000524300 0008000C W13 00018 0012 106 D320 PLC User s Manual Instruction Mnemonic Division Range DIV Decimal division DIV DDIV O Bit DDIV BCD division DIVB DDIVB B Word DIVB W Double words DDIVB Ladder D 5S1 S2 Decimal S1 18 and S2 3 Hexadecimal S1 12 and S2 03 DIV Example Decimal 18 3 6 DIVB Example BCD 12 03 04 Description 1 Divide the data in S1 by S2 then store the result in the D register 2 When using DIV and DIVB the calculation ranges are as follows Sl 0to 65 535 0000 to FFFF S
88. 5 and 6 can be used to properly terminate the network See Table 1 below Table 1 Comm Port Configuration Switch Switch Function Diagram Number Position 1 Off COM 9 600 bps On COM 19 200 bps Off Off COM2 9 600 bps On Off COM2 19 200 bps Off On COM2 38 400 bps On On COM2 4 800 bps Not used Off Off Terminating resistors for RS485 communications not connected On On Terminating resistors for RS485 communications connected Appendix C COM2 UDCP Specification 231 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 Table 2 below describes each flag bits function in the operation of the port Table 2 Communications Flags Flag Bit Function Description State Description Flag Word F11 F11 0 Request Transmission 0 Nooperation 1 Start Transmission F11 1 Indicates Transmission Failure 0 Normal 1 Transmission Error F11 2 Enables the Start Code in ASCII mode 0 No Start Code 1 Start Code Enabled F11 3 Enables the End Code in ASCII mode 0 No End Code 1 End Code Enabled F11 4 Indicates that a message has been received 0 No
89. 80 mm or more for the optical link module e Leave 4 inches 100 mm or more for the wire link module e This allows for extra ventilation space and reduces noise interference When installing the PLC in a cabinet or enclosure e Leave 4 inches 100 mm or more from the front surface of unit e This area in front of the PLC helps to avoid the effects of emission noise and heat 28 D320 PLC User s Manual System Wiring and Installation Procedures Installation Dimensions Se AS SRR RS AA eR M ERE eee ee RRREEPECE ww QOL ut S6 MORS E E E a a Four M5 or 10 screws q o BL e 3 J i LF LF 1 i dz H HH HH H al Type Slot Product Number Size A Size B in mm in mm 3 D320RAK03B 10 25 260 9 65 254 Base Backplane 5 D320RAK05B 13 0 330 12 4 315 8 D320RAK08B 17 15 435 16 55 420 Expansion Backplane 5 D320RAKO05E 13 0 330 12 4 315 8 D320RAKO8E 17 15 435 16 55 420 values are rounded to the nearest 0 05 in Chapter 4 Installation and Wiring 29 Module Ins
90. 9 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 Rw NS This operation occurs on every scan for which the input condition to the instruction is true Explanation of Description The description provides details of the instruction Sample Example Program Expression Time Chart R0002 eT R000 2 Jl D M0000 R000 3 _ __ L___ S 123 M0000 0000 H 0123 0123 ter M0001 0000 l 0100 0100 0000 0000 0123 D M001 R0003 R000 3 Explanation of Example The example shows an application of an instruction as programmed in GPC The time chart demonstrates how the instruction operates with respect to time and the changing input conditions for the example The results of the operation may also be shown as part of the example 80 D320 PLC User s Manual Basic Instruction Details Instruction Mnemonic Start of the Circuit Range STR Start rung with NO contact E Bit STN Start rung with NC contact L1 Word O Double words Ladder zP Used for the start of a circuit B yp STR Start NO normally open contact STN Start NC normally closed contact STR NOT A Circuit started with NO contact STR B Circuit started with NC contact 2BSTN
91. 9 Write Bits and Words re Ree ite d hei diete e e hal 210 Communication Program Example decas e ide e tiec quee d dede deleri see 211 Appendix B PID Loop Control 217 OVertvle WA oos eh deter edu attese d n P e tdm em Pe 218 PID Algorithm in the D320CPU320 cccceccccssesecssesscsseeseeseeseesecseesecsecsecsseeseesecseesecseceecseesesseesessaeceeseeasesesaeenees 218 Parameter Descriptions s petet ee RE RUM OE IHUR EN TERN EE ERR 222 PID Example 75 2 e EE Enea m utes 224 Description eet e e e RUE Re EEG TN E RTT E EA ETE ROUTER 224 Ladder Program ace d eR De RE RT SER duces sve ches REED RTL De RR PEE REN 225 Appendix C COM2 UDCP Specification 229 OVerylew aoctor a e E pe oe da a ee tei e bs tus 230 Port GonfiguratlonzL oec in ap itti ee ita poe i et eia ome 230 Configuration Pla gS aii edv n eb e PROC OU aM DE 231 Communication System Registers enne nnne enne erri ennt neni nennen nnne 232 Descriptions of Configuration Flags and Registers eene 232 x D320 PLC User s Manual Description of Operation MODBUS RTU mode sese enne 235 MODBUS Memory Mapping ssssssssssesseeee eene enne nnne nnn nn trennen nre nr enr enne nnne nennen 235 Description of Operation UDCP Mode esses ieeieentieie icit eiie ie der ert HE ee 236 Example 1 Printing an Error Message from an Input ssssssssssssesseeeeeneenrenne eene 237 Example 2 D320 Master on D50 Network s
92. 93 W2549 154 W2202 W2458 200 W2248 W2504 246 W2294 W2550 155 W2203 W2459 201 W2249 W2505 247 W2295 W2551 156 W2204 W2460 202 W2250 W2506 248 W2296 W2552 157 W2205 W2461 203 W2251 W2507 249 W2297 W2553 158 W2206 W2462 204 W2252 W2508 250 W2298 W2554 159 W2207 W2463 205 W2253 W2509 251 W2299 W2555 160 W2208 W2464 206 W2254 W2510 252 W2300 W2556 161 W2209 W2465 207 W2255 W2511 253 W2301 W2557 162 W2210 W2466 208 W2256 W2512 254 W2302 W2558 163 W2211 W2467 209 W2257 W2513 255 W2303 W2559 164 W2212 W2468 210 W2258 W2514 165 W2213 W2469 211 W2259 W2515 Chapter 5 CPU Operation and Memory 65 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 Note When using GPC software the above W registers can be represented as follows Ch Set Value SV Present Value PV 0 W2048 SVO W2304 PVO 1 W2049 SV1 W2305 PV1 255 W2303 SV255 W2559 PV255 Where SV is Set Value and PV is Present Value A CAUTION Be sure you understand the programming of the timer counter thoroughly If you change the above registers while the program is running or program them incorrectly errors or damage may occur 66 D320 PLC User s Manual Chapter 6 Instructions 67 Instructions This chapter conta
93. CRC wrong baud rate etc The flag will remain set until the user program clears it F11 8 ENABLE ASCII BINARY CONVERSION UDCP Mode When this flag is set by the user program incoming ASCII text values are automatically converted to their binary values For example if the hex word value 3130 is received the equivalent ASCII characters are 10 The ASCII2 Binary conversion will convert this ASCII data automatically into a single byte value of 10 when it is received F11 9 IGNORE RECEIVE ERRORS UDCP Mode This flag is set by the user program Setting this flag disables the detection of Receive errors All data is received as is and the Receive Error Flags F11 6 F11 7 are ignored F11 10 ENABLE PARITY The communications port is capable of being configured for three types of parity checking on transmitted and received messages odd even and none When this flag is turned Off the parity is set to None When this flag 1s set by the user program the parity is determined by the Select Parity Flag F11 11 F11 11 SELECT PARITY This flag sets the parity for communications when the Enable Parity Flag F11 10 is turned On When this flag is On Even parity is used When it is Off Odd parity is used F11 12 SELECT DATA BITS This flag sets the data bit size for communications When it is Off 7 bit communications is used When it is On 8 bit communications is enabled F11 13 SELECT ASCH BINARY UDCP Mode In the User Defi
94. D i E ote ite D Li ir DE Ei 131 SUMM e eco Pe nD aR RPE AL ume Ut I Tm ST BE RON n tpi ta NENT UD e Um M ALN 133 SCRE Gy ct ea E E RE MR NS 134 viii D320 PLC User s Manual Transfer Instruction Details nereis e E a a R a EEEE E AET E a a EE E Ee aep i i 135 COR PEDR aE CMM 135 STO DST Oc EE 137 AMO 139 BMOV BEM i 141 Block Processing Instruction Details teer ete Here Ee eU ER REOR eR 142 FOR DEFOR NEX GP 142 IMPS EBL cesses M 144 MURAT 145 CATLL SBR RET eret ene a ERE I ERATIS AE HERREN RC EH RA NER cus ERE AR UR 147 IgM 149 Special Instruction Details nee itae ed ER Ee debe Reve 150 Ia OUT P 150 WAT sees ntu Boe eire e Brei n RR HERE TUN ERUDITI EIC pen Que tein ENTER 152 Ip P 153 READ iesirea Roe Or He HR RE EUREN EE Ier vieta RE A PY RENE REI aree e sev cuv ee ete eevee ke 154 WRITE ee sty E EENE NE E ERE E EN ON EE nects bast R E E a 156 RMRD RM 158 add 159 ip c 160 ope 161 hiigdl E 162 jupe
95. D320 PLC User s Manual 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 It is against the law to copy the software on any medium except as specifically allowed in the agreement No part of this manual may be reproduced or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without prior written permission of Cutler Hammer Inc RESTRICTED RIGHTS LEGEND Use duplication or disclosure by the Government is subject to restrictions set forth in paragraph b 3 B of the Rights in Technical Data and Computer Software clause of DAR 7 104 9 a Contractor Manufacturer is Cutler Hammer P O Box 6166 Westerville OH 43086 6166 TRADEMARKS Commercial names of products from other manufacturers or developers that appear in this manual are registered or unregistered trademarks of those respective manufacturers or developers which have expressed neither approval nor disapproval of Cutler Hammer products Copyright Cutler Hammer Inc 1998 All rights reserved Catalog Number D320SA100 P N 01 00408 02 Preface Preface Welcome to Cutler Hammer
96. Description 1 The timer counter channel can only be used once It cannot be reused by other timer or counter instructions TIM SST TOF RCT UDC A maximum of 256 channels Ch 0 to Ch 255 can be used The output done contact is displayed as TC channel no in the counter The elapsed value PV of the counter is maintained in case of a power failure and for retentive purposes When SV is 0 the output contact TC turns On if one pulse of input occurs SV can be specified from 0 to 65 535 A CAUTION Each input condition to the counter should be on its own line of the rung They should not share a common contact or be connected in any way 92 D320 PLC User s Manual Example Program Expression Time Chart roo LJ I LJL_J YL R000 1 counter time value Output TCO Chapter 6 Instructions 93 Instruction Mnemonic Rotation Counter Range RCT Ring counter W Bit L1 Word L1 Double words Ladder condition 1 U input Reset condition 3 i condition 1 condition 2 sit ded Set Value i i i SV Present i Value PV Description 1 When the input count condition U input turns on the Present Value PV is incremented by 1 When the PV reaches the Set Value SV it is reset to 0 the output done contact is turned On and stays On until the next count input pulse is received 2 When the reset input condition R input is On the output d
97. EDs are not illuminated No external input power Supply power Low external input voltage Make sure full voltage is being supplied Terminal screw is loose Defective contact Tighten screw Reconnect the module Inputs will not turn to On state LEDs are illuminated Defective input circuit Replace the input module One or more inputs on an I O module will not turn On Device connected to input module is defective Replace the input device Loose input wiring Reconnect the input wiring External input time is too short Adjust the input module Terminal screw is loose Defective contact Tighten screw Reconnect module One or more inputs on an I O module will not turn Off Defective input circuit Replace the input module Input changes On Off state erratically Low external input voltage Make sure full supply voltage is being input Noise error Troubleshoot for noise Terminal screw is loose Defective contact Tighten screw Reconnect module Input display LED will not illuminate input is On in PLC LED error Replace the input module Output Module Chapter 7 Testing and Troubleshooting 179 Symptom Expected Cause Troubleshooting No outputs on an output module will turn On No external input power Supply power Low external input voltage Make sure full voltage is being su
98. F1 3 F3 3 164 D320 PLC User s Manual Chapter 7 Testing and Troubleshooting 165 Testing and Troubleshooting This chapter provides information on testing and troubleshooting the D320 PLC This chapter discusses e Testing procedures for the D320 PLC e Howto troubleshoot the D320 PLC 166 D320 PLC User s Manual Test Precautions When checking the system A CAUTION Always turn off the power whenever you install or remove a module 1 Check the module more than one time before exchanging the part 2 Include a complete description of the symptoms when you return a defective module for repair 3 When you suspect that a contact may be defective it might only need cleaning Clean the contact using a clean cotton cloth and alcohol Then retest the module 4 Do not use thinner to clean any of the parts System Checks Before installing the I O wiring of the PLC and supplying power check the following items Check the connection of the power cable Check the connection of the I O cable Check the grounding Check the battery Check the emergency stop circuit Check the power source Chapter 7 Testing and Troubleshooting Item What to Check The connection of the power cable and the I O cable e Check that the wiring is secure and intact e Check that the terminal screws are tightly fastened
99. FFFF S2 0to 65 535 0000 to SFFFF D 0 to 65 535 0000 to SFFFF 3 When using DADD and DADDB the calculation ranges are as follows 1 0 to 4 294 976 295 0 to SFFFFFFFF S2 0to 4 294 976 295 0 to SFFFFFFFF D 0 to 4 294 976 295 0 to SFFFFFFFF 4 Ifthe result exceeds the range of calculation a carry occurs The carry flag F1 8 is changed to On 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 108 D320 PLC User s Manual Example Program Expression R0 0 Operation Results Initial conditions Operation results WO 00017 0011 W1 00025 0019 W10 00017 00025 W11 0011 0019 1 00043 0 0030 Chapter 6 Instructions 109 Instruction Command Subtraction with Carry Range SBC Decimal subtraction with carry LI Bit DSBC SBC DSBC E Word BCD subtraction with carry BCB SBC SBCB DSBCB E Double word DSBCB Ladder D S1 S2 carry Decimal S1 234 and S2 19 Hexadecimal S1 22 and S2 13 Carry Flag F1 8 On SBC Example Decimal 34 19 1214 SBCB Example BCD 22 13 01 08 Description 1 Subtract the data in S2 from S1 If the carry flag F1 8 is On subtract 1 Then store the result in the D register 2 When using SBC and SBCB the calculation ranges are as fol
100. FFO iSFFFF iSFFFC MO FRRRPPEERDPEEFELUIIII nibii dp b b E HF Lolo To Regardless of N the MSB moves to the carry bit F1 8 and the LSB always becomes 0 The RO input is the initial condition used to set the initial value of MO to FFFF Chapter 6 Instructions 123 Instruction Mnemonic Shift to Right Range SHR Shift to right low order bit by N LI Bit DSHR bits E Word The highest bit becomes 0 E Double words Ladder 3 ui D Register address N Number of bits to rotate MSB LSB 15 14 13 121110 9 8 7 6 5 4 3 2 1 0 Beeb GE helee E cary Description 1 Order Shift N bits to the right from high order bit to low order bit MSB most significant bit becomes 0 Fill the carry bit F1 8 with the LSB least significant bit 2 Shift the register specified as D to the right by N bits Each bit will move one bit position lower in the register 3 The D register is either a word or a double word For SHR word N 0 to 15 For DSHR double word N 0 to 31 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Time Chart R0 0 LET Lo o 1 1 5 811i 1 1 1 Regardless of N the MSB moves to the carry F1 8 and the LSB always becomes 0 The RO 0 input is the initial
101. Function of CPU Components Initialize switch Test switch Status display LED Mode switch CPU cover e Battery e Terminal resistance switch e Communication speed control switch RS 232C RC485 SS Communication connector D sub 9 pin Female x D SN c J a 7 The initialize switch clears CPU errors The switch is only active when the CPU is in the Stop Program mode The mode conversion switch has the following settings State Function RUN CPU set in Run mode REMOTE CPU set in Run or Stop Program mode PROG CPU set in Stop Program mode The status display LEDs provide the following information LED Color Function RUN Green On when CPU is in Run mode PROG Green On when program is in Stop Program mode TEST Green On when CPU is in Test mode ERROR Red On when CPU has an error COM1 Green Flickers when CPU is communicating COM2 Green COM1 COM2 BATT Red On when the battery voltage is low or is not installed Chapter 3 Product Specification 21 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 Off COM1 9 600 bps On COM1 19 200 bps Off Off COM2 9 600 bps On Off COM2 19 200 bps Off On COM2 38 400 bps On On COM2 4 800 bps 4 Not used Off Off Terminating resis
102. Instruction Set that is used by the D320 PLC e Chapter 7 discusses testing and troubleshooting procedures e Chapter 8 describes electrical interference or noise and the ways you can reduce its influence e Chapter 9 details the external dimensions of the D320 PLC system modules e Appendix A gives rules and procedures for D320 PLC communication e Appendix B details the configuration and operation of PID Loop Control on the D320 PLC e Appendix C describes the enhanced operation of the CPU s second program loader port Features of the D320 PLC The D320 Programmable Logic Controller PLC is a versatile and dependable industrial controller designed to handle a wide range of control applications to improve productivity and reduce operating costs This small to medium sized PLC provides high speed processing of user control programs It comes with a complete line of I O and special function modules including digital analog communications and networking These features combine to provide the right solution for a multitude of applications e The D320 PLC is designed for medium sized control applications that require from 100 to 1000 control points high speed processing capability PID loop control and advanced functionality e High speed data communications capability is available through the use of dedicated peer to peer link modules e Built in dual program loader ports provide flexibility in design to accommodate simultaneous progra
103. LE READ WORD M000 M0127 receiving frame 3 3 Number Of Byte For Information 3 receiving frame 4 0xCO0 BASE M000 00c0 receiving frame 5 0 BASE HIGH receiving frame 6 128 Number Of Byte M000 M127 if communication 0 1 printf READ M0000 M0127 OK for i 0 i lt 127 i M i receiving frame i 2 4 receiving frame i 2 5 256 else printf communication error n JobID 10 Receiving If the frames that were sent have no response within 3 seconds assumes it failed communication and retransfers the data The time from the sending and receiving is counted using the watchdog timer Reset the watchdog timer when a retransfer is being made No response after 3 retransmissions indicates a communication error Normal return value 0 Abnormal return value 1 Reading Function of the register M Uses the communication function code number 3 reading N consecutive words to read the M area Note Sending frame 4 The lower byte of the abs address of the words to be read Sending frame 5 The upper byte of the abs address of the word to be read Abs address of the MO 0x0CO Note Sending frame 6 The number of words to be read 216 D320 PLC User s Manual void Kword_writing void Example of Write Register int i receiving frame 2 4 receiving frame 3 130 receiving frame 4 0x40 receiving frame 5 1 for i 0 i lt 63 i
104. NC 2 D M0005 INCB D M0008 9 of of of ofo E Te o of ofo i Ldk Toff ofof 2 he fofofo m ol of of Jo o LLddolols E Tobolol 10 Id fof do T4 of ofo il LJ JIi Ld fof Max FFFF 9995 Chapter 6 Instructions 101 Instruction Mnemonic Decrement Range DEC Decrement DEC DDEC LI Bit DDEC BCD decrement DECB DDECB E Word DECB E Double words DDECB Ladder D D 1 Decimal decrement D D 1 BCD decrement Description DEC and DDEC decrease D by 1 down to 0 when the input is On 2 DECB and DDECB decrease D by 1 in BCD to 0 when the input is On Word instructions DEC DECB process 16 bit data double word instructions DDEC DDECB process 32 bit data Example Program Expression Time Chart R000 1 LET RO 1 R0O 2 M10 decimal M12 BCD SS offe olofol LL fof sfofofo lolofolsfofofdto L 1 T7719 EM oooc T1T sees ooodqqd R000 2 ee Re ee gIgdd Pee ggg fee ee 102 D320 PLC User s Manual Arithmetic Instruction Details Instruction Mnemonic Addition Range ADD Decimal addition ADD DADD O Bit DADD BCD addition ADDB DADDB E Word ADDB E Double words DADDB Ladder D S1 S8S2 Decimal S1 21 and S2 22 Hexadecimal S1 15 and S2 16 ADD Example Decimal 21 22 43 ADDB Example BCD 15 16 31 Description 1 Add the data in the S1 and S
105. O Encode oom zZ nung Oo Store the location of the highest set bit in S in D 15 8 76543210 sLo o ep EDITO ofc 010 0 0 of d 1 65 7 DECO Decode ooo m iQ 9 Convert the low order 4 bit value of S to a power of 2 2 and store in D SEERE pL o ofojo 1jojo o o o 15 876543210 DIS Dissemble ozoo ao oO n Ww nw Separate Sr into Nd 1 units of 4 bits each and store in the low 4 bits of Sr UNI Unify c zoo aux Wow ou words starting at D N 0 3 Edo o pde nas D 80000 oTi o 1 g D 0000 HE ET o me 4 p a 000 fo 1 1 1 7 Combine the low 4 bits of Nd 1 words starting at Sr and store in D Nd 0 3 f Ls Pep roro 74 D320 PLC User s Manual Bit Conversion Instructions Mnemonic Command Word Double Word Description BSET Bit Set zow 7 m 4 Set Nth bit of D to 1 p bhh Tofo ee pes 1 BRST Bit Reset zow z nung 4 Reset Nth bit of D to 0 o E Peer N 3 em BNOT Bit Not zow z nua 4 Reverse state of Nth bit of D BTST Bit Test ZOW o 4 Set carry bit F1 8 to the state of the Nth bit of D p os T Jo Joo N 6 gt SUM Sum ooo ed uz Store the number of bits in S that are 1 in D s 500 PETE PLT ones 5 5 TESTS STE OPO 0 4 SC Set Carry no Oo Set carry bit F1 8 to 1
106. OBIL LEM UL M DEM IM MEL RADI R 87 Timer Co nter SR Instruction Details 4 S erret reed ree EE eee Re eee AE POTE eR CENTRE ETE 88 AIM CNET RE 88 TOE C ee eee e euo Mel e cM LM mu du du MM AE 90 LOrE D Serine ek MEL ee LM UM DM M vt On MIL E NE DEER 9 oim rr Po Te a E AAN 93 UDO M 94 d a er ea ER 96 Comparison Instruction Details ere tert Sore en Tb UR TE EVENT HEU aon ane ees 98 T oL MEME 98 Substitution Increment Decrement Instruction Details eese eene nennen nenne ener 99 I ZEE DIDI 99 ING DINGINCB DINGB eco soos eas eter ht epa tee ke teet Ee E Tee NE gv PU ee ORELL DEAD TS 100 DEC DDEC DECB DDECGB eter te ee ete be e dss ees ETE Hep EE TUR REPAS NETS 101 Arithmetic Instruction Details cette rete tee te ese eto ei evene os a Rae Ba no 102 ADD DADD ADDB DADDDB etcetera tete eeteve eei ese ur teu ete et eee eee essere 102 SUB DSUBSSUBB DSUBB acetone ae tesi nest i ees abs 104 MUL DMUL MULB DMUEB 6 0022 ette eere te ree heb d tee dug 105 DIV DDIV DIVB DDLIVB 2 eds Sok oth Mee at teen stor no Baal tem steps er LEE AE en ied 106 ADC DADG ADCB DADQGCB 1etredibte tene t epe be eet e hem edes 107 SBC DSBC SBCB DSBGB eundi eren tunes cid cele Me LER Lee 109 ABS DABS NEG DNEG NOT DNOT a a tisse tenetis sene ss iiis sete S 111 Eogice Instruction Details ees eoo eddie p neo ONU ERE 112 AND SDAIN D MANER N E ace EO e
107. OV D 1 110 1 0 110 1 0 D get 1 0 1 0 1 0 1 0 D 2 110111011101110 De ou 0 0 0 0 1 1 1 D 3 1 0 1 0 1 0 1 0 D 2 1 1 1 1 0 0 0 0 3 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 140 D320 PLC User s Manual Example Program Expression RO 0 MOV Operation Results Initial conditions Operation results MO 12AA hex M1 340F hex M2 56F0 hex K0 XXXX hex K1 XXXX hex MO 12AA hex M1 340F hex M2 56F0 hex KO 55AA hex K1 55AA hex W0 XXXX hex W1 XXXX hex W2 SXXXX hex K2 XXXX hex K3 XXXX hex WO 12AA hex W1 340F hex W2 56F0 hex K2 55AA hex K3 55AA hex Chapter 6 Instructions 141 Instruction Mnemonic Copy Bit Copy the Same Bit Range BMOV BMOV Copy a block of bits W Bit BFMV BFMV Fill a block of bits with the O Word patei valle L1 Double words Ladder BMOV Copy Ns bits from bit address Sb into bit address D BFMV Copy the V bit 0 or 1 into bit address D Ns times Description 1 BMOWV Copy a block of Ns bits starting at bit address Sb to bit address D This instruction is useful for moving large blocks of bits at one time or for copying sections of bits within a word without copyi
108. PLC The DOS based package is GPC5 the Windows based package is WinGPC In this manual GPC is used to refer to either of these programs Overview of CPU Operation Mode What Is the CPU Operation Mode The CPU has an external RUN REMOTE PROG switch The PLC performs a system check that determines the position of the switch The switch position determines which operating mode the PLC is in 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 Stop Mode The user program is stopped and the external outputs are turned Off In the Stop mode you can correct delete and transfer the program Remote Mode The Remote mode allows the user to switch between the Run and Stop modes using the GPC software instead of the mode switch It is a convenient tool for program debugging The Remote Stop or Pause mode is similar to the Stop mode using the switch but it does not initialize data Error Mode The Error mode occurs when the D320 PLC finds an error after running the self diagnostics When an error occurs the CPU stops program operation and turns off all external outputs When the Error mode occurs do one of the following e Check the error code and take appropriate measures then change power from Off to On e Put the mode conversion switch in PROG status
109. R4 NPS inde n network NNI station NN2 register type NN3 bit Fr NB5 display in hexadecimal NBx STATUS bit register address NR4 Description 1 NNI Link network number number NN2 Station number on the link network number NN3 Register type to write number 0 L register 1 M register 2 R register 3 K register 4 T C Setting Value SV 5 T C Present Value PV 6 W register 7 F register NR4 Bit address to write in hexadecimal form number register NBS Bit value to write bit 2 The link network loop number is a number from 1 to 3 The first link module in the base rack is assigned network ID 1 the second is 2 and the third is link network 3 3 The network bit address to write NR4 is represented in hexadecimal form where the low 4 bits indicate the bit number to write from 0 to F and the high 12 bits represent the word number For example to write the 5 bit of word 3 the value of NR4 would be 0035 4 The SENDB instruction can only by executed once in a given scan To prevent reading over the link network more than once per scan place the SENDB instruction at the end of the program Example Program Expression Operation Results F3 10 SEND Verify that the first link module has been installed F3 3 and sent through the first module F3 10 Then write the 1 bit of word 0 of register type R To 2 01 on link network 1 station 3 Nt 1 3 with the value of bit address F1 3 Fr
110. RC Rotate contents of designated DRRC carry D D register D to the right N times NT ER higherlower 15 D 0 F1 8 ROL Rotate left ROL DROL Rotate shift to the left N times DROL E D 5 lowerhigher j 7 Input F1 8 value for low bit 5 0 o 7E ROR Rotate right ROR DROR Rotate shift to the right N times DROR R gt a higherlower 7 7 Input F1 8 value for high bit SHL Shift left SHL DSHL Shift value of designated register D to DSHL ae ee the left N times Input O for low bit 15 s 9 To 7 9 SHR Shift right SHR DSHR Shift value of designated register D to DSHR p p 5 the right N times Input 0 for high bit Dig EE aL Word Conversion Instructions Chapter 6 Instructions 73 Mnemonic Command Word Double Word Description BCD DBCD Binary Coded Decimal now o nud D nog ies nO Convert binary number of S to BCD and store in D s olo Ep ph 9n p Lo dololo r ses BIN DBIN Binary w z li voU U z Convert BCD of S to binary number and store in D s Lbh fok holf 53 p lolol lolol d 3 XCHG DXCHG Exchange XCHG OUO NA u DXCHG D2 g Exchange D1 and D2 o EEEE o EEEE LIT oE SEG Segment ooo m nuQ Convert the low order 4 bit value of S to 7 segment display pattern and store in D 35 s Jofofofofof oT f a b oC fy Ic gfedcba d ENC
111. Read the bit value from link network Network To BR1 NN3 station NN4 register type NN5 M ee bit address NR6 and store to bit address BR1 SENDB Send data Link SENDB Read the bit value of NB5 and write it to link network NN1 station NN2 register type NN3 bit address NR4 78 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 Range Assignment expression LET Direct substitution of number L1 Bit DLET direct output of number E Word E Double words Explanation of Codes O unavailable option WB available option xx indicates a hexadecimal number Explanation of Table e Mnemonic A word instruction D designates double word instruction e Assignment expression Description of the instruction e Range Size of data that can be used by this instruction Sample Ladder RES SS D Destination ED S Source Example S MO and MO is 123 D R3 and R3 is 456 Before execution M0 123 R3 456 After execution MO 123 R3 123 Explanation of Ladder The ladder diagram shows the structure of the instruction as it is displayed Additional text typically gives an example and explains the processing structure Chapter 6 Instructions 7
112. Reset MCR End batch processing block Note NO Normally Open NC Normally Closed Timer Counter SR Instructions Chapter 6 Instructions 69 Mnemonic Command Ladder Description Remarks Symbol TIM On Delay Timer SENSU Turn on after set Time Base Ch 0 63 0 01s SM 900 delay time from Ch 64 255 0 1s input on Setting range SV 0 65535 input Done Contact TC channel no output j TOF Off Delay Timer apii Turn off after set Time Base Ch 0 63 0 01s SN S00 delay time from Ch 64 255 0 1s input off Setting range SV 0 65535 mut p Done Contact TC channel no SST Single Shot Timer 1 CH 12 Turn off after set Time Base A eee ci delay time from Ch 64 255 0 1s input on Setting range SV 0 65535 input L Done Contact TC channel no i UC Up Counter Up counter Range of channel Ch 0 to 255 Shared with timer aue Setting range SV 0 65535 ouput pm Done Contact TC channel no DC Down Counter Down counter Range of channel Ch 0 to 255 Shared with timer Setting range SV 0 65535 Done Contact TC channel no RCT Ring Counter Ring counter Range of channel Ch 0 to 255 input LLLLLLL LL Shared with timer pend mp Setting range SV 0 65535 Done Contact TC channel no UDC Up Down Counter Up down counter Range of channel Ch 0 to 255 input IL MO Shared with timer present brvans po DA Setting range SV 0 65535 Vi output I
113. Since rubbing action can cause the build up of static electricity the best protection is to have the electronic equipment enclosed in a grounded housing that requires the user to first make contact with a safe discharge path In high static environments like styrofoam manufacturing or glass manufacturing electronic equipment should always be protected from static electricity Chapter 9 External Dimensions 193 External Dimensions This chapter provides the D320 PLC system dimensions It includes diagrams of the modules with their dimensions This chapter contains e The system dimensions Note Dimensions are rounded to the nearest 0 05 inch 194 D320 PLC User s Manual System Dimensions Base Backplane 3 95 in 5 95 in 100 mm 150 mm Reexecc4es d d TET 4 75 in 120 mm Slot type Dimension A B 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 435 mm 16 55 in 420 mm Expansion Backplane Chapter 9 External Dimensions 195 5 95 in 150 mm
114. Stop Circuit Safety measures in system design In any PLC application abnormal and potentially dangerous operation can occur These system malfunctions may result from power surges brownouts blackouts shorted or opened I O devices or any type of system component failure Any errors of the PLC the external power source and or external devices can cause a system malfunction The potentially dangerous effects of these errors on the whole system can be prevented with proper safety precautions The use of properly designed safety circuits external to the PLC will protect against both equipment damage and human injury Interlock Circuit An interlock circuit can control and prevent problems such as those caused by unexpected or reversed operation of a motor Install the interlock circuit external to the PLC control wiring and circuitry Emergency Stop Circuit Every industrial control application involving electrical or moving parts should be wired with an emergency stop circuit The emergency stop circuit turns off the power immediately to all output devices in the system The emergency stop circuit should provide independent power cutoff from the PLC system Chapter 4 Installation and Wiring 25 Power Up Sequence In a properly designed control system the default Off state of the system is the safe state in which no machinery is operating Before the PLC is powered up line power and control power are applied to the system Once the s
115. Value are scaled to an application specific range as defined by words 17 and 18 of the PID parameter block These scaled values are used for the PID loop calculation When set the derivative term of the PID control equation is based on the derivative of PV with time When not set the derivative term is based on the derivative of the error value Enables the reset wind up control This can be used to limit an overreaction to a large change in SV or at startup Bit is set when the PV is within the DB range of the SP Bit is set when the calculated CV is above CVmax Bit is set when the calculated CV is below CVmin Bit 1s set under the following conditions PID Block Start Address SR008 gt 1792 Scale Parameter Smin Smax Kp Ki Kd values are 0 Dt 7 0 CV Calculation is above maximum Bit 1s set when the PID calculation is in WindUp large accumulated error term SETPOINT PROCESS VALUE CONTROL VALUE CONTROL VALUE MAXIMUM CONTROL VALUE MINIMUM PROPORTIONAL INTEGRAL DERIVATIVE FEEDFORWARD SAMPLING TIME DEADBAND 223 The desired value for the Process Value PV 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 The automatically or manually calculated value of the PID loop used to adjust the PV This is normally tied to an analo
116. a surge absorber in the power line in front of the PLC to prevent damage from lightning The surge absorber will clamp the unwanted high voltage and prevent it from flowing to the PLC power supply When specifying a surge absorber the present wiring system must be carefully reviewed Some surge absorbers are designed to be placed into the main power distribution panel while others are designed to be installed in the field close to the PLC It is always best to place the surge absorber as close to the PLC as possible e Surge absorbers can consist of either series resistors with capacitors that will couple the spike to ground or Zener diodes that safely clamp the high voltage spikes or MOVs Metal Oxide Varistors Some surge absorbers will need replacement after they have suppressed a spike similar to a fuse Others can be reset In specifying a surge absorber consider how often the surges are occurring and the maximum amplitude in volts or joules AC power Special ground Less than 20 Triple ground Less than 20 of ground resistance of ground resistance It is needed to prevent high voltage noise 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 CHSAO01 490 V Cutler Hammer 120 240 V power Burying Wire
117. ads can damage the output module before the internal fuse blows Be certain to provide the proper level of short circuit protection for a given output type Leakage Current When using an SSR output to a load that draws a very low level of current leakage current in the SSR output may cause a load not to turn Off To prevent this problem connect a properly rated resistance in parallel with the load Resistance Output Module Output Terminal COM Terminal Installation Precautions for I O Modules T O and Power Cables e Separate the wiring of the I O cable and the power cable as far as possible Do not put the two cables through the same duct e Leave 4 inches 100 mm or more between the following J O wiring Power cable High voltage cable Chapter 4 Installation and Wiring 39 Module Cover e Remove module cover of I O module as shown in the picture below e With the connector type unit for example the 32 point digital I O modules the connector hood may be used in place of the module cover mbetet EM Y Module cover T f ir als Fi 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 0 3 in 03in A 7 2 mm 7 2 mm Removing Terminal Strip
118. aeeaeenaecaaecaeceeeneeenes 47 Run Mode operatimp cete dope E gens tonne a tu egi eet e irr Eee De EE 47 Stop Mode 25 on eise tege e a euge Ri stetisse De Rn 47 Remole MOde nee ntt ure dp e a rp tape die RE e CE E 47 Errors Mode 3a de dE PEU RR ise UE APORTE eer Bush S 47 CPU Processing Procedure esser p ere sterii ise ees tere reete Eo e Ua pw 48 Program Processing Procedure uses use Ue D UR HERE EEUU 48 Introduction to Registers cese ete RE E E e dire de Ie Ue Ue Fe Te Ee ERR ERR 49 Internal External Address Designation e eise re ie rre ee ne EEE EE 50 Expression Example 2 eedem nee e REID dore e de IHE Ur Te EA EEE EE 51 Double Word Address Designation trece ie iH rr e Te Re RETE iE 52 Absolute Address Designation eiecit ee eee eU eset di EEE RE EEE 53 VO Address Designation resi e reete Re EEE Me Re de UR ER ARRA EA RR RETE E SERRE 54 Special Internal Addresses needed eee e e EE or ede EI EEE 55 Timer Counter TC0 255 issue rece e RUE de Ue EYE ENT UTER E SEO TERRA TRETEN ERES 63 Chapter 6 Instructions 67 Basics Instructors 34s Io rs e Siders de rentar ioo re gukivens oes niti i d esee te eese ede eet io fontes 1s 68 Tamer Counter SR InstE ctions o io Bad lend ean Ier OR RUP reser Ri ae eee eS 69 Comparison Instr ctlons 5 stg t teta ie te dens triple uglr qres tese repe ed de p SETS 70 Substitution Increment Decrement Instructions emen eene en enne eren enne ne en
119. aling Mode Setting O Not scaled 1 Scaled 6 Derivative Operation Setting O PV 1 Error Factor used in Kd term 7 WindUp Function 0 Disabled 1 Enabled Not Currently Supported 8 Deadband state flag 9 CV Overrange error flag Not Currently Supported 10 CV Underrange error flag Not Currently Supported 11 Parameter Setting Range error flag Not Currently Supported 12 Windup state flag Not Currently Supported 13 Reserved 14 Reserved 15 Reserved 222 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 Normal Reverse Oper Output Limiting Scaling Mode Derivative Term WindUp Function Status Bits Deadband State CV Overrange CV Underrange Parameter Setting WindUp State Defines PID equation used in calculation Currently the ISA form is not yet supported so this bit must be set to 0 In Reverse mode Bit 1 the PID equation acts in the opposite direction as the process value that is a positive error change in PV results in a negative movement in CV In Direct mode Bit 0 the action is in the same direction When this bit is set CV is limited by CVmax and CVmin Otherwise CV will change over the entire possible range 0 32767 When set Bit 1 the Process Value and Control
120. alize memory e Initialize the CPU module using GPC This clears the program on the PLC Check l O wiring e Check the LED of the input modules and use the monitor function of GPC after testing the input device e Check the wiring of the output by turning the output On Off using the monitor mode of GPC set CPU module to Run mode Programming e Check the input program e Download the program into the CPU module Testing e Check the Run LED for illumination by setting the mode switch of the CPU module to Run e Check the sequence operation Correct e Correct any program errors programming e Program is stored Store program e Store the program onto a floppy disk or similar storage device and place in a secure place e Record the PLC type program capacity name of installation and date for the recorded program e Print the program ladder mnemonic and store it in a secure place 170 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 Is power supply LED illuminated Is CPU module Run LED illuminated Yes Is CPU module Error LED Is I O module operating normally Yes Is the extemal environment Yes Replace the faulty module Correct the control program logic Yes Go to the power supply check flow chart
121. arting address of register to read number register 2 The link network loop number is a number from 1 to 3 The first link module in the base rack is assigned network ID 1 the second is 2 and the third is link network 3 The SEND instruction can write up to 56 words at a time NR5 to 56 The SEND instruction can only by executed once in a given scan To prevent writing over the link network more than once per scan place the SEND instruction at the end of the program Example Program Expression Operation Results E3a E346 Sup Verify that the first link module F3 3 has been installed KH and sent through the first module F3 10 Then write two words from RO Fr 2 RO to link network 1 station 4 Nt 1 4 register type R address 4 To 2 4 162 D320 PLC User s Manual Instruction Mnemonic Bit Data Receive Range RECVB Bit data receive command using LI Bit link network B Word O Double words Ladder NNx number 1 to 3 Read the bit value from link network NN3 station NRx number register in case of number NN4 register type NNS bit address NR6 and store display in hexadecimal BR bit register to bit address BRI Nt NN3 NN4 Fr NN5 NR6 Description 1 BRI Bit address to write bit NN3 Link network number number NN4 Station number on the link network number NNS Register type to read number 0 L register M register R regist
122. ata e The type of instruction used determines whether the register is processed as a single word or a double word For comparison instructions gt lt etc the programmer must be in Double Mode to enter a double word comparison refer to program loader manual for details For application instructions those instructions that start with a D in front of the related word instruction are double word instructions and process the data as 32 bit double words Example 1 Word CET WO is processed as 16 bit 1 word data 0 to D WO z 65 535 S 7000 S is processed from 0 to 65 535 Double word DLET Double word WO is composed of WO and W1 D W0 WO is the low word W1 is the high word S 70000 W0000 is W0001 W0000 Example 2 M0000 M0001 Range when double word instructions are used M0002 Example 3 Comparison Instruction WO0005 The example shows comparison instructions being used in the single mode lt M0003 of GPC The parameters W0005 and M0003 represent 16 bits of data D WO0005 In this example GPC is in double mode and comparison instructions are M0003 used W5 is made up of W5 and W6 M3 is made up of M3 and M4 The comparison is performed on 32 bits of data Chapter 5 CPU Operation and Memory 53 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 prog
123. ations and component functions of the CPU This chapter discusses e The environmental operating ranges for the D320 Series products e The performance specifications of the CPU e The name and function of CPU components 18 D320 PLC User s Manual Environmental Operating Ranges Item Specifications Ambient Operating temp 0 to 55 C 32 to 131 F 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 Breakdown voltage Between AC external terminal and earth AC 1500 V for 1 min Between DC external terminal and earth AC 500 V for 1 min Insulation resistance Between AC external terminal and earth AC 1500 V for 1 min Vibration resistance 10 to 55 Hz 1 min amplitude 0 75 mm each direction of X Y Z for 10 min Insulation resistance Over 98 m S X Y Z each direction 4 times Noise resistance 1500 Vp p pulse width 50 ns 1 us according to noise simulator method Usage condition No corrosive gas or severe dust conditions Chapter 3 Product Specification CPU Performance Specifications 19 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 instr
124. ause severe damage to the circuit In most cases the summation of the currents cause errors in readout and control values Some sources of this kind of noise are relays magnetic contactors inverters computer monitors and motors Noise from Power Cables When various loads are connected to a single power source the current draw conditions and impedance imbalance can cause unwanted noise The noise created by these sources can affect other devices connected to the power source via spikes sags reflected high speed switching noise and ground pulse This is the most frequent cause of noise in a PLC s environment Noise from Natural Causes and Work Practices Lightning welding shared cable trays grandfather d plant wiring and static electricity can also be sources of noise In the first case the noise is caused within the equipment and is called internal noise In the second case the noise is caused by external factors and referred to as external noise These two types of noise may also be referred to as artificial system noise The noise caused by natural occurrences can not be prevented but can be controlled Precautions such as good grounding techniques surge suppressors and burying cables underground can help minimize the affect This type of noise may be referred to as natural noise 184 D320 PLC User s Manual Advised Installation Practices Shield the PLC The most common method of shielding is to install the PLC
125. b V 0 1 Ns v 0 1 15 76 D320 PLC User s Manual Block Processing Instructions Mnemonic Command Word Double Word Description FOR For Loop FOR DFOR Begin execution of instructions DFOR D D between FOR and corresponding NEXT Repeat execution D times NEXT Next NEXT Decrease D of FOR instruction by 1 If not zero repeat from FOR Instruction JMP Jump JMP Jump to LBL instruction L M L 0 to 63 LBL Label LBL Position jumped to by JMP L instruction L 0 to 63 JMPS Jump Start JMPS Jump to JMPE instruction JMPE Jump End JMPE Position jumped to by JMPS E instruction CALL Call Subroutine Call subroutine Sb CALL em Sb 0 to 63 SBR Subroutine Start SBR Start subroutine ul Sb 0 to 63 RET Subroutine Return RET End subroutine Returns execution to M instruction after CALL INT Interrupt IN Begin block of constant cycle scan Ni instructions Ni 1 to 999 20 msec 10 sec Constant cycle time Ni 1 x 0 01 sec RETI Return Interrupt RETI End block of constant cycle scan M instructions Special Instructions Chapter 6 Instructions 77 Network Nt NN1 NN2 To NN3 NR4 Fr NBS f Mnemonic Command Word Double Word Description INPR Input Refresh INPR Refresh external input get input Ch signal during
126. bsolute LI Bit DSTO address D D e Sr E Word E Double words Ladder Store the data contained in the Sr register into the register pointed to by the absolute address contained in register D RO word absolute address 0 decimal MO word absolute address 192 decimal WO word absolute address 512 decimal Description 1 This instruction is useful in storing data patterns from a single input register to a sequential table of registers in memory For example if the process measurements DO to D99 from an input module located at address R001 needed to be stored in register addresses W100 through W199 The STO instruction can be used to load the data from the source register ROO1 to the absolute addresses of W100 to W199 absolute addresses 612 to 711 2 Inthe example below register WO is used as the D destination register which contains the absolute address of the locations to store the process measurements Initially WO contains 612 which is the absolute memory address of register W100 As WO is incremented it successively points to the next higher W register to store data 3 See Chapter 5 Absolute Address Designation for a complete table of absolute addresses Process Register Register R001 Input Measurement Absolute Value Module Address b TE ere 88 ore the process DO W100 612 88 measurement data 34
127. bstitution ET oe Store value of designated register S DLET into D INC Decimal increment De Be D value increased by 1 whenever DINC 7 7 input is On DEC Decimal decrement DEG B D value decreased by 1 whenever DDEC B d input is On INCB BCD increment DeB D D value increased by 1 BCD DINCB B i whenever input is On DECB BCD decrement PEER pores D value decreased by 1 BCD DDECB 7 7 whenever input is On Arithmetic Instructions Chapter 6 Instructions 71 Mnemonic Command Word Double Word Description ADD Decimal addition a DOE D S1 S2 DADD S1 S1 Decimal operation 2 S2 SUB Decimal subtraction s as D S1 S2 DSUB S1 S1 Decimal operation S2 S2 MUL Decimal Dee ee D S1 x S2 DMUL multiplication Sie ens Decimal operation DIV Decimal division zm n D S1 82 DDIV S1 S1 Decimal operation S2 S2 ADDB BCD addition De ires D S1 S2 DADDB S1 S1 BCD operation S2 2 SUBB BCD subtraction Supp ee D S1 S2 DSUBB S1 S1 BCD operation S2 S2 MULB BCD multiplication DE EE D S1 x S2 DMULB s1 St BCD operation S2 2 DIVB BCD division opie dos D S1 S2 DDIVB S1 S1 BCD operation S2 S2 ADC Decimal addition ne sey D S1 S2 CY DADC w carry S1 S1 Decimal operation include carry S2 S2 SBC Decimal subtraction DES ar
128. ccurate processing input should continue for more than 1 scan time The processed program outputs are sent from the internal memory to the external modules Watchdog time initialization The watchdog elapsed time value is set to 0 This value is the watchdog calculation point until the next scan Chapter 5 CPU Operation and Memory 49 4 Program analysis Executes the program from its first step to its final step and stores the internal external output in the working RAM 5 Peripheral device signal processing Stores data from communications module or peripheral device in the internal memory The following illustration shows the difference between the relay board and PLC sequence processing The relay carries out all sequences simultaneously while the PLC processes sequentially throughout the program TCO R15 0 OUT Processing of relay sequence Processing of PLC program parallel process serial process Introduction to Registers The D320 PLC has a series of registers for storing data Different registers store different types of data 1 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 The address and number of R registers used by the I O module is determined by the type of module and its location on the I O backplane 2 M Memory register Can be bit word or double word An internal bit memory ad
129. count pulse input If the reset input R input is On the output is Off In this state the up down counter input pulses are ignored and the Present Value stays reset to O When the up count input pulse and the down count input pulse occur at the same time the PV does not change When the PV is 0 if the down count pulse is input the Present Value does not change and the output is On When the Present Value is 65 535 even if the up counter pulse is input the Present Value 65 535 is maintained When the counter Set Value is 0 if the reset input is On then the output is Off If up or down is input while the reset input is Off the output changes to On The timer counter channel can only be used once It cannot be reused by other timer or counter instructions TIM SST TOF UC DC RCT The number of channels available is 256 Ch 0 through Ch 255 The SV can be set to a maximum value of 65 535 A CAUTION This instruction operates differently than the UDC instruction of the Cutler Hammer D50 D300 PLC Please read and understand the above information before using Chapter 6 Instructions 95 Example Program Expression Time Chart U input pose DEDE STA Down Input RO 1 Reset Input TC15 i Present Value PV64 0i1 obu aesy ed 96 D320 PLC User s Manual Instruction Mnemonic Shift Register Range SR Shift Register E Bit L1 Word L1 Double words Ladder condi
130. culated in the following equation the Off voltage of the input 1s 2 5 V and power voltage is 24 V I7 24 2 5yr Alternatively the value of I can be experimentally calculated by simply measuring the current draw of the sensor during use Once I is calculated the bridging resistor specification can again be calculated using the following equations R 7 5 31 2 5 kQ W Power Voltage R x 3 to 5 times LED Reed Switch When using a reed switch with an LED On Off indication the voltage going into the input terminal should not exceed the On voltage under normal Off conditions No type of bridging resistor 1s required LED Reed Switch DC Input Module Terminal Over 10 V 9 Terminal 12 to 24 V Chapter 4 Installation and Wiring 37 Digital Output Module Wiring Check Points e 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 e For inductive and capacitive type loads a protective circuit can be installed to prevent damage to the module through feedback discharge on Open Close See the below diagrams e Use the output modules only within the specified ranges of operation Inductive Loads e Foran inductive load connect the p
131. dress which supports relay logic operations Can also be used as a word or double word variable for general calculations and programs M Registers are non retentive when the power of the PLC is Off or the CPU has stopped the register value is reset to 0 3 W Word register Can be word or double word Used for general calculations data storage and recipe values Values are preserved after the power is turned off but can be cleared by program downloads or special command words 4 K Keep register Can be bit word or double word Same usage as M registers The K Registers are retentive the value is preserved when the power is turned off 5 F Flag register Only process bit These bit registers provide special application specific functions to the programmer of the PLC They are also used as diagnostic and system control bits providing Run Stop control of the PLC and other system conditions 50 D320 PLC User s Manual 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 Each type of register is used for a variety of purposes The register used will be determined by the type of function being performed 1 When a calculation or input value exceeds 65 535 F FFF use double word instructions which can store and calculate
132. e Check that I O module is firmly fixed e Check that the power cable connection is secure e Check that the cable size is correct Grounding e Check that the grounding is triple grounded and separate from other device grounds Battery e Check that the battery is installed into holder on CPU module e Check that the battery fail Batt LED is not illuminated Emergency stop circuit e Check that the emergency stop circuit for problems external to the PLC is wired accurately and will IMMEDIATELY disconnect power on demand Power source e Check that the power and voltage sources are within specifications For 110 VAC 90 to 132 VAC For 220 VAC 180 to 264 VAC e Check that the power to the AC input module is within specifications 167 168 D320 PLC User s Manual Testing Procedures When the PLC has been installed and wired begin testing in the following order Supply Power Initialize Memory Check I O Wiring Programming Testing Correct Program Store Program END Chapter 7 Testing and Troubleshooting 169 Item What to Check Do Power source e Check that the input voltage to the power supply is within specification e Check that the control voltage to the I O modules is within specification e Turn on the power source e Check the LED display of the power module Initi
133. e configuration and programming required to properly implement a PID loop control application 218 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 ACV KE K fEdt Kq AE At Bias A closed loop system is characterized by an ability to compare the actual value of a process variable PV with its desired value Setpoint SP and to take the necessary corrective action Output The calculations required to do this smoothly are beyond simple arithmetic and comparison functions Figure contains a block diagram of a typical closed loop system PROCESS VARIABLE Xu PROCESS OUTPUT ERROR SETPOINT SIGNAL P gt COMPARATOR P CONTROLLER Figure 1 Closed Loop System The PLC must process the input signals for process variable PV and setpoint SP calculate the error E SP PV and change the output or control value CV The PID control function is designed specifically to do this PID Algorithm in the D320CPU320 The D320CPU320 hereafter referred to as the D320 contains the capability of performing PID control on up to eight separate closed loop systems These loops independently o
134. e given terminal on the cable Refer to the tables below for I O addressing by connector Flat cable 1 li ll I Chapter 4 Installation and Wiring 41 I O Address Cross reference Table D320DIM3224D D320D0M3224D 0320DOM3200R Connector I I O Point D320DIM3224D D320DOM3224D D320DOM3200R 11 R0 0 R0 0 R0 0 12 RO 1 RO 1 RO 1 13 R0 2 R0 2 R0 2 14 RO 3 RO 3 RO 3 15 RO 4 R0 4 R0 4 16 RO 5 RO 5 RO 5 17 RO 6 RO 6 RO 6 18 RO 7 RO 7 RO 7 19 RO 8 RO 8 RO 8 110 RO 9 RO 9 RO 9 111 RO 10 RO 10 RO 10 112 RO 11 RO 11 RO 11 113 RO 12 RO 12 RO 12 114 RO 13 R0 13 R0 13 115 RO 14 RO 14 RO 14 116 RO 15 R0 15 R0 15 117 COM1 COM 118 COM1 COM 119 COM2 COM 24VDC 120 COM2 COM 24VDC Connector Il 1 0 Point D320DIM3224D D320DOM3224D D320DOM3200R 11 R1 0 R1 0 R1 0 12 R1 1 R1 1 R1 1 13 R1 2 R1 2 R1 2 14 R1 3 R1 3 R1 3 15 R1 4 R1 4 R1 4 16 R1 5 R1 5 R1 5 17 R1 6 R1 6 R1 6 18 R1 7 R1 7 R1 7 19 R1 8 R1 8 R1 8 110 R1 9 R1 9 R1 9 111 R1 10 R1 10 R1 10 112 R1 11 R1 11 R1 11 113 R1 12 R1 12 R1 12 114 R1 13 R1 13 R1 13 115 R1 14 R1 14 R1 14 116 R1 15 R1 15 R1 15 117 COM1 COM 118 COM1 x COM 119 COM2 COM 24VDC 120 COM2 COM 24VDC 42 D320 PLC User s Manual Alarm Output of Power Supply Alarm Output Power Supply e The alarm output on the power supply turns On when the PLC is in Error
135. e ground connection with other devices can cause problems due to ground loops and current feedback 32 D320 PLC User s Manual e 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 e Ifthe PLC system is not earth grounded the LG and FG terminals must be kept separate to prevent ground loops in the power supply system device device WM MM 111 Right Wrong 120 240 VAC Power Supply Wiring Diagram If the noise effect is large use an isolation transformer dessedeerdeeseseseesseng ap i COCOA a 7 i i 9 Use 14 AWG or thicker a9 3 NEUE PERT CHER C S ili E Ej EX Le Control power EA FG EX 24v Breaker 24N E aL Ed com Ne dea Power supply I O module i Connect alarm output iemergency stop circuit e o B r E EH LG PT mal ES Control power 3 all save 24 V ES o E um M E ou can supply 24 V power to the I O 6 Le od
136. e in the yy mm dd format Use the direction key to select the year then enter 98 e Move using the direction key to select the month day and week and enter the current information e Tab the cursor to Done and press Enter to set the entered information e Use the same procedure for setting the hour minutes and seconds 8 The RTC can be set using WinGPC as follows e Go online with the D320 by clicking on the Online button on the toolbar or by selecting Online from the Online menu e Enter the PLC ID or 255 for direct connection and password and click the OK button to go online e Once connected to the D320 PLC select Status Monitoring from the Monitoring menu e Click on the RTC Date button to open the Date window Enter the current year month and day and select the day of the week Click the OK button to accept the values and change the data in the PLC e Click on the RTC Time button to open the Time window Enter the current time in 24 hour HH MM SS format Click the OK button to accept the values and change the data in the PLC 9 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 Register SR289 is provided as a convenience for holding a four digit representation of the year Chapter 5 CPU Operation and Memory 63
137. eated during the installation of an electrical system When excess cabling is left wound up this creates stray inductance in the form of a coil All cabling inherently has a capacitive rating so many picofarads per meter Excessively long cable runs or untrimmed cable lengths or poorly specified cable types can add large levels of stray capacitance Chapter 8 Troubleshooting Noise Problems 183 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 1 Noise Generated by Electronic Equipment All electronic devices radiate noise in the form of a magnetic field The magnetic field is created around the printed circuit board or the wiring of electronic devices due to the flow of electrical current The amplitude of the magnetic field changes over time due to changes in the flow of the electrical current The magnetic field strength increases as the amount of the electrical current flow increases As a device crosses the magnetic field electrical currents will be induced The induced current could be summed vectorially with the normal electrical currents In some cases this could cause cancellation of electrical current flow essentially shutting down the circuit In other cases this could create large surge currents that c
138. ec voces cette RE E E E gore te eoi mt vss 184 Ground the BEG coetui tete de eo estu ee 184 Isolation and Filtering Techniques cccccccesccsseceseessecsceeseeeseeeeeeeeeseeeseceseceaeceaecaaecaaecaeeeaeeeaeeeeeeaeeeaeeeeeseeenreeas 185 EESTI 185 i eRe Ee ete ele edd teta esistere sees d 186 Methods of Handling Large Voltage Spikes Such as Lightning sse 187 Surge Absorber ien eee diede tene edic e tie ite S pee eese c Reda 187 Burying Wire e needs eai e HER I eei re RI WEE e USED TEUER S 187 Table of Contents ix Shielding Cabling 5o mto eto edet e e tdoitstattise aU IRR NAR 188 Switehing Noise Grosstalk eere tr t e p pet oper teer tede ede ete e gap uen e AR ede 188 Methods to Handle I O Inductive Loads ssssssssssssseeseeeeeeen eene enne enne nennen nennen 189 ENMDDISM ees 191 Troubleshooting aee ice HERE Re UTR HORSE REN ETE SUL AR ERU E E 192 Chapter 9 External Dimensions 193 System Dimensions ct eee te oie deti ede ice ee e pv e dc pee eda 194 Base Backplame irc sec ccc ci eee eee E C HE eee REO ie Ore re RE en 194 Expansion Backplane oe eee GR E EU REG GO e ERR 195 Power Supply Module Dimensions esses nennen nnne enne enne E nier E Y 196 CPU and Remote I O Slave Module Dimensions sssssssssseseeeeenenen enne enne 196 I O Module and Intelligent Module Dime
139. ee at shar te Seacrest reer sts tah Soe Rael steel ue cee tna ETE fo to 112 OR DORM tcc teen Rotten Rae A at LR Be ehe oL Mees E cune co Ree Rog eth ant oe Pea Beka fests ttl 113 X ORD Ris sects eect at art at ek E aes shar te Slt Rael Been tees vot etc Satu we che E 114 PAD NSQNE ETE 115 Rotation Insteuctiom Details ete etit De ede eor eode eee lee ie tete ee ie Pestis 116 REG DRE OD EE ruris dro Adv LN M Ld E LAET IE IM PE REL ded ede 116 RRG DRRGC etin osse M sg ces ie Mots 2g ea mies iat ca ids serm e 117 ROL DROD 3 shin tek eee teen eet Ri titi Ait on oti ds SE PINE es 118 ROR TOR OR oti iss alte DEDERE EAE 120 SDS Fils S sant ot ease ee I A ree ic a MONE ee oe Mei SO MU hort eM I A 121 SHIR SHIR ei sists oe edu MEINT gee fede ee MA EM NM Lid Ae ON eed ON ra 123 Word Conversion Instruction Details 0 cccccccccccccessccceesssceceessececssceceessececsessececsseeccsesaeeccsessececssnseeesenseeeeesaeens 124 BCD DBCD BIN DBIN eeeeeeeee nee enne nene nrnnnnre erri nnne erri nens eene n eine e enin enn einn ee ten eere e tenen 124 XCHGDXCHQ ess EAER EE EET EEEE dritte de tpe ot E a ederet e Gre er eda ceu eris 125 SEGUE o oun NM ADT SUR BAT LAM ac ttem iMac ERRA ADEE AN Mm IN ia EON b e Ed 126 ENCO DEG Orc a aes Ns heise ms he share INA ae I aed NAN ERR 127 JOIS OT Ue ee tO aR ERC RRO EDS eC AU PN Mete iM irte DE uda 129 Bit Conversion Instruction D tails erre eee te RE aS 131 BSEP3BRSTSBNOTSBEST ctetu E
140. er K register T C Setting Value SV T C Present Value PV W register F register n ON tA RU rb2 NR6 Bit address to read in hexadecimal form number register 2 The link network loop number is a number from 1 to 3 The first link module in the base rack is assigned network ID 1 the second is 2 and the third is link network 3 3 The network bit address to read NR6 is represented in hexadecimal form where the low 4 bits indicate the bit number to read from 0 to F and the high 12 bits represent the word number For example to read the 5 bit of word 3 the value of NR6 would be 0035 4 The RECVB instruction can only by executed once in a given scan To prevent reading over the link network more than once per scan place the RECVB instruction at the end of the program Example Program Expression Operation Results F33 F3 10 AEGUB Verify that the first link module has been installed F3 3 Zl ur and sent through the first module F3 10 Then read the Fr 7 0012 2 bit of word 1 of register type F Fr 7 0012 from link network 1 station 4 Nt 1 4 and write to bit address R2 0 To R2 0 Chapter 6 Instructions 163 Instruction Mnemonic Bit Data Send Range SENDB Bit data send command using the L1 Bit link network B Word O Double words Ladder NEE NNGNND I NNx number 1 to 3 Read the bit value of NB5 and write it to link To NN3 N
141. er PID control PID operation mode and operation stop control flag Channel 4 5 6 7 56 D320 PLC User s Manual F0 0 to F0 15 FO word register System Diagnostic Functions Address Function Details Remarks F0 0 System check When power is applied the system runs self diagnostics Should any fault exist the error lamp is turned on Output and operation are halted Normal Off F0 1 CPU ROM check When power is applied the system self checks the ROM Should any faults exist the error lamp is turned on Output and operation are halted Normal Off F0 2 CPU RAM check When the power is applied the system self checks the RAM Should any faults exist the error lamp is turned on Output and operation are halted Normal Off F0 3 User program memory error If the user program memory is damaged or the program is faulty the error lamp is turned on Output and operation are halted Normal Off F0 4 Program check The CPU initially runs and checks the user program s syntax In the case of an error the error lamp is turned on Output and operation are halted Normal Off F0 5 Module range error Indicates an invalid R address 7127 used Normal Off F0 6 Module change error On when an I O module is removed added fails while the system is running The error lamp is on and the CPU keeps running Turned off
142. external 24 VDC provided by the D320 power supply Avoid system faults due to programming errors by reading and fully understanding this system manual and the PLC instruction set Perform regular preventive maintenance on installed systems checking devices and wiring for potential breakdowns and failures D320 PLC User s Manual Chapter 2 System Configuration 7 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 e Information about the D320 PLC system components e Descriptions of the line of D320 PLC products e The D320 PLC I O configurations e The D320 PLC backplane configurations D320 PLC User s Manual D320 PLC System Components Remote I O Slave Module Sa P CPU Module Power Module AC DC Base backplane Expansion backplane 3 5 8 slot 5 8 slot Analog A D D A RTD T C HSC Module Remote I O Master Module 16 32p Digital I O Module we a r 4
143. f If the input is Off the output 1s Off Valid channel numbers Ch 0 through Ch 255 256 channels Done contact TC channel number Description 1 Ch0 to Ch 63 Time base 0 01 sec 10 msec Ch 64 to Ch 255 Time base 0 1 sec 100 msec TIM SST 2 Theoutput done contact of the timer is TC channel number 3 The channel number can only be used once It cannot be reused by other timer or counter instructions TOF UC DC RCT UDC 4 Tochange the Set Value or Present Value of the timer while the program is running modify registers W2048 to W2559 In GPC you may also reference these registers using the PV or SV designation 5 The Present Value PV is reset to zero when the input is Off in Stop mode or when power is off Chapter 6 Instructions Example Program Expression Time Chart TIM ROUD O TCH 25 K SV 70 R000 0 E 0 7 sec R000 1 ELE TC25 T CH 200 SV 70 R000 1 Lo ER 1l1 TC025 M11 5 Teei m OUT i TC200 ee d TC200 M22 5 pL ou 89 90 D320 PLC User s Manual Instruction Mnemonic Timer Range TOF Off delay timer W Bit L1 Word O Double words Ladder H Ra While the input is On the timer output is On For t seconds t 9M SV x time base after the input turns Off the output stays On Unlike the TIM and SST instruction in which the PV counts up from 0 the timer elapsed value PV decreases from SV when the input
144. f 9452 1001 1010 0101 0010 is 65AE 0110 0101 1010 1110 The absolute value of 7A52 0111 1010 0101 0010 is 7A52 2 The NEG 2 s complement instruction is expressed as the 1 s complement 1 For example NEG of 7A52 0111 1010 0101 0010 is 85AE 1000 0101 1010 1110 3 The NOT 1 s complement instruction is performed by reversing each bit For example NOT of 7A52 70111 1010 0101 0010 is 85AD 1000 0101 1010 1101 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results ROO Initial conditions W0 9A52 W1 7A52 W2 7A52 W3 7A52 Operation results W0 65AE W1 7A52 W2 85AE W3 85AD 112 D320 PLC User s Manual Logic Instruction Details Instruction Mnemonic Bit AND Operation Range AND Bit AND operation LI Bit DAND E Word E Double words Ladder Process each bit of S1 and S2 in bit AND operation and store the result in D 1 2 D 0 0 0 0 1 0 1 0 0 1 1 1 Description 1 Process the values of the S1 and S2 bits word double word in bit AND operation and store the result in D For example S1 00FF hex S2 3333 hex D 0033 hex s ofololoJofolofoh bth bhhh AND s2 ofo 1 o o 1 of o T To To 1 1 D gt p of
145. ff 00 The size and location of the and if Ax denotes a word address the Dx data is 1 word 2 bytes returned data depends on the combination of bit word addresses requested The Lx parameter should be checked to verify data size 210 D320 PLC User s Manual Write Bits and Words e Changes the content of the bits or words at the specified absolute addresses e Words and bits may be modified regardless of their order and location in memory Query Q Frame AO A1 CRC DA SA 06 L L H DO L H L H Methods of assigning bit word absolute address Assigning abs address for bits 15 14 13 0 Ax 0001 1011 1111 1100 BE Absolute Address Ax L FC H 1B When structuring the Assigning abs address for word outgoing frame be aware O O Bit Address Abs address for the K127 word 01BF that the Dx of the Q 0 1 Word Address Ax 0100 0001 1011 1111 changes according to the 1 x Not Used Ax L BF H 41 bit word Ax type and the L information length changes as well The Dx will be either 1 or 2 bytes If Ax denotes a bit address the Dx data is 1 byte On FF Off 00 and if Ax denotes a word address the Dx data is 1 word 2 bytes Response R Frame Appendix A D320 PLC Communication Protocol 211 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 prog
146. ff state and transfer to the next input The results of the NOT execution Before A On A Off After B Off B On 1 The instruction cannot be connected directly to the bus it must come after a contact or set of contacts 2 The instruction directly inverts the result of the input conditions before it The instruction can be used for verification of the circuit or in the test stage A B C On On Off C ABH OUT Example Program Expression R000 0 R000 1 R001 0 m F OUT Off On On On Off On Off Off On Time Chart R000 0 _ R001 l Chapter 6 Instructions 85 Instruction Mnemonic Edge Contact Range STR DIF Contact which is On for one scan I Bit STR DEN at the up or down point of contact El Word AND DIF L1 Double words AND DFN OR DIF OR DFN Ladder DIF IRI DIF On at the rising edge T OffOn for one scan DEN d DFN On at the falling edge 4 On Off for one scan Description 1 The DIF and DFN instructions may be used more than once in the ladder program for any of the bit addresses R L M K F and TC 2 The DIF instruction is a contact which is On for the first scan after the signal has changed from Off On The contact is Off for all other scans when the signal has not changed from Off or On 3 The DFN instruction is a contact which is On for the first scan after
147. g or digital output such as a valve solenoid etc The maximum allowable value for CV The minimum allowable value for CV The proportional term of the PID loop equation The integral term of the PID loop equation The derivative term of the PID loop equation A bias term applied as an offset to the PID loop equation The amount of time between taking samples of the PV At this time a PV is taken and a new CV is calculated The D320 then waits for this amount of time before performing the next calculation The acceptable amount of error between the PV and SP When the error is less than or equal to this amount no additional adjustment is performed to the CV MANUAL CV SETTING The value to set the CV to when the PID loop is set to Manual Mode PID MAXIMUM SCALING VALUE MINIMUM SCALING VALUE Loop Control Bit 2 see Table 2 above The maximum process value that will be seen Setting this value allows the PID loop to calculate the full range of CV based on a limited input range The PV and CV are scaled to reflect the scaling ranges set The minimum process value that will be seen Used with the above parameter to scale the PV and CV for maximum effectiveness The remaining parameters of the PID loop parameter block are used by the D320 for calculation of the PID loop equation These values are carried over from calculation to calculation and must not be modified by the user program 224 D320 PLC Use
148. greatly distorted due to the switching of the module Switch IN AIC input module OO O O Static AC input o voltage trans COM Chapter 8 Troubleshooting Noise Problems 189 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 DC input module Inductive Flywheel load COM DC power AC Input Module Attach an RC network parallel to the inductive load AC input module Inductive ts load e Handling Long Cable Runs When a long cable run is needed to attach the AC input module to an external input device attach a surge suppressor parallel to the input module When possible convert the application so a DC input module can be used instead of the AC input module The input circuitry of DC input modules inherently have filters that suppress noise and therefore are less affected by the noise from inductive loads and stray wiring capacitance AC input module In case of AC power Protecting Against Arcing When a relay output module switches an inductive load a surge voltage measured in thousands of volts is generated across the relay contacts This causes arcing an electrical discharge between two contact points that can vaporize the contact material and shortens the contact life of the relay Eventually this arcing
149. he LDR instruction can be used to load the data from the absolute addresses of W100 to W199 absolute addresses 612 to 711 into the destination register R002 2 Inthe example below register WO is used as the Sr source register which contains the absolute address of the data patterns to be loaded Initially WO contains 612 which is the absolute memory address of register W100 As WO is incremented it successively points to the next higher W register to load data from 3 See Chapter 5 Absolute Address Designation for a complete table of absolute addresses Control Register Register R002 Output Pattern Absolute Value Module Address TR o ea er eg ae 88 ransfer the data o PO W100 612 22 W100 W199 22 10 P1 W101 613 33 05 85 P2 W102 614 ga registers in sequence EE into R002 output module eB See the following 7 ae FE example P98 W198 710 BS P99 W199 711 ES A 136 D320 PLC User s Manual Example Program Expression Operation Results RO 0 INC Initial conditions W0 611 data of data of i data of i data of i data of i W100 i W101 W102 i W198 W199 wo R2 word process output Chapter 6 Instructions 137 Instruction Mnemonic Store Absolute Address Range STO Store Sr in register at a
150. he value in the low order 4 bits of address S 0 to 15 into S S the proper format for display by a 7 segment display and store in D In the converted format if a bit is 1 the segment is illuminated active high output Description 1 Convert the value in the low order 4 bits of address S into SEG display format and store it in D The high order 8 bits of D do not change The 8 bit of the D register used with many 7 segment display cells as the decimal point is not affected by this instruction For example S XXX5 hex D XX6D hex 5 a s fofofofojo oli o pL Joli ifo ifafofa e Je Odp gf edcba 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results RO 0 SEG Initial conditions WO 8765 hex D W1 S W0 W1 1234 hex Operation results WO 8765 hex W1 126D hex The 8th bit of W1 does not change Chapter 6 Instructions 127 Instruction Mnemonic Decoder and Encoder with 8421 Range ENCO ENCO 8421 encoder O Bit DECO DECO 8421 decoder E Word L1 Double words Ladder 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 If there are two or more bits in the S register that are in the On state only the
151. highest bit will be processed The higher 8 bits of D do not change DECO Interpret the lower 4 bits of the S register and store in D Description 1 ENCO Set D to the value of the bit number of highest bit in S that is On 0 to 16 If there are two or more On bits in S use the location of the highest bit The high order 8 bits of D do not change 2 DECO Set the bit location 0 to 15 in D pointed to by the value in the low 4 bits of S All other bits in D are reset to O ENCO DECO 15 8 76543210 s kekkei 5 ExinnnnE LEE be PREETI pL 0 0f0 Jo 1 0J0 0 fo o EEEE 7 15 876543210 ENCO 0000 00 0020 06 0800 0C 0001 01 0040 07 1000 0D 0002 02 0080 08 2000 0E 0004 03 0100 09 4000 0F 0008 04 0200 gt 0A 8000 10 0010 05 0400 0B DECO 0 0001 6 gt 0040 C 1000 1 0002 7 0080 D 2000 2 0004 8 5 0100 E 4000 3 5 0008 9 0200 F 8000 4 0010 A 0400 5 0020 B 0800 128 D320 PLC User s Manual Example Program Expression R0 0 ENCO Operation Results Initial conditions WO 0070 hex W1 1235 hex W2 5678 hex W3 9ABC hex Operation results Wo 0070 hex W1 1235 hex W2 5607 hex W3 0020 hex The high order 8 bits of W2 do not change Chapter 6 Instructions 129 Instruction Mnemonic Dissemble by 4 bit units Range Unify
152. igent I O module to read from The first slot in the backplane is slot 0 NR6 Starting address to be read from on the shared memory of the intelligent I O module number register 2 This instruction is used to read data from the shared memory of an intelligent I O module such as the high speed counter SDU module analog module or position control module Refer to the specific intelligent I O module user s manual for detailed instructions on using the READ instruction with the given module 3 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Chapter 6 Instructions 155 Example Program Expression Operation Results RO 0 dE Read 5 words from the 0 address of the shared memory of R Teena NN n Pber the intelligent I O module located in the third slot of the rupe t De ae backplane and write to memory addresses starting at WO WO W1 W2 W3 W4 SlotO Slot 1 Slot 2 Slot 3 Slot 4 Before Operation After Operation WO 0011 WO 1111 w1 2233 w1 2222 w2 4455 w2 3333 w3 6677 w3 4444 W4 8899 W4 5555 w5 AABB w5 AABB Shared Memory o 1111 1 2222 2 3333 3 4444 4 5555 5 6666 156 D320 PLC User s Manual Instruction Mnemonic Write
153. ill occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results non Initial condition M0000 0FOF R M0001 0FOF M0002 OFOF Operation results M0 SIEIE M1 3C3C M2 3C3C i K OLL LAL of of of I ofofofo o obh 1 1 o o o o 1 Als To Chapter 6 Instructions 117 Instruction Mnemonic Rotate to the Right Without Carry Range RRC Rotate the specified address to the O Bit DRRC right high to low B Word E Double words Ladder RRG D Register address R h i B N N Number of bits to rotate MSB LSB 15 14 13121110 9 8 7 6 5 4 3 2 1 0 PTeTn fmf k i Ti n e t e p e e a gt C carry F1 8 Description 1 Order Shift N bits to the right from high order bit to low order bit Fill the carry bit F1 8 with the LSB least significant bit Shift the LSB to the MSB most significant bit 2 Shiftthe register specified as D to the right by N bits Each bit will move one bit position lower in the register 3 The D register is either a word or a double word For RLC word N 0 to 15 For DRLC double word N 0 to 31 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact
154. ins 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 e The instructions that are used with the D320 PLC e How to read the descriptions of the instructions e Detailed information concerning the usage of the instructions 68 D320 PLC User s Manual Basic Instructions Mnemonic Command Ladder Symbol Description STR Start s Start NO contact STN Start Not Start NC contact AND And NO contact series circuit ANN ADN And Not A NC contact series circuit OR Or L NO contact parallel circuit ORN Or Not Ly NC contact parallel circuit OUT Out oun Relay output SET Set SET Turn On output RST Reset RST Turn Off output NOT Not Invert logic result STR DIF Start Differential RE Start rising edge contact _ STR DFN Start Dif Not Tr Start falling edge contact 1 AND DIF And Dif R Rising edge series connection _ AND DFN And Dif Not r Falling edge series connection 1 OR DIF Or Dif L rR Rising edge parallel connection _F OR DFN Or Dif Not LF Falling edge parallel connection 1 ANB And Block H ur IT Circuit block series connection ORB Or Block HHA Circuit block parallel connection HHA MCS Master Control Set mcs Start batch processing block MCR Master Control
155. iption 1 The carry bit F1 8 is a special internal flag that holds the result of various types of mathematical and bit shift operations When rotating shifting adding or subtracting with a carry the operation depends on the state of the carry flag as well as changes the state of the carry flag The above instructions are useful for setting the state of the carry flag as needed for these types of operations 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results RO 0 SC eee eS d o R R0 0 RO 1 RC R R0 2 CC R Chapter 6 Instructions 135 Transfer Instruction Details Instruction Mnemonic Load Absolute Address Range LDR Store value at absolute address L1 Bit DLDR Sr in D De Sr B Word E Double words Ladder Store the value located at the absolute address pointed to by Sr into register D RO word absolute address 0 MO word absolute address 192 WO word absolute address 512 Description 1 This instruction is useful in transferring data patterns stored sequentially in memory to a single output register location For example if the register addresses W100 through W199 contained a set of 100 control patterns PO to P99 that needed to be transferred to an output module located at address R002 t
156. iques Isolation There are several methods of isolation e 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 e Some isolation transformers come with a shield that can be grounded This shield when properly grounded enhances the transformers ability to remove unwanted spikes e Be certain to size the isolation transformer to handle the necessary power rating required by the system A good practical rule in specifying an isolation transformer is to multiply the required load capability by 1 35 35 additional deliverable power This allows expansion of the PLC system at a later date without the immediate need to upgrade the isolation transformer y Ground terminal Triple ground Less than 100 Q of ground resistance e When heavy noise is expected also use an isolation transformer on the AC control power to the I O modules and devices A cost effective way of specifying the isolation transformer for this requirement would be to specify a transformer with multiple primary and secondary windings and wiring the PLC as shown below Again be certain to size the isolation transformer to handle the necessary power required plus a 35 surplus and additional windings to allow for future expansion of the system Breaker Isolation Transformer 3lE
157. is D S1 S2 CY DSBC wicarry S1 S1 Decimal operation include carry S2 S2 ADCB BCD addition A ee D S1 S2 CY DADCB wicarry S1 S1 BCD operation include carry S2 S2 SBCB BCD subtraction SERE gud D S1 S2 CY DSBCB w carry S1 S1 BCD operation include carry S2 S2 ABS Absolute value AnS PARS D D DABS Absolute value operation NEG Negative bat ups Store the 2 s complement of D in D DNEG 2 s complement 1 s complement 1 NOT NOT PS ie Store the 1 s complement of D in D DNOT 1 s complement 72 D320 PLC User s Manual Logic Instructions Mnemonic Command Word Double Word Description AND AND logic multiply AND DAND Store AND of S1 and S2 in D DAND es ae sof ols T S2 2 S2 afe oof ofo OR OR logic sum OR DOR Store OR of S1 and S2 in D iL Jis Ee Doan S2 S2 B2 alef XOR Exclusive OR XOR DXOR Store exclusive OR of S1 and S2 in DXOR D D D S1 S1 S2 S2 si o op 7 sao fo 4 efef e XNR Exclusive OR NOT XNR DXNR Store exclusive OR NOT of S1 and DXNR equal circuit 2 E x S2 in D S2 S2 si o o solo fo ofif efef Rotation Instructions Mnemonic Command Word Double Word Description RLC Rotate left without RLC DRLC Rotate contents of designated DRLC carry D D register D to the left N times Nee M lowerhigher RRC Rotate right without RRC DR
158. is turned Off until it reaches 0 n L U Ifthe input is turned On again before the output turns Off the ase D output is maintained On dices up x Available channels are Ch 0 through Ch 255 256 channels and Set Value SV is from 0 to 65 535 Example Program Expression Time Chart R000 0 5 sec TC100 Chapter 6 Instructions 91 Instruction Mnemonic Timer I Range UC Up counter W Bit DC Down counter O Word O Double words m Example of UC with SV 3 condim Whenever count input condition U input turns On PV 3 increases by 1 When PV and SV are the same the output p QUT TC done contact is On When the reset input condition R input is On the output contact is Off ug um While the count input pulses On the PV will continue to condition 1 Input i count up to a maximum of 65 535 When the reset input is On the PV is reset to a value of 0 E eee P Set Value Present i 0 Value PV Output TC Whenever count input condition D input turns On PV decreases by 1 When PV is 0 the output TC done contact is On ret HM ETE TL ae condition i When the reset input condition R input is turned On the Reset TC done contact is turned Off and the PV is set to 0 condition 3 Example of DC with SV 3 4o Set Value Eo dg Po H SV Present 2 oio 0 2 Value PV Output TC
159. it number C 1BFC Refer to the appendix for a detailed explanation of the communications protocol 54 D320 PLC User s Manual I O Address Designation Rse3ec 485 Example I O Addressing Configuration 8 slot backplane Slot No 00 01 02 03 04 05 06 07 I O Points 16 16 32 32 0 16 16 32 Word No RO R1 R2 R3 R4 R5 R6 R7 R8 R9 R000 0 R001 0 R002 0 R004 0 R006 0 R007 0 R008 0 CPU ROOO 1 R001 1 R002 1 R004 1 R006 1 R007 1 R008 1 Bit No Unit R000 2 R001 2 R002 2 R004 2 R006 2 R007 2 R008 2 R000 15 R001 15 R003 15 R005 15 R006 15 R007 15 R009 15 Note I O Address Designation The CPU assigns addresses in sequential order to the I O modules on the backplane starting at address 0 The CPU automatically determines whether the register data from the modules is of type input or output The 16 point I O modules use one word of register memory The 32 point I O modules require 2 words of register memory Analog and Intelligent function modules can require from 1 to 4 words of register memory The combination I O module consisting of both inputs and outputs is separated into a one word input and a one word output On a 16 point mixed I O module the eight input or output points will use up the lower 8 bits 00 to 07 of their respective words When a slot is empty a blank D320BNK300 module can be installed When add
160. ithout additional hardware Note When this manual uses the term GPC either GPC5 or WinGPC can be used System Installation Considerations Environmental Considerations The D320 PLC system should never be installed under the following environmental conditions 1 Ambient temperature outside the range of 0 to 55 C 32 to 131 F Direct sunlight 3 Humidity outside the range of 30 to 85 4 Altitudes greater than 10 000 ft 3 000 m 5 Corrosive or dusty air 6 High voltage high magnetics or high electromagnetic waves 7 Locations subject to direct impact greater than 5G or vibrations greater than 1G 57 2000 Hz Installing Modules on the System 1 Turn off the main PLC power and the I O module power 2 Follow the instructions provided with the I O module to mount and wire the module 3 Turn on the power to the I O module 4 Turn on the main PLC power Removing Modules from the System 1 Turn off the main PLC power 2 Turn off the power to the I O module 3 Disconnect the wiring to the I O module Chapter 1 Introduction 5 Preventing PLC System Malfunctions 1 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 Do not exceed the current and power rating of the
161. iting data Setting this flag disables the standard D320 Program Loader Port protocol support for port 2 Appendix C COM2 UDCP Specification 235 Description of Operation MODBUS RTU mode When configured for operation as a MODBUS RTU slave by setting the Enable MODBUS Flag F12 9 the D320 communication port supports the open standard MODBUS RTU slave instructions shown in Table 4 below Table 4 Supported MODBUS RTU Slave Commands Command Code Hex Description Read Coil 01 Read ON OFF status of logic coil s Read Input 02 Read ON OFF status of discrete input s Read Holding Register 03 Read value of internal register s Read Input Register 04 Read value of input register s Write Coil 05 Write single logic coil to ON OFF Write Register 06 Write value into single internal register Read Exception 07 Read internal status register special Write Multiple Coils 15 Write multiple logic coils to ON OFF Write Multiple Registers 16 Write values into multiple internal registers Report Slave ID 17 Report Slave node address on network MODBUS Memory Mapping When a D320 responds to a MODBUS RTU master message to read or write a coil or register the address contained in the 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
162. llation and Wiring 31 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 Connector Spring Power Supply Wiring Power wiring For the 120 240 VAC power supply the power conversion terminal must be shorted for 110 to 120 VAC and left open for 220 to 240 VAC A CAUTION Connecting 220 V to power supply with the power conversion terminal shorted 120 VAC mode will damage the PLC equipment and generate excessive heat When connecting the power cable To reduce power loss in the wiring use at least 14 AWG 2 mm cable To reduce the effect of noise use twisted shielded cable An isolation transformer can be used to further reduce noise and to prevent failures from power problems such as ground faults Use the same power source for both base and expansion backplane power supplies Grounding In normal low noise environments such as closed room control cabinets it is possible to operate the PLC without frame grounding However it is necessary to ground the PLC for noisy environments and is recommended for all installations regardless of electronic noise levels For the frame ground use a cable of at least 14 AWG 2 mm in size The ground should be exclusive to the PLC Sharing th
163. loose Defective contact Tighten screw Reconnect module A set of 8 points on an I O module operate incorrectly or identically Common terminal screw loose Tighten the screw Defective contact Terminal connector Reconnect the module CPU module error Replace the CPU module Output display LED is not on output is On to field device LED error Replace the output module 180 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 Voltage must fall within the power Voltmeter Power power terminal fall within the module input voltage specifications specified range Environment Does the temperature fall within the 0 to 55 C 32 to 131 F Thermometer specified range Does the humidity fall within the Humidity levels below 30 RH Hygrometer specified range Is there any dust present No dust Visual I O Power Does the control voltage supplied to Control voltage must fall within the Voltmeter the I O modules fall within the input and output modules specified limit specifications Module Are all of the modules secure All should be firmly secured Screwdriver Mounting and Wiring Is the connection cable
164. low up to three seconds for a response from the PLC If there are no responses to the Q or the RR message the communication is considered to have failed and the Q or RR should be sent again Example l No communication error For the internal processing of the PLC CPU send RR at least 5 msec after receiving QA Peripheral device a OY aaa m i PLC When QA is not received 3 sec Peripheral device When R is not received Peripheral device EST PLC Repeated Response communications 3 sec Peripheral device i PLC 202 D320 PLC User s Manual CPU ID All devices connected to the network need a network ID number for communication There is an available range of 0 to 191 network ID numbers Redundancy is not permitted When a single PLC and a peripheral device are connected usually 0 1 or 255 is assigned as the network ID number to the PLC When the peripheral device wishes to communicate to a connected PLC regardless of its programmed network ID number it can use global network ID number 255 to which any PLC will respond When several CPU modules are connected to one communication network they must use individual ID numbers from 0 to 191 The PLC s network ID number is configured using the GPC program loader software Function Codes Included in the Query e Each function code is 1 byte When the PLC receives a query Q the function code of the final response R is formed by adding 80
165. lows 1 0 to 65 535 0000 to SFFFF S2 0to 65 535 0000 to SFFFF D 0 to 65 535 0000 to SFFFF 3 When using DSBC and DSBCB the calculation ranges are as follows 1 0 to 4 294 976 295 0 to SFFFFFFFF S2 0 to 4 294 976 295 0 to SFFFFFFFF D 0 to 4 294 976 295 0 to FFFFFFFF 4 Ifthe result exceeds the range of calculation a carry occurs The carry flag F1 8 is changed to On 5 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 110 D320 PLC User s Manual Example Program Expression R0 0 Operation Results Initial conditions Operation results WO 00016 0010 W1 00002 0002 W10 00016 00002 1 00013 W11 0010 0002 0 0008 Chapter 6 Instructions 111 Instruction Mnemonic Absolute Value NEG and NOT Range ABS DABS NEG DNEG NOT DNOT ABS Absolute value O Bit NEG 2 s complement E Word NOT 1 s complement E Double words Ladder ABS Take the absolute value of D and store it in D NEG Take the 2 s complement and store it in D NOT Take the 1 s complement and store it in D Description L For the ABS absolute value instruction if the highest bit MSB is 1 take the 2 s complement If the highest bit is 0 leave it as it is For example the absolute value o
166. message 1 Message Received F11 5 Clears the Receive Buffer 0 Normal 1 Clear Receive Buffer F11 6 Indicates a Port Overrun Failure 0 Normal 1 Overrun Error F11 7 Indicates a Receive Failure e g bad CRC 0 Normal 1 Receive Error F11 8 Enable Conversion of ASCII data to Binary 0 Enabled 1 Disabled F11 9 Ignore Receive Errors 0 Signal Error 1 Ignore Error F11 10 Enable Parity Setting 0 Disabled 1 Enabled F11 11 Select ODD or EVEN Parity 0 ODD 1 EVEN F11 12 Select the Number of Data Bits 0 7 Bits 1 8 Bits F11 13 Select ASCII or Binary Communications 0 ASCII 1 Binary F11 14 Reserved Do not use F11 15 Enable Automatic CRC mode 0 Disabled 1 Enabled Flag Word F12 F12 8 Enable User Defined Communications UD 0 Disabled 1 Enabled F12 9 Enable MODBUS RTU Communications 0 Disabled 1 Enabled MODBUS 232 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 Table 3 Communications Registers System Registers Description Explanation SR298 SR333 Transmit Data Buffer Holds up to 36 words of data to be transmitted SR334 SR369 Receive Data Buffer Holds up to 36 words of received data SR370 Transmit Data Length Number of Bytes
167. middle of the circuit 1 OUT Use for external I O R internal M and retentive K contacts On or Off according to status of the input condition 2 SET Use for external I O R internal M and retentive K contacts The same address can be used more than once When the input conditions are true the coil is turned On and stays on unless turned off by a RST The output is turned Off in the Stop mode 3 RST Use for external I O R internal M and retentive K contacts The same address can be used more than once When the input conditions are true the coil is turned Off and stays off unless turned on by a SET The output is Off in the Stop mode 4 Whenusing retentive coils K in OUT SET or RST the state is maintained It will remain On or Off even after placed in the Stop mode and power is turned off Example Program Expression Time Chart g p n OUT R001 1 R002 2 R002 2 MO00 5 Pod Lo R022 Lit 1 R002 3 M000 5 M000 4 M000 5 E RST M000 4 follows contact logic for ROOL 1 input When R002 2 contact is On M000 5 output is On When R002 3 contact is On M000 5 output is Off 84 D320 PLC User s Manual Instruction Mnemonic Reverse Range NOT Reverse the previous status of the W Bit logic O Word O Double words Ladder A B Reverse the logic result of the input conditions before A at B Description Reverse the previous On O
168. mming monitoring networking and operator interface requirements e Intelligent communications units from remote I O to communications modules allow for both distributed or centralized control schemes Chapter 1 Introduction 3 e The D320 PLC is built to simplify operation maintenance and repair with its modular design and removable terminal e 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 Self Diagnostics While in the Run mode the D320 PLC provides continuous self diagnostics and error checking on the processor control program and I O system Built in diagnostics also perform error checking during program download and system initialization Error status information is stored internally providing for quick and easy troubleshooting of system and programming errors PID Loop Control A built in 8 loop PID processor easily handles demanding analog process control requirements such as temperature and or position control Real time Clock A real time clock RTC function enables time and date related programming tasks including alarm recording process scheduling and product serialization Large Program Memory Sufficient program capacity is furnished for even the most demanding applications Internal pr
169. nd outputs and or the size of the program Edge An edge is defined as the point when an input changes state For example a rising edge occurs during the very first scan after the input has changed from Off to On A falling edge occurs after the input has changed from On to Off Hex Hexadecimal A hexadecimal number is a value expressed in Base 16 Base 16 values consist of digits from 0 to F In a byte word or double word each set of 4 bits corresponds to a single hex digit For example the binary value 01001111 would correspond to the hex value 4F and a decimal value of 79 A hex value is designated by the use of the symbol in front of the value i e 4F is the hex value 4F BCD Binary Coded Decimal BCD is used to express a decimal digit 0 to 9 using 4 bits Conversion of BCD values can be done in hexadecimal calculations For example the BCD representation of decimal 27 would be two sets of 4 bits 0010 0111 NOVRAM NOVRAM non volatile RAM is programmable memory that retains its data even through loss of power through the use of a backup battery The PLC program and retentive memory is stored in NOVRAM and will be retained when power is off The battery supplied will provide up to 10 years of backup power under normal use Chapter 5 CPU Operation and Memory 47 10 GPC Graphic Programming Console Cutler Hammer offers two program loader software packages for programming monitoring and configuring the D320
170. ne 9600 28 8K baud If you have modem access you can dial in directly to our electronic bulletin board service for the latest product and company information File sharing product software downloads and our user message service are just a few of the things you will find online at 614 899 5209 Website and E mail Address http www cutlerhammer eaton com automation chatechsupport ch etn com If you have Internet capabilities you also have access to technical support via our website at http www cutlerhammer eaton com The website includes technical notes frequently asked questions release notes and other technical documentation This direct technical support connection also offers you the ability to request assistance and exchange software files electronically Technical support messages and files can be sent to chatechsupport ch etn com D320 PLC User s Manual Software Update Service 1 800 809 2772 FAX 614 899 4141 We also offer you the opportunity to take advantage of software upgrades advanced software notices and special software promotions through our Software Update Service When you register your software you will receive one year of free or reduced price upgrades along with all the other benefits of membership including 48 hour shipping of software upgrades Contact the Software Update Service at 1 800 809 2772 or fax 614 899 4141 Repair and Upgrade Service 614 882 3282 ext 7601 FAX 614 882 3414 Our well equi
171. ned Communications mode the messages can be transmitted and received in either ASCII mode or binary mode This flag sets which mode will be used When the flag is set all communications are in binary Otherwise ASCII communications is assumed 234 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 Additionally when data is received the CPU checks the Receive Data Length SR371 calculates a CRC 16 on the received data and compares it to the data received at the end of the receive message If the CRC does not match the Receive Error Flag F11 7 is set F12 8 ENABLE USER DEFINED UD COMMUNICATIONS Setting this flag enables port 2 of the CPU to support ASCII Binary transmit and receive functions It also necessarily disables the standard D320 Program Loader Port protocol support on the port F12 9 ENABLE MODBUS RTU SLAVE COMMUNICATIONS When this flag is set port 2 of the CPU is configured to support the open industry wide MODBUS RTU slave protocol Peripheral devices can communicate to the D320 CPU using the standard MODBUS RTU communications for reading and wr
172. ng the entire word 2 BFMV Fill a block of Ns bits starting at bit address D with the value of V 0 or 1 This instruction is useful for initializing a set of bits to 0 or 1 at the start of a program or process Sb o 1 1 1 o 1 o o BMOV IfNs 4 ay BFMV Db Db o 1 o 1 o 1 o o 3 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results TRE sie Rad opos TToToTo 1 4 1 oO oTo A operation LL ErIee fol Tor To oT or oTorm emper rro x o R3 after operation 210 1 1 1 10 0 1 1 1 1 1 0 142 D320 PLC User s Manual Block Processing Instruction Details Instruction Mnemonic FOR NEXT Loop Range FOR FOR DFOR Start loop LI Bit DFOR NEXT End loop E Word NEXT E Double words Ladder FOR Begin execution of instructions between D FOR and corresponding NEXT Repeat execution D times NEXT Decrease D of FOR instruction by 1 If not zero repeat from FOR instruction Description 1 The FOR NEXT instructions are used to perform a block of instructions inside a ladder program repeatedly The parameter D of the FOR instruction is a value indicating how many times
173. nne nnn nenn ener entren nre n nennen nnns 15 Chapter 3 Product Specification 17 Environmental Operating Ranges Ret etie i ie tete edo a A ce decade 18 CPU Performance Specifications ec RR Aetoli ie e tiii evt cial edades idee eive celeri cs 19 Name and Function of CPU Components sees enne 20 Chapter 4 Installation And Wiring 23 System Design Considerations ccccccccesscsssceseceseceseceecseecaeeeseesseeaeesecesesesecnsecaecsaecnaecaaecaeecaeeeaeeeaeeneesereeerenetens 24 Power Supply Wiring 2 scooter ene eaten ud cds 24 Interlock Circuit and Emergency Stop Circuit Safety measures in system design sss 24 Momentary Power Failure and Voltage Drop eese eene 25 System Installation Guidelines 5 cete tete ie edic e eT ER RT is 25 Environmental Usage Conditions sesiis see ete e er ete ee oet diet eeds 25 Control Panel Installation e Ree ug E R N EE des 26 System Wiring and Installation Procedures cccescceseceseeseeeseeeseeeeeeseceseeesecseceaecaeceaecaaecaeecaeeeseeeaeeneeseseeerenaeees 28 Installation Dimensioris eee Rete ee RT e e E EE den 28 Module Iistallation eene te pe eae ERR OU Pe die dtes 29 Unit Installation Height eie tere ete irte e E EE ERE EET 30 vi D320 PLC User s Manual Expansion Cable Connection ccccccccecssesssesscessceseeeecenecseceaecseecaeecaeeenecesesaceseesseenseenseeaeeeaecaecnaeceeeneeenes 30 Power sup
174. nsions sess 197 Integrated Remote I O Drop Dimensions nennen nnnm 197 Appendix A D320 PLC Communication Protocol 199 Communication Rules sere RC RE REUNIR ERE DR ee ates 200 Communication Environment c cccccesscesscesecesecesecseecseecseeeseeseeceeceeeeseeeseceaecsaecaecsaecaeeeaeeeneeeeeeneeeesenaeees 200 Communication Protocol MM 200 Step 1 Query Qs eh dence kevin e Inte evi use Cenk aan SR le eed Seas 200 Step 2 Query Acknowledge QA Jz reisan ene era aaa aeae a eaa aia EE E EES 200 Step 3 Response Request RR sssssssssesesseeeeneeen enne ener nnne tener enne n rre 200 Step 4 Response R i ssec diee eee ee re HE seen Ee d e E RE eee HUE Ye et 200 Step 5 Repeated Response xs ede Rie eg iate iet etate t efi iod 201 Communications Delay esteso ORE ER HER RE HA EE ERRARE 201 Example ede epee 201 CPU ID 2 intet o CRDI C ERO ED Bene RR Een 202 Function Codes Included in the Query ceca seve eese eei e eee 202 Cyclic Redundancy Checking CRC essere ener enne nnne nnne nen 203 The Structure of the Communications Frame sese eene enne nnne nennen eren 204 Read Bits estie ed In ee teu fitu he t eck WANT tees 205 Write Bits tetti ete eie eal Aneel ote E ed AW tee hes 206 Read Words rode eel ote eh hse estem dete he bei Re etie 207 Write Words een ode ehe tatit etie RR Ud dies 208 Read Bits and Wotds br ted eie dio ht i iei alana hans 20
175. o of ofo ofofo of of 1 1 o of 1 1 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results kon Initial conditions WO 00FF R W1 3333 W2 XXXX Operation results WO 00FF W1 3333 W2 0033 113 Chapter 6 Instructions Instruction Mnemonic Bit OR Operation Range OR Bit OR operation LI Bit DOR B Word E Double words Ladder Description 1 S2 D 0 0 0 0 1 1 1 0 1 1 1 1 Process S1 and S2 in bit OR operation and store the result in D Process S1 and S2 word double word by bit OR operation and store the result in D For example S1 00FF hex S2 3333 hex D 33FF hex s ojo o oTo oTo o1 8 T RTL 1 OR s2 e o 1 1 o o 1 1 o o 1 acouga p olo a sfo of spe rip opt 5 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression R0 0 D W2 S1 W0 S2 W1 Operation Results Initial conditions Operation results WO 00FF W1 3333 W2 XXXX WO 00FF W1 3333 W2 33FF 114 D320 PLC User s Manual
176. ogram memory handles up to 24K separate control steps NOVRAM Battery Backup An easily replaceable lithium battery provides up to 10 years of program and data backup I O and Special Function Module Support The D320 PLC I O module line includes complete coverage of all major standard I O requirements Digital input modules include 24 VDC in both 16 and 32 points and 16 point 5 12 VDC 115 VAC and 230 VAC modules Digital output modules include 24 VDC transistor and relay types in 16 and 32 points and 16 point 115 230 VAC triac type Analog support is available for voltage and current A D and D A as well as RTD and thermocouple inputs Special function modules include high speed counter and serial data communications modules Finally wire link network modules can provide peer to peer networking for loops of up to 32 PLC s each 4 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 Cutler Hammer also offers a complete line of Operator Interface products and HMI software packages compatible with the D320 PLC Through the use of the dual program loader ports the D320 PLC can be connected to any combination of two peripheral products w
177. om the stop state to the run state SRO005 to 7 Link unit number Unit address as set by the link module SR008 PID table PID register block start address SROO9Y to 16 Remote info Remote I O configuration information Chapter 5 CPU Operation and Memory 59 Address Function Detail SRO017 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 Indicates the location of the instruction the step number that instruction caused an undefined instruction error during program execution SR019 Reserved System use SR020 Multiplication Stores high order 8 bit values upon executing 16 bit multiplication instructions SR022 Remainder Stores the remainder after a division instruction has been executed high order 16 bits SRO024 to 27 Reserved System use SRO028 to 29 Error I O module Sets bit position at error in I O module SR030 to Reserved System use 047 SR048 to Slot information Stores slot information for I O modules 111 SR112 to Remote Contains remote I O configuration data SR239 SR289 to RTC Contains real time clock information SR297 SR298 to User defined comm User defined communication protocol information for COM2 SR373 protocol SR374 to
178. one contact is turned Off All count input pulses are ignored and the Present Value stays reset to 0 3 When the SV of the counter is 0 the output done contact is On unless the reset input is On 4 The timer counter channel can only be used once It cannot be reused by other timer or counter instructions TIM SST TOF UC DC UDC The number of available channels is 256 Ch 0 through Ch 255 5 The counter can be set to a maximum value of 65 535 Example Program Expression Time Chart roo U ULTLIL TL IL R000 1 Present E H i i i Value PV50 Output TC50 _ ___ DZ 94 D320 PLC User s Manual Instruction Mnemonic Up Down Counter Range UDC Up Down counter W Bit L1 Word L1 Double words Ladder condition U input l l l 1 condition 1 E NE condition D input gt ipjnnfmL i condition 2 ses Reset condition 3 Present Value PV Output TC Set Value Description l 8 When the up count input U input turns On the Present Value PV increases by 1 When the down count input D input turns On PV decreases by 1 When PV is greater than or equal to the Set Value SV or is reduced to 0 the output done contact turns On In the following cases the output done contact changes from On to Off When the reset input is turned On When the PV is decreased below the SV by the down count pulse input When the PV increases from 0 to 1 by the up
179. or which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results R0 0 ae Spp an T i 4000 50 1400 00 0000 MO c BEL oa AE Ges Chapter 6 Instructions 121 Instruction Mnemonic Shift to Left Range SHL Shift to left high order bit by N W Bit DSHL bits O Word Lowest bit becomes 0 O Double words Ladder mee D Register address R F B N N Number of bits to rotate MSB 15 1413121110 9 8 7 6 5 4 3 21 0 LSB ELE c eleIe Im Ti Tol Te TT eTo a lt fo Description 1 Order Shift N bits to the left from low order bit to high order bit including the carry bit The MSB most significant bit moves to the carry bit F1 8 The LSB least significant bit becomes 0 2 Shift the register specified as D to the left by N bits Each bit will move one position higher in the register 3 The D register is either a word or a double word For SHL word N 0 to 15 For DSHL double word N 0 to 31 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact 122 D320 PLC User s Manual Example Program Expression R0 0 LET Operation Results ee c oe d cBl L1 igF
180. pedance e Noise from lightning should be suppressed by use of surge suppressors that are specifically designed to protect electronic equipment from lightning e Whenever welding near an electronic device care must be used to avoid connecting the ground cable of the welder to a ground of the electronic device One method of protecting the PLC is to disconnect the PLC from power and lifting all power and ground connection An alternate method is to establish two separate grounds one for electronic equipment and one for welding Test the ground separation carefully before having electronic equipment up and running while welding e The quickest way to avoid noise from shared cable trays is to have two cable tray runs One for power and power control cabling and the other for electronic equipment and low level control wiring Proper cable selection with good shielding properties in some instances will allow both types of cabling wiring to co exist in the same tray system e Grandfather d plant wiring has to be analyzed on a case by case basis The best approach is to always install new cabling conduit and cable tray runs Though this may not always be practical it removes the surprise of high noise and system problems during system startup e Static electricity suppression requires good grounding practices throughout the plant Static electricity 1s a potential difference developed on a material surface due to the loss of protons or electrons
181. perate on their own process variable setpoint and output values Each of the PID loops has its own block of 32 register words which defines all of the parameters for that loop for a total of 256 words for all eight loops The first word of the 256 word block is defined by the value in System Register 8 SR008 Each loop is also controlled by setting bits in System Flags F14 and F15 The block list and enable bits are shown in Table 1 Appendix B PID Loop Control 219 TABLE 1 PID Block Memory Map Loop Number Parameter Block Starting Address Control Bits 0 SRO08 F14 0 F14 3 1 SR008 32 F14 4 F14 7 2 SR008 64 F14 8 F14 11 3 SR008 96 F14 12 F14 15 4 SR008 128 F15 0 F15 3 5 SRO08 160 F15 4 F15 7 6 SRO08 192 F15 8 F15 11 7 SR008 224 F15 12 F15 15 Note SR008 indicates the value in SRO08 For example if SROOS holds the value 1000 then Loop 0 starts in W1000 Loop 1 starts in W1032 etc Each loop has 4 control bits assigned to it as shown in the table above The control bits perform the following functions TABLE 2 PID Loop Control Bits Bit Number Description 0 PID Operation Stop Flag 1 Operating O Stopped 1 Parameter Setting Error Flag 1 Range Error 0 normal 2 CV Value Setting Mode 1 Manual 0 PID Loop 3 PID Execution Completion Flag 12Complete 0 Calculating PID Operation Stop Flag This flag defines whether the PID Loop is
182. perly used within the program SR30 For example the first slot is set with an input module and OUT R00001 is designated 9 On if the label numbers of the JMP or CALL instructions exceed 63 the corresponding instruction LBL SBR does not exist and or the corresponding LBL SBR instructions exist prior to JMP CALL instructions 10 On if the label number of the LBL instruction exceeds 63 and or is duplicated 11 On if the JMPS JMP instructions are mistakenly combined and or used 12 On if the FOR NEXT instructions are mistakenly combined and or used more than four times Loop 13 On if SBR RET instructions are not combined and or used and or the SBR instructions overlap or exceed 63 14 On if INT RETII instructions are not combined and or used and or more than two sets of INT instructions are used 15 On if no END instruction exists Chapter 5 CPU Operation and Memory 61 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 109 8 7 6 5 4 3 2 1 0 SR289 This year Example 1998 2000 4 BCD SR290 Date day OlO x x x x x x O O O O O x x x Current SR291 Year month Ox x x x x xixiOOO x x xi x x Time SR292 Second 00 ololx x x xIix xlolo lolojo ololo SR293 Time minute OlO x xx x x x O x x x
183. ple Program Expression Operation Results The first remote master F8 0 is installed and there are no initialization errors F8 8 The communication is completed F8 14 Once these conditions are true the program then writes eight words to shared memory address 0 of the intelligent module located in slot 4 of station 5 of remote I O network 1 All eight addresses are written with the value of 5555 F8 0 F8 8 F8 14 H H RMWR Nt 1 5 To 2 4 0 Fr 8 5555 160 D320 PLC User s Manual Instruction Mnemonic Word Data Receive Range RECV Word data receive command L1 Bit using link network B Word L1 Double words Ladder T Read NRI words from link network NN3 station NRx number register NN4 register type NNS address NR6 and write perl aca them to words starting at RR2 ECV To NR1 RR2 Nt NN3 NN4 Description 1 NRI Number of words to read number register RR2 Starting address for storing read data register NN3 Link network number number NN4 Station number on the link network number NNS Register type to read number 0 L register M register R register K register T C Setting Value SV T C Present Value PV W register 7 F register NDNnPWN Ke NR6 Starting address of register to read number register 2 The link network loop number is a number from 1 to 3 The first link module in the base rack is assigned network ID
184. ply Wirlng ec ederet peti Ue S etes c s ES ae resnia 31 Power UII 31 uuum 31 120 240 VAC Power Supply Wiring Diagram ccccceeseceseesceesceseeeeeceeeceseecesecseecaeeeseeeaeeeeeeeseseeeenaeeaeeaees 32 VO Module Wiring icti teer e E HS TORRE EE Ue e eene ee ER RERO 33 Digital Input Module Wiring eines e ERREUR Ie PUER EEE GO 33 Digital Output Module Wiring nee sehe etie RU ERIS ER Re PUER He ERE E 37 Installation Precautions for I O Modules sssssssssssseeeeeeeenenenenenenr enne ener neret 38 Terminal Strip Wiring iiie tede ene ee ERU E CURIE HR EEE Re PO EHE RETE ENRECE 39 Connector Module Wiring sce RR He E ERU EEG REP EE 40 Connector Module Wiring esee ntn ae eec tU RS de eee de RENTRER Rte 40 Alarm Output of Power Supply essere diee ce de p UO RU He eee de RUE Ee 42 PLE Communications Wiring sedisse ees deine tede iE bec ER Ee RENE REOS 43 Connecting tlie PLC tox BG on Rest e NI RENI IR SN oon 43 D320 CPU Module Communication Specification essere ene 43 Chapter 5 CPU Operation And Memory 45 Terminology 0e e ecran neo etr sott ttt eto te et tet UR ee Aedes 46 Overview of CPU Operation Mode ssesessseseeeeeeeee nnne enitn enne nnne nennen rne 47 What Is the CPU Operation Mode cccccccesscessessseeescenecesecaecseecaeecaeecseceseseesseesseensese
185. pped Customer Service department is ready to assist you with repairs upgrades and spare parts services If a situation arises where one of these services is needed just call 614 882 3282 x7601 or fax 614 882 3414 Product Ordering Service 614 882 3282 FAX 614 882 6532 Authorized Cutler Hammer distributors may place product orders directly with our Order Processing department by calling 614 882 3282 x406 or faxing 614 882 6532 For information on your local distributor call the Cutler Hammer Tech Line Customer Support Center 1 800 356 1243 Authorized Cutler Hammer distributors and Cutler Hammer sales offices can get assistance for Cutler Hammer standard and component product lines through the Customer Support Center Call the Customer Support Center for the following assistance 1 Stock availability proof of shipment or to place an order Expedite an existing order Product assistance and product price information Aw oN 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 173 Heatherdown Drive Westerville OH 43081 Table of Contents v Table of Contents Preface I About This Manual a neta i ente te ur dece atas iv E best need il PUrpOS66 etre eere EETA ro ege eg MenduadcaduatentatedssSobesdins recie ui eret ine uses sts e e dI e reed i What s Insid s 35 arts bs A atr fo dis
186. pplied Terminal screw is loose Defective contact Tighten screw Reconnect module I O contact connection Replace the output module Defective output circuit Reconnect the output module One or more outputs on an I O module will not change to On or Off state Output circuit error Replace the output module Output on an I O module will not turn Off LED is not illuminated Output time too short Correct the program Defective output circuit Replace the output module Output on an I O module will not turn Off LED is illuminated Incorrect output load Replace the output load Loose output wiring Reconnect the output wiring Terminal screw is loose Defective contact Tighten screw Reconnect module Output contact error Replace the output module of the relay Defective output circuit Replace the output module Output on an I O module will not turn On LED is illuminated Output contact error Replace the output module of the relay Leakage current to low current load Apply leakage current protection see Chapter 4 Output on an I O module will not turn On LED is not illuminated Defective output circuit Replace the output module Output changes On Off state erratically Low external input voltage Make sure full supply voltage is being input Noise error Troubleshoot for noise Terminal screw
187. r s Manual PID Example Description The difficulties involved with set up of PID loop control include the problem of simulating a real world closed loop process One method of simulating such a process is through the use of an RC resistor capacitor network between an analog input the process value and an analog output the control output value The RC circuit introduces a response delay between the analog output voltage and the voltage seen at the analog input providing a reasonable model of a real world process 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 Channel 0 of the analog input module is connected to channel 0 of the analog output module by the RC network mentioned above This configuration is illustrated in Figure 2 J dein D DIM DIM DOM AOM AIM RO Ri R2 R3 R7 5Kohm Resistor 470uF 16V Output Papae input Analog Analog Figure 2 PID Example PLC Setup 225 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 This is accomplished through the use of the special First
188. ram 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 Notes are provided alongside the main program to help explain the exact purpose and function of the individual parts of the program Note This program is provided for illustrative purposes only It is left to the responsibility of the user programmer to ensure that any programs written based on and using the information contained in this program satisfy the requirements of their particular application Program Notes include lt stdio h gt include lt stdlib h gt include lt dos h gt include lt conio h gt define PC ID OxE2 define Time limit 28 define retrial limit 2 define TRUE 1 define FALSE 0 define lower byte x unsigned int x amp Ox00FF define upper byte x unsigned int x amp OxFF00 gt gt 8 typedef int BOOL unsigned int PORTADD DIVISOR sending delay receiving delay unsigned int sending frame 262 receiving frame 262 unsigned int Crc unsigned int card i ix iy smode unsigned int port number unsigned int PIcID OIdID BOOL Success unsigned int data JobID retrialC unsigned int Old New receiving Index max sending Index max index watchdog unsigned int M 128 K 128 Example Register void RR occurring void void Trsport unsigned int unsigned int Recport void
189. ram loader port protocol for reading and writing memory areas Register Absolute Address Register Absolute Address Address Dec Hex Address Dec Hex R0000 0 0000 F0000 448 01CO R0001 1 0001 F0001 449 01C1 External R0002 2 0002 System F0002 450 01C2 y o z Flags R0126 126 007E F0014 462 01CE R0127 127 007F F0015 463 01CF L0000 128 0080 wo000 512 0200 L0001 129 0081 wo001 513 0201 vines E0002 130 0082 Data Area 0002 514 0202 L0062 190 O0BE W2046 2558 O9FE L0063 191 OOBF W2047 2559 O9FF M0000 192 00CO W2048 2560 0A00 M0001 192 00C1 T C Set W2049 2561 0A01 Internal M0002 194 00C2 Value Contact M0003 195 00C3 W2303 2815 OAFF W2304 2816 0B00 M0126 318 013E TIC W2305 2817 0B01 M0127 319 013F ant K0000 320 0140 W2559 3071 OBFF dem K0001 321 0141 SRO 3072 0C00 Keep K0002 322 0142 System SR1 3073 0C01 Contact 0090 323 0143 Registers SR511 3583 ODFF K0126 446 01BE K0127 447 01BF When accessing a bit absolute address using the program loader port communications protocol the bit address 0 to 15 is kept separate from the word address as shown below 15 4 3 0 1 word display Word absolute address For example the absolute bit address for K127 12 internal contact is 1 BFC hex word absolute address 01BF b
190. rd value Base N word values CRC DA SA 83 L L H L H L H L H SH N word values from the base words requested by the Q Length L Nx2 208 D320 PLC User s Manual Write Words e Changes the content of the words assigned to the absolute address R L M K F or W e Can change n consecutive word contents Query Q Frame Base Base 0 word values Base N word values CRC DA SA 04 L I H L H L H L H N word values from the base words requested by the Q Length L Nx2 2 Response R Frame Fixed Appendix A D320 PLC Communication Protocol 209 Read Bits and Words e Reads the bits and or word contents of the specified absolute addresses e Can read bits and words regardless of their order and location in memory Query Q Frame AO A1 AN CRC DA SA 05 L L H L H L H L H Methods of assigning bit word abs address Assigning absolute address for bits 15 14 13 0 Abs address for the K127 12th bit 1BFC Ax 0001 1011 1111 1100 Absolute Address Ax L FC H 1B Assigning absolute address for word O 0 Bit Address Abs address for the K127 word 01BF 0 1 Word Address Ax 0100 0001 1011 1111 1 x Not Used Ax L BF H 41 Ax A0 A1 An Dx DO D1 Dn Response R Frame D1 Dn CRC DA SA 85 Lx L H L H L H For the AO A1 An requested by the Q the content DO D1 Dn of the word bit is returned If Ax denotes a bit address the Dx data is 1 byte On FF O
191. 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 will be returned Likewise a MODBUS Read Holding Register request for 3 registers starting at address 512 will return the values of D320 memory locations W0 W1 and W2 See Chapter 5 and Table 5 below for a listing of the absolute addresses of the memory locations in the D320 CPU Table 5 Absolute Memory Addresses Absolute Address Memory Type Register Addresses Decimal Hexadecimal External I O R000 R127 0 127 0000 007F Link Network Relays L000 L063 128 191 0080 00BF Internal Contacts M000 M127 192 319 00CO0 013F Internal Keep Contacts K000 K127 320 447 0140 01BF System Flags F000 F015 448 463 01C0 01CF Data Registers W0000 W2047 512 2559 0200 09FF T C Set Value SV000 SV255 2560 2815 0A00 OAFF T C Present Value PV000 PV255 2816 3071 0B00 OBFF System Registers SRO000 SR511 3072 3583 0C00 ODFF 236 D320 PLC User s Manual Description of Operation UDCP Mode When the PLC is configured for the User Defined Communications mode the following order of operation should be followed by the user program for Transmit Receive sequences 1 Set the proper configuration flags for the mode of operation desired F12 8 F11 2 F11 3 11 8 F11
192. resses are automatically assigned by the CPU no address is assigned to a blank module Chapter 5 CPU Operation and Memory Special Internal Addresses F000 to F015 System Flags 55 Address Function Details Remarks FO 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 Loop 0 F3 register Link control Link installation and operation mode setting Loop 1 F4 register Link status flag Link participating station information Loop 0 F5 register Link status flag Link participating station information Loop 1 F6 register Link status flag Link data receiving information flag Loop 0 F7 register Link status flag Link data receiving information flag Loop 1 F8 register Remote control flag Remote operation control flag Loop 0 F9 register Remote control flag Remote operation control flag Loop 1 F10 register Remote control flag Remote operation control flag Loop 2 F11 register User defined For port COM2 communication protocol User defined communication control flag F12 register Realtime Clock RTC installation remote I O setting etc F13 register System reserved F14 register PID control PID operation mode and operation stop control flag Channel 0 1 2 3 F15 regist
193. rotective circuit in parallel with the load e When opening or closing a DC inductive load using a relay output the addition of a protective circuit will significantly extend the life of the output contact Install a diode in parallel with the load 1 AC load Varistor Output Output Module Terminal i Output i Terminal COM Terminal Example of surge killer E COM Resistance 50 Q i Terminal i Capacity 0 47 uF i Note When using an SSR output the capacitor can delay the Off time Use i a resistor only 2 DC load Output Module Terminal COM Terminal Average rated current Over the load current e More than 3 times Pss Voltage within band the load voltage 38 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 i Output Module i Inductance Output Resistance Terminal Output Terminal COM Terminal COM Terminal External Fuse An external fuse can be used for overload protection The fuse within the module is provided to prevent damage in case of a short circuit on the output However the module fuse is not designed to protect the terminal in case of an overload It is recommended to attach an external fuse for each output point based on the particular application Short circuits in certain types of lo
194. ry MI 0011 0100 0101 0100 binary M2 0101 0110 0110 0100 binary M3 0111 1000 0111 0100 binary F1 8 1 On Chapter 6 Instructions 133 Instruction Mnemonic Count Number of On 1 Bits Range SUM Count On 1 bits in the S O Bit register B Word L1 Double words SUM Count the number of On 1 bits in the S register and store the result in the D register Description 1 Count the number of On 1 bits in the S register and store the result in the D register S 1 1 1 0 o 1 1 1 1 ofi 1 0 0 1 1 Number of On 1 is 11 e D ololololo olol of o ololo 1 o 1 1 D 000B 11 Decimal 2 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results RO ETT Initial conditions MO 1110 0111 1011 0011 binary D WO0 S MO W0 XXXX hex Operation results MO 1110 0111 1011 0011 binary WO 000B hex 11 decimal 134 D320 PLC User s Manual Instruction Mnemonic Carry Bit F1 8 Set Reset Range Reverse SC SC Set carry bit O Bit RC RC Reset carry bit L1 Word CC CC Reverse carry bit L1 Double words Ladder ik ie SC Carry bit set F1 8 X21 RC I R RC Carry bit reset F1 8 X90 CC RI CC Carry bit reverse F1 8 01 1 0 Descr
195. s 1BFC ID PC ID PLC ID CPU ID Response R Frame Base 0 Base 1 Base N 1 CRC DA SA 81 N Bit value Bit value Bit value L C Bits that are On are represented by the one byte value FF Bits that are Off have a value of 00 Length of information number of bytes from the length to the next CRC Response code 80 added to the gt original function code PLC ID CPU ID Peripheral Device ID PC ID are reversed from the Q message For the response the PLC is the sender and the PC the receiver so the DA and SA 206 D320 PLC User s Manual Write Bits Writing bits allows you to e Modify the contents of the bits stored in the absolute address R L M K or F e Change the bit state between On Off e Change multiple consecutive bytes Query Q Frame Base Base 0 Base 1 Base N 3 CRC DA SA 02 L H Bit value Bit value Bit value L H To turn On the desired bit value from the base enter FF To change to Off enter 00 Response R Frame Completion Code Appendix A D320 PLC Communication Protocol 207 Read Words e Read the content of the words R L M K F or W assigned to the absolute address e Read n consecutive words Query Q Frame Number of words to be read Word absolute address starting address For example K127 Word absolute address 01BF Base L BF H 01 Response R Frame Base 0 Base wo
196. s D320 PLC User s Manual This preface describes the contents of this manual and provides information on Support Services ii D320 PLC User s Manual About This Manual Purpose This manual focuses on describing the D320 Programmable Logic Controller PLC What s Inside This manual is organized in the following way Preface Chapter 1 Introduction Chapter 2 System Configuration Chapter 3 Product Specification 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 Preface iii Support Services It is Cutler Hammer s goal to ensure your greatest possible satisfaction with the operation of our products 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 Technical Support 1 800 809 2772 If you are in the U S or Canada you can take advantage of our toll free line for technical assistance with hardware and software product selection system design and installation and system debugging and diagnostics Technical
197. secure Is the external wiring screw loose Life expectancy of Parts Contact relay Electric life approx 10K to 300K operations refer to output module specifications Battery 3 years at 25 C 77 F Chapter 8 Troubleshooting Noise Problems 181 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 e The causes of noise e Installation tips for avoiding noise e Methods to identify and resolve noise problems 182 D320 PLC User s Manual Noise Occurrence Types of Noise e Radiation noise is transmitted in the form of a magnetic wave The amplitude of the magnetic wave is measured in Gauss e Conduction noise is transmitted through a direct path such as signal wiring or ground connections as a strong high voltage surge This type of noise is measured as voltage current or power e Normal mode single ended developed noise can come through the power and or the signal cables This type of noise 1s not equally distributed across the PLC input terminals e Common mode noise can come through the power and or the signal cables In this case the noise is close to the same amplitude thus the term common on both leads of the cable e Impulse noise is electrical or magnetic energy that has less than a 20
198. sed on the following circuit and assumes that the error encountered is that the output connected to R1 0 is not turned On when it should be RO 2 RO 3 R1 0 m kour C y eC jJ in the PLC Use GPC to To Flow2 Replace the output module Is the voltage at the R1 0 tenvinal Is the wiring to the output correct Replace screw and or terminal strip Fix replace wiring oe he led F Check replace the output device as needed Chapter 7 Testing and Troubleshooting 175 es E Are the input LEDs for RO 2 and R0 3 On Are inputs RO 2 and RO 3 On in PLC GPC to monitor Is the input voltage at the RO 2 RO 3 terminals correct Yes in Yes Refer to System Check r Is the wiring fromthe flow chart Replace the input module input ices 2 No Fix replace wiring v Is there a loose or No defective screw terrrinal Yes v Fix replace screw v Check replace the input devices as needed 176 D320 PLC User s Manual External Environment Check Check the external environment Is the temperature below 55 C 131 F Lower the temperature temperature above O C 82 F Raise the temperature Is the hurridity within the range of Control the humidity
199. ssesseseseeseeeeenen ener ener enne nnne 238 Chapter 1 Introduction 1 Introduction Welcome to the D320 PLC User s Manual The D320 Programmable Logic Controller PLC is a versatile and dependable industrial controller designed to handle a wide range of application 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 This chapter contains e An overview of this manual e The features of the D320 PLC e System installation considerations 2 D320 PLC User s Manual Overview of the Manual This manual contains the following information e Chapter 1 introduces the D320 PLC by describing its features and discussing installation considerations e Chapter 2 discusses various system configurations and products that can be used with the D320 PLC e Chapter 3 gives performance specifications and operating ranges of the CPU and the D320 series products e Chapter 4 describes installation and wiring guidelines and procedures including system design considerations wiring the power supply and connecting the PLC to a PC e Chapter 5 introduces many concepts you need to know to program the D320 PLC including terminology how the registers are used different types of address designations and the CPU processing procedure e Chapter 6 presents detailed information on the
200. stitution of number O Bit DLET direct output of number B Word E Double words Ladder R LET D Destination D S S Source Example S MO and MO is 123 D R3 and R3 is 456 Before execution MO 123 R3 456 After execution MO 123 R3 123 Description Range LET 0 to 65 535 DLET 0 to 4 294 967 295 1 Either a register R M K L or W address or a constant number can be assigned for S 2 When S isa register address copy the data of the register to D 3 WhenS isa constant number copy the value to D 4 This operation occurs on every scan for which the input condition to the instruction is true Example Program Expression Time Chart R000 2 R000 2 1 p R R000 3 SS M000 0 0000 0123 0123 MO000 1 0000 1 0100 0100 R000 3 0000 0000 0123 S M0000 100 D320 PLC User s Manual Instruction Mnemonic Increment Range INC Increment INC DINC LI Bit DINC BCD increment INCB DINCB E Word INCB E Double words DINCB Ladder D D I Decimal number increment D D 1 BCD increment Description 1 INC and DINC increase D in decimal by 1 when the input is On 2 INCB and DINCB increase D in BCD Binary Coded Decimal by 1 3 INC and INCB are word instructions for processing 16 bit data 4 DINC and DINCB are double word instructions for processing 32 bit data Example Program Expression Time Chart Input RO 1 M0005 decimal MOO08 BCD R000 1 I
201. ta and calculates the CRC of the received data JobID 4 9 Stores the received data in the internal receivable buffer and compares the CRC value sent by the PLC to the calculated CRC value It notifies the system that a successful communication is made when the two values match and proceeds on to the next sequence Appendix A D320 PLC Communication Protocol 215 else receiving Index max receiving frame 3 5 j else if index receiving Index max 1 receiving frame index Recport if receiving frame index lower byte Crc JobID JobID amp 0x05 else if index receiving Index max receiving frame index Recport if receiving frame index upper byte Crc JobID else JobID JobID amp 0x05 index j break case 10 Success TRUE j j unsigned int communication void struct time t unsigned far tm int ret Success FALSE receiving frame 0 PlcID receiving frame 1 PC ID retrialC retrial_limit watchdog 0 JobID 0 index 0 sending Index max 5 Crc OxFFFF do tm unsigned far 0x046C New tm Job if watchdog Time limit watchdog 0 retrialC JobID JobID amp 0x05 j if Old New amp 0x02 0 watchdog watchdog 1 Old New while retrialC 0 amp amp Success FALSE if retrialC 0 ret 1 else ret 0 return ret void Mword_reading void 1 Example of Read Register int i receiving frame 2 3 EXAMP
202. tallation Mounting 1 Insert the flanges at the base of the module into the slots at the bottom of the I O backplane 2 Swing the I O module up onto the backplane pressing firmly onto the backplane connector 3 Tighten the screw at top of module to establish a solid connection between the module and backplane lt a QTE N RET 30 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 The minimum installation sizes are given in the following diagram 3 95 in 100 mm N Lo Mo rogramming cable ll ee eee m 7 5 in 190 mm d Expansion Cable Connection Connecting the Expansion Cable e The expansion cable is connected between the connectors marked IN and OUT on the backplane e The expansion cable should not be run in the same wiring duct as the power control or communications wiring Base backplane Connect the cable from the OUT to the IN of the next backplane Expansion backplane Expansion backplane Expansion backplane Chapter 4 Insta
203. tate of an external input signal during program execution OUTR Immediately update the state of an external output signal during program execution Ch The external input output address 0 to 127 Description 1 Refreshes the input output data for the external I O module at register address Ch 2 These instructions are used when it is necessary to provide high speed input and output updates without limiting the size and length of the PLC program 3 Under normal operation the external inputs are read before the execution of the control program and the external outputs are updated at the end of the control program The INPR instruction is used to provide immediate input from the external input modules at any point inside the control program without waiting for the end of the scan Likewise the OUTR instruction allows the user to immediately update the state of an external output module at any point in the program 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression R0 0 INPR Ch 2 Chapter 6 Instructions 151 Operation Results Normal INPR OUTR Operation Example Read Inputs Read Inputs Program Program Read R2 Input Update R3 Output Update Update Outputs Outputs When RO 0 is On get Ch 2 R
204. tatus contacts only and are not used to modify or control the PLC Only the F1 5 instantaneous interrupt display contact should be used as an output contact by the user to be turned off after power loss indication 58 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 Output F12 13 RTC set 1 On when changing the year month or date Off I O when the data set is normal F12 14 RTC set 2 On when changing time min or sec Off when the I O data set is normal System Registers SRO to SR511 Address Function Detail SR000 CPU address Indicates the CPU ID number in the lower 8 bits O to 223 are the valid user defined values 255 is the default value SR001 CPU status Indicates current CPU information state stop remote control mode run mode error Error 1 Run control same as F15 CPU switch remote control REM 1 CPU switch RUN 1 CPU switch STOP 0 SR002 User watchdog Indicates the user program watchdog time unit msec SR003 Scan time Indicates the scan time when executing a program unit msec SR004 Max scan time Indicates maximum value of scan time when executing a program Initialized as zero when the program mode changes fr
205. ternal addresses 46 D320 PLC User s Manual Terminology This section introduces some terminology you should know 1 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 Bit A bit is the minimum unit required for calculation It can be either On 1 or Off 0 Byte A byte is made up of 8 bits It can hold data values from 0 to 255 In base 16 or hexadecimal a byte can be expressed as 0 to FF You cannot have a value greater than 255 when using one byte Word A word is made of 16 bits It can hold data values from 0 to 65 535 In base 16 a word can be expressed as 0 to FFFF Double Word A double word is made of 32 bits It can hold data values from 0 to 4 294 976 295 In base 16 a double word can be expressed as 0 to FFFFFFFF In the D320 a double word is made up of two consecutive word addresses Scan Time The CPU follows a procedure in which it 1 reads the inputs 2 processes the ladder program and 3 updates the outputs It continually repeats this process This 3 step process is called a scan and the time it takes to complete this process is the scan time In a typical PLC application most of the scan time is used to process the program When programming keep in mind that the scan time will increase as you increase the number of inputs a
206. the block of instructions is to be performed 2 Branch instructions such as JMP and CALL can be made inside the FOR NEXT loop 3 The number of loops to execute D value can be changed inside of the FOR NEXT loop This can be used to dynamically increase or decrease the number of loops performed while processing the loops 4 Ifthe D register is 0 before the FOR instruction the instructions between the FOR and NEXT instructions will NOT be executed Instead the program will jump directly to the instruction following the NEXT 5 Asthe FOR NEXT loop occurs within a single program scan a large value of D will lengthen the scan time of the program considerably 6 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression RoD FOR D W0 INC D M0 NEXT Operation Results Initial condition Operation results Chapter 6 Instructions W0 10 M0 0 W0 0 MO 10 143 When the RO 0 contact changes from Off gt On execution of the FOR NEXT loop occurs At the FOR instruction the value of WO is evaluated If WO is not 0 then the instructions between the FOR and NEXT INC D M0 is performed At the NEXT instruction 1 is subtracted from the value of WO and execution returns to the FOR instruction This is repeated 10 times until the value of WO is
207. the signal has changed from On Off The contact is Off for all other scans when the signal has not changed from Off or On 4 Both DIF and DEN can be used on the same bit address in a single scan Example Program Expression Time Chart R001 4 M002 4 RI um R001 4 i R001 5 R001 5 F m3 i scan 1scani i 1scan gt i4 gt it i i4 M002 4 Contact M002 4 is On if contact R001 4 changes from Off On or contact R001 5 changes from On Off 86 D320 PLC User s Manual Instruction Mnemonic Block Circuit Range ANB Connect circuit by block E Bit ORB O Word L1 Double words Ladder r A block R000 2 R000 0 R000 0 R000 2 R000 0 R000 0 R000 1 A block H OUT i R000 3 QUI R000 1 R000 3 Ecl B cde B block k gt ANB block in series ORB block in parallel Description 1 Block in series Series connection of more than two contacts Starts with STR or STN Ends with ANB 2 Block in parallel Parallel connection of more than two contacts Starts with STR or STN Ends with ORB 3 When programming in ladder GPC will automatically add the proper ANB and ORB instructions as required by the contact connections Example Program Expression ANB Program Expression ORB A block B block Chapter 6 Instructions 87 Instruction Mnemonic Master Control Set Reset Range MCS E
208. ti d deett usi cedente t t ide nd i SUDDOLt SeEVICES 254 ns tote eie dr ee M eA ANSE cet t st eld s tutius Ed UM rst estes iii Table of Contents v Chapter 1 Introduction 1 Overview of the Mamta 5 det dtr a E E E R tee E E 2 Eeaturescof the D320 PLG E E E eie E E E E E E T HEN coe 2 Self BIRYANI ea A E E E ATT AE E A deu game ateeeed wees 3 PID Loop Control goto PU E a es oad a a ede aad amt s 3 eaer aA Clocks EEE A id eo memi dt dete te dme s 3 Earge Prostrani Memory o oboe bet teet tu do oak Er tm Tes Eus 3 NOVRAM Battery Backup ion qe HH p RR RI RR HH RO eerie 3 I O and Special Function Module Support sess enne 3 Peripheral Supports csc cc e ea CERTO RR ETRURIAE Teen duds 4 System Installation Considerations secor nete ea e RE HER ae A rH iuga 4 Environmental Considerations ies eti e UO ERE eR eee m e eee eda 4 Installing Modules on the System sese et RII RETRO Rr ER Tee edd 4 Removing Modules from the System sse eren eren 4 Preventing PLC System Malfunctions eet etie ede eerie ee i er e ie e ERROR 5 Chapter 2 System Configuration 7 D320 PLC System Components oec ote tan ee te tete eevee re ire E E EEN EDER 8 D320 PLC Product tistremen a c iei ed ae E ead Ee es 9 D320 PECT O Contre uration 5 55 deii tu e REPE uerb o E etes 14 Module Placement Requirements sess enne enne tnnt n enr en nr en nre 14 D320 PLC Backplane Configurations eese e
209. tion Results MO 00 01 03 06 0D word apaoajag J KKK LELLI he LAR AAS E TofoTo T ble WK Cfo fof fof ofofo IfN 1 the bits shift by one and the LSB is always input from F1 8 IfN 2 the bits shift by two The bits are shifted one position and the first data input to the LSB is F1 8 The original MSB is stored in F1 8 The bits are again shifted one position with the LSB being set by the new F1 8 and F1 8 being changed to the state of the last MSB 120 D320 PLC User s Manual Instruction Mnemonic Rotate to the Right Range ROR Rotate the specified address to LI Bit DROR the right with the carry flag B Word E Double words Ladder ROR D Register address R i P N N Number of bits to rotate LSB 15 14131211109 876 54 32 1 0 See ee eae Description 1 Order Shift N bits to the right from high order bit to low order bit including the carry bit nput the carry bit F1 8 to the MSB most significant bit The LSB least significant bit moves to the carry bit F1 8 2 This instruction is different from the RRC instruction because it sends the LSB to the carry bit and the carry bit shifts to the MSB The input to the MSB can be changed by setting or clearing the carry bit 3 The D register is either a word or a double word For ROR word N 0 to 15 For DROR double word N 0 to 31 4 This operation will occur on every scan f
210. tion Shift data 1 condition 1 condition 2 Shift pulse condon condition2 Reset condition 3 Starting contact no SB SB 1 End contact no Eb 1 Condition 1 Input Data Condition 1 or 0 of the input data to the starting contact Sb 2 Condition 2 Shift Pulse Shift clock 3 Condition 3 Reset Reset all the bits from the starting contact Sb to the end contact Eb to 0 Description 1 The SR instruction can be used in the M and K address areas When the K address area is used data is maintained in the event of a power failure 2 The number of available SR commands is 256 The SR commands can be used independently of the timer counter 3 When the Shift Pulse input P input is turned on the starting contact Sb is set to the state of the Input Data input I input 4 As each Shift Pulse occurs data is shifted by 1 bit from the starting contact Sb to the end contact Eb If Sb is at a lower starting bit address than Eb the data is shifted up from Sb to Eb If Sb is at a higher starting bit address than Eb the data is shifted down from Sb to Eb 5 The total number of bits from Sb to Eb is from a minimum of 2 bits to a maximum of 2 047 bits 6 Sband Eb may not be the same bit address bit size of 1 7 Ifthe reset input is On all of the bits from Sb to Eb are set to 0 Examples Program Expression SR Sb K114 Eb K201 Chapter 6 Instructions 97 Time Chart Input RO O
211. tors for RS485 communications not connected 1 ON Lx m LR C NV RaO DIP1 On On Terminating resistors for RS485 communications connected A CAUTION e The communication port can be used for an RS232 or RS485 connection It will automatically select between the two e The terminating resistors are connected to the end of the communication line to help remove communication interference and signal distortion when it occurs between the PLC and other PLCs or peripherals The terminating resistors are typically used with long communication distances and the RS485 communication protocol 22 D320 PLC User s Manual Chapter 4 Installation and Wiring 23 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 e System design considerations e System installation guidelines e System wiring and installation procedures 24 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 Device Main power source External I O device Isolation transformer Interlock Circuit and Emergency
212. tree eene en 70 Arithmetic Instructions perte p RP OR e ER RED pate ax ope dvs E eee aee epe p REOR 71 Eogic Instructions 15 reote ts E T 72 Rotation Instructions 5s teet pere PROBE D PARARE ves ep Rete a a ea E Ce tote aseh avereteastad dn ERR EAS 72 Word Conversion Instt ctioDs zt eren ORE DR pepper p oped Eg e LAUR PREX ONLINE Deae tnnt pon 73 Bit Conversion InstEuctlOllS J C PR E DH ERATES eE AAE eae D ete e E RC RN Deae o dno Epp es 74 Transfer Instructions e eet eimi BER D ER apex REVERSE Qe bete e ERA ENTER De E dna ERO ecd 75 Block Processing Instructions eene nennen enne entier tnnt trente a AE a E n nne 76 Special Instructiofis c5 erede E ope edet t pes eee e E been tet te ER DR Evers 77 How to Read the Description of Instructions enne enne enne nennen enne 78 Instr ctiOn s 5 eene dp eG dn nte e Ro m E HEUTE 78 Leader PER 78 Table of Contents vii Examples is sf e anco qutt e tette IT o A E T f eee os 79 Basie Instr ction D tails iecore rer ete sitet erede reto ep nete oet iere thue etae metes tese a eE Ea 80 S R EER B N AE EA DUUM I CEA SL MN A A MM LM E NUM LOT 80 AND ANN ADN z echten HERE Uo OR TU TE E re EH E TENTER Ree HE 81 OR ORNC z uentus reu cM MM M IN DODO EE Dee edid 82 OUT SETSRST4I Uaec etaed a IM E e qe EEEE EE 83 Roi EE REM 84 STR DIF STR DFN AND DIF AND DFN OR DIF OR DEFN eee enne eene nnns 85 ANP OR uCneealeexdee et ium Me ated MeL qM Ote Ed Rhee steal 86 MGS M
213. uction About 150 types Process Basic instruction 0 2 to 0 4 uS step speed Application instruction 1 0 to 60 uS step Program capacity 24k steps 1 step 1 word 1k step 1 024 steps Memory capacity Local I O R R000 0 to R063 15 1 024 points 64 words Remote 1 O R R064 0 to R127 15 1 024 points 64 words Link contact L L000 0 to L063 15 1 024 points 64 words loop 0 MO000 0 to M063 15 1 024 points 64 words loop 1 Internal contact M MO000 0 to M127 15 2 048 points 128 words Retentive internal contact K K000 0 to K127 15 2 048 points 128 words System flags F F000 0 to F015 15 256 points Timer Counter TC or TIM 256 channels timer counter set point 0 to 65 535 Timer 0 01 second TCO000 to TC063 64 channels 0 1 second TCO064 to TC255 192 channels counter TCO000 to TC255 256 channels Link word W W0000 to W0127 128 words loop 0 W0128 to W0255 128 words loop 1 Data word W W0000 to W2047 2 048 words System registers W SR W2560 SR000 to W3071 SR511 512 words Clock function RTC year month day hour min sec day Comm function Port 1 Port 1 RS232C RS485 compatible 9600 19200 bps Port 2 Port 2 RS232C RS485 compatible 4800 9600 19200 38400 bps User defined communication protocol available 20 D320 PLC User s Manual Name and
214. ules Do not connect 24 V Chapter 4 Installation and Wiring 33 I O Module Wiring Digital Input Module Wiring Check Points e Refer to the instruction leaflet for the individual modules for specific limitations regarding the particular type of input sensor used e The input device connection methods are shown in the following graphics for the various types of digital input devices DC Sensor The following diagrams show the input device in connection with a DC sensor 1 Relay Type o Input Terminal Terminal Power for Input 2 Sinking NPN Type o Input Termina Input Power 34 D320 PLC User s Manual 3 Universal Type Sensor Termina IC ni tr ec i ni at Input Power 4 2 Wire Sensor Terminal IC ni tr e F Mi a t Terminal FONE Input Power 5 Sourcing PNP Type Input Power Chapter 4 Installation and Wiring 35 AC Sensor The following diagrams show the input device in connection with an AC sensor 1 Contact Type Terminal COM Terminal 2 SSR Triac Type 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 To avoid this leakage current connect the bridge resistance as shown in the below figure Example D320DIM1624D 12 to 24
215. usts the initial communication port and the board rate for communication Then initializes the 212 D320 PLC User s Manual void main void unsigned int i Selection of communication port clrscr printf PORT COMI 1 COM 2 GPC 232 3 GPC 485 4 GPC Parallel 5 scanf 9od amp port number if port number lt 1 port number gt 5 port number 5 Selection of Baudrate for Serial communication sending delay 10 if port number 5 printf GPC a BAUD RATE 9600 1 4800 2 2400 3 scanf d amp i if i lt 1 gt 3 il if i 3 i 4 if port_number 1 port_number 2 DIVISOR 12 i else DIVISOR 40 i receiving delay 3 i 1 Jnitialization of GPC card if port_number 1 PORTADD 0x3F0 if port_number 2 PORTADD 0x2F0 if port_number gt 3 amp amp port_number lt 5 PORTADD 0x300 outportb 0x303 0xC0 Mode 2 of 8255 outportb 0x303 0x05 PC2 1 of 8255 Disable IRQ2 outportb 0x301 0xFF PBO 1 of 8255 sending Enable RS 485 outportb 0x303 0x01 PCO 1 of 8255 Serial Input Enable if port_number 3 outportb 0x303 0x02 PC1 0 of 8255 Select RS 232 if port_number 4 outportb 0x303 0x03 PC1 1 of 8255 Select RS 485 if port number 5 outportb 0x303 0x00 PC0 0 of 8255 Disable SerialInput j else outportb PORTADD 0x09 inportb PORTADD 0x09 amp 0xF0
216. values over 65 535 in the K M R and W registers When a double word instruction is used it can represent values up to 4 294 967 295 2 When a value needs to be stored even through a loss of system power use the K or W area The K and W areas are preserved unless specifically erased The W area 1s erased by program downloads or special commands For bit operations such as setting resetting shifting or rotating use the M K or R registers You cannot perform bit operations on W registers The Set Value of timers and counters is stored in a special area of the W registers W2048 to W2303 These values can also be addressed using register type SV The Set Values are then referenced as SV000 to SV255 The Present Value of timers and counters is stored above the Set Values in the W registers from W2304 to W2559 These values can also be addressed using the PV designation PV000 to PV255 The Present Value is maintained in the Stop state It is also retentive the value is maintained through loss of power Internal External Address Designation The memory address designation types are R L M K F W SV PV SR and TC Types F and TC can only be used to designate bits Types W SV PV and SR can only be used to designate words Types R L M and K can be used for either bits or words A bit address is composed of a character R L M K F a three digit word address 000 to 127 a decimal point and a bit address 0 to
217. ving_frame 3 5 else if index sending Index_max 1 1 receiving frame index lower byte Crc Trsport receiving frame index else if index sending Index max 1 receiving frame index upper byte Crc Trsport receiving frame index watchdog 0 JobID index break case 2 case 7 1f port number 5 1 delay receiving delay if port number 4 outportb 0x301 0x00 else outportb PORTADD 0x0C inportb PORTADD 0x0C amp OxFD JobID break case 3 case 8 1f receiving occurring data Recport if data PC ID Crc OxFFFE index 1 receiving Index max 5 receiving frame 0 data Crc16 data JobID j j break case 4 case 9 if receiving occurring if index receiving Index max 1 receiving frame index Recport Crcl6 receiving frame index if index 3 if receiving_frame 3 0 receiving Index_max 256 5 JobID 0 5 A frame sends the data from the peripheral device to the PLC It resets the watchdog and the CRC Use a delay after the send to avoid errors due to communications delays JobID 1 6 Sends the Q and RR data When there are no errors it resets the watchdog and proceeds on to the next sequence JobID 2 7 A sequence that senses the sending of the QA and R data to the peripheral device after the completion of the functions that are received by the PLC from the previous frame JobID 3 8 Handles the received da
218. watchdog time is exceeded 4 This operation will occur on every scan for which the input condition is true On To perform the operation only on a change of input condition use the rising falling edge contact Example Program Expression Operation Results M0 0 WAT In certain applications the user program may contain A loops which cause lengthy scan times In the example turning on M0 0 prevents the PLC from stopping when the watchdog time maximum of 3 sec is exceeded For normal PLC control applications this instruction should not be used Chapter 6 Instructions 153 Instruction Mnemonic End Control Program Range END END End control program LI Bit Inserted automatically El Word O Double words Ladder END Description 1 This instruction indicates the end of the control program 2 This instruction is automatically added by GPC It is not programmed by the user 154 D320 PLC User s Manual Instruction Mnemonic Read Intelligent I O Data Range READ Read data from the shared O Bit memory of an intelligent I O unit B Word O Double words Ladder R READ READ Read NR3 words from slot NN5 module memory om Nix rumberregister address NR6 and store in words starting at RR1 Fr NN5 NR6 RRx register Description 1 RR1 Starting address for storing read data register NR3 Number of words to read number register NNS Slot number of the intell
219. when the error is corrected Normal Off F0 7 Module type error On when module information that is stored in the CPU and module that is installed are different types The error lamp is turned on and operation stops Normal Off F0 8 Input data control Off when the running CPU input module s data is not updated Input update is turned Off Normal On F0 9 Output data control Off to suspend updating of the output modules while the CPU is in the run state Output update is turned Off The outputs are maintained in their last valid state prior to update being disabled Normal On F0 10 All outputs OFF Turns all outputs off while CPU is in the run state Outputs are disabled Normal On F0 11 Constant cycle interrupt On when constant cycle interrupt instructions are used See the INT instruction The cycle time is defined by the user Normal Off F0 12 Watchdog error On when a scan time exceeds the watchdog set time Normal Off F0 13 Disable module type checking On when the CPU starts the initial run and the program is checked without performing input output module type verification Normal Off F0 14 Program changes during run On when error checking the program while in run mode If there are syntax errors the CPU is stopped Normal Off F0 15 Run state control On when the CPU is in the
220. x x x x SR294 Date day OlO x x x ix x x O OOo Oo0 x x x Set SR295 Year month O x x x xix x x O OO0o x x x x x Time lSR296 Second 00 oloix x x x x x oj o ojo ololo SR297 Hour minute OlO x x x x x x O x x x x x x x O bit 0 x bit change Note 1 Set the range as follows e Year 00 to 99 e Month 01 to 12 e Date 01 to 31 e Day 01 to 07 Sun to Sat e Hour 00 to 23 e Minute 00 to 59 e Second 00 to 59 2 Ladder setting method e For example current date and time are Tuesday August 25 1998 18 35 07 DLET Designate year R D W2854 Date indicators are SUN 01 date day S 98082503 MON 02 TUE 03 WED 04 THU 05 FRI 06 and SAT 07 Designate hour min sec 3 When changing the year month date or day new data is input in W2855 and W2854 then the F12 14 bit is turned On The F12 10 bit is kept Off 62 D320 PLC User s Manual 4 When changing the hour minute and second the new data is input in W2857 and W2856 then the F12 14 bit is turned on If the new data is not set correctly the F12 10 bit turns on 5 The display date and set date are expressed in BCD so it is convenient to input as hex 6 The year month and day are changed automatically 7 The RTC can be set using GPCS as follows e Inthe online menu choose System Control then select F1 System Control e Using the direction key enter in the dat
221. xecute block circuit using the LI Bit MCR specified conditions El Word L1 Double words Ladder MCS Enable processing of the following block of instructions MCR End block of instructions enabled by MCS Description 1 MCS Master Control Set Marks the start of a conditional block of instructions When the input conditions to the MCS are false the block of instructions that follow are executed as false Must be used with MCR 2 MCR Master Control Reset Marks the end of a conditional block of instructions Must be used with MCS 3 Up to seven MCS MCR blocks can be nested MCS Loop 2 4 Ifyou use eight or more MCS MCR nested blocks a syntax error will occur Example Program Expression Time Chart F0 15 R15 0 m SET R00 0 i i R000 0 i E Pod MCS R15 0 j es R15 0 RST MCR The circuit block R15 0 bit is reset 0 by R000 0 88 D320 PLC User s Manual Timer Counter SR Instruction Details Instruction Mnemonic Timer Range TIM On delay timer E Bit SST Single shot timer L1 Word O Double words Ladder H UIT In t seconds t SV x time base after the input is On the output is On Tum If the input is Off the output is Off Valid channel numbers Ch 0 through Ch 255 256 channels Done contact TC channel number SV set range 0 to 65 535 I dm For t seconds t SV x time base after input is On the output is On At Sus the end of t seconds the output is Of
222. xei x A E EE O mE 2 4 15 in DIES 105 mm ame rs es ioe aa i e Be HS 7 GO LES E JE ESN el alle PART JE ia le BE Y gt 3 45 in 87 mm 3 45 in 87 mm 32 Point Remote I O Module 16 Point Remote I O Module 198 D320 PLC User s Manual Appendix A D320 PLC Communication Protocol 199 Appendix A D320 PLC Communication Protocol The D320 PLC communication protocol provides a simple yet complete method of communications between the Cutler Hammer program loader software GPC and the PLC Using the open protocol outlined in this appendix the user can quickly and easily expand the capabilities of the overall PLC system by communicating to the 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 200 D320 PLC User s Manual Communication Rules Communication Environment The D320 PLC communications protocol uses the following settings e Half Duplex Asynchronous e No Parity e 1 Stop bit e Communication method RS232C or RS485 e Communication speed 9600 19200 or 38400 bps e Communication cable Refer to the cable configuration in Chapter 4 e Number of PLCs on a single network Maximum of 64 communicating
223. y contacts as they are mating Since all relay contacts have some bounce while mating arcing will occur and potentially melt the relay contact points This is the reason for having the resistor in the RC network described earlier Inductive load Inductive load v C CT Power Power e Transistor Output Module it is best to attach a flyback diode parallel to the inductive load as close as possible to the load In this configuration output switching frequency should be held to less than 20 times per minute Inductive load Transistor output module OUT e SSR Output Module attach a surge suppressor parallel to the inductive load as close as possible to the load In this configuration output switching frequency should be held to less than 20 times per minute Inductive load SSR output module OUT e 192 D320 PLC User s Manual Troubleshooting e 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 e Noise from power cables can be corrected by using a different ground for the PLC an isolation transformer attaching a line ground filter or changing the power wire connection of the PLC so that it is closer to the source of the power therefore lowering the power source im
224. ystem is powered up in the safe default state the PLC is powered up and begins system control As necessary the control system should be modified to ensure the proper delayed startup to prevent problems on power up For example 1 Run the PLC after turning on the power 2 Use an external or internal timer to delay the operation of the PLC 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 The control system should be designed specifically to ensure safe operation for these potential power loss conditions Voltage Drop Brownouts The PLC will stop and turn off its outputs if the PLC s power supply voltage drops below the allowable fluctuating voltage range see specifications for power supply units A CAUTION Steps should be taken to prevent damage to the PLC system through fluctuating voltages brownouts blackouts shorts ground faults or other power supply failures For example you may need to apply an isolation transformer before the incoming PLC power supply and or I O control wiring System Installation Guidelines Environmental Usage Conditions Avoid the Following Environments e Ambient temperature
225. z 24 bit counter up down encoder Counter 2 pulse outputs 40 kHz 2 control outputs PLC Communication Module Name Catalog Product Description Remarks Serial Data Unit D320SDU100 RS 232C x 2 Ch serial input and output enabled by SDU ladder command Provides data communication to various RS 232C devices 12 PLC Link Module D320 PLC User s Manual 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 programming installation and operation 32 units loop 3 loops transfer speed 0 5 Mbps Transfer distance total 800 m interface RS 485 multidrop Remote I O System Name Catalog Product Description Remarks Remote I O D320RMU300 Master Unit installed on main rack with CPU Master Module Remote I O D320RSU300 Replaces CPU on remote backplanes Slave Module D320RIM1624D 16 points DC IN terminal type D320RIM1615A 16 points AC IN terminal type D320RIM3224D 32 points DC IN connector type Remote O D320ROM800R 8 points RELAY OUT terminal type 4 points common Drops with Interface D320ROM1600R 16 points RELAY OUT terminal type 8 points common D320ROM1624D 16 points TR OUT terminal type D320ROM1615A 16 points AC OUT terminal type D320ROM3

Download Pdf Manuals

image

Related Search

Related Contents

RELAY CIRCUIT DIAGNOSTIC TESTER  Intel SSD DC S3710 1.2TB  colormagic - 株式会社エフ・エム・アイ  Auto Income Secrets  1 USB 7706 GENERAL SAFETY INSTRUCTIONS  USO E MANUTENZIONE - Tata Motors Italia  Yamaha BD-S1067 User's Manual  MODE D`EMPLOI  取扱説明書/ユーザーズ・ガイド 小容量無停電電源装置 Model: DL9125  IBM 365CS/CSD User's Manual  

Copyright © All rights reserved.
Failed to retrieve file