Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 23 of 60

DL205 PLC User Manual, Volume 1 of 2, pages 221 to 230

Pages 221 to 230 of 598

The original document is the PDF (12 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the AutomationDirect D2-04TD1, AutomationDirect D2-08TD2, AutomationDirect D2-16ND3-2, AutomationDirect D2-32ND3, Konnect-It D2-04TD1, Koyo D2-04TD1, Konnect-It D2-08TD2, Koyo D2-08TD2, and 5 more models

Page 221

Chapter 4: System Design and Configuration •X ON/XOFF Flow Control: When this function is enabled, the PLC will send data (PRINT command) until it receives a XOFF (0x13) Pause transmission command. It will continue to wait until it then sees a XON (0x11) Resume transmission command. This selection is only available when the “Non-Sequence(ASCII)” option has been selected and only functions when the PLC is sending data (not receiving with AIN command).

1 •R TS Flow Control: When this function is enabled, the PLC will assert the RTS signal(s) of the 2 port and wait to see the CTS signal(s) go true before sending data (PRINT command). This selection is only available when the “Non-Sequence(ASCII)” option has been selected and only functions when the PLC is sending data (not receiving with AIN command). 3 •E cho Suppression: Select the appropriate radio button based on the wiring configuration used on port 2. 4 Then click the button indicated to send the Port configuration to the CPU, and click Close. 5 RS–485 Network RS–485 signals are for long distances (1000 meters maximum). Use termination resistors at both ends of RS–485 network wiring, matching the impedance rating of the cable (between 6 100 and 500 ohms). 7 8 9 10 11 12 Port 2 Pin Descriptions (DL260 only) 1 RS–232 Network 13 RS–232 signals are used for shorter 2 distances (15 meters maximum) and 3 14 limited to communications between 4 5 two devices. 6 A 7 8 B 9 10 11 C 12 13 D 14 Termination Resistor

TXD+ / RXD+

TXD+ / RXD+

TXD– / RXD–

TXD– / RXD– Signal GND

Signal GND

RXD–

6

1

0V

ASCII Device

11

7

Cable: Use AutomationDirect L19954 (Belden 9842) or equivalent

RTS+

TXD+

RTS–

RXD+

CTS+

CTS–

15

5

10

DL260 CPU Port 2

TXD–

6

GND RXD TXD

CTS RTS

ASCII Device

Signal GND

1

2

TXD

RXD

7

11

3

4

RTS

CTS

5

10

15

CPU Port 2

15

5V TXD2 RXD2 RTS2 CTS2 RXD2– 0V 0V TXD2+ TXD2 – RTS2 + RTS2 – RXD2 + CTS2 + CTS2 –

5 VDC Transmit Data (RS-232) Receive Data (RS-232) Ready to Send (RS–232) Clear to Send (RS–232) Receive Data – (RS–422/RS-485) Logic Ground Logic Ground Transmit Data + (RS–422/RS–485) Transmit Data – (RS–422/RS–485) Request to Send + (RS–422/RS–485) Request to Send – (RS–422/RS–485) Receive Data + (RS–422/RS–485) Clear to Send + (RS-422/RS–485) Clear to Send – (RS–422/RS–485)

DL205 User Manual, 4th Edition, Rev. D

4-55

Page 222

Chapter 4: System Design and Configuration

Configure the DL250-1 Port 2 for Non-Sequence

1

2

3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4-56

230 240 250-1 260

Configuring port 2 on the DL250–1 for Non–Sequence enables the CPU to use the PRINT instruction to print embedded text or text/data variable message from port 2. See the PRINT instruction in chapter 5. In DirectSOFT, choose the PLC menu, then “Setup Secondary Comm Port.” • Port: From the port number list box at the top, choose “Port 2.” • Protocol: Click the check box to the left of “Non–Sequence.”

•M emory Address: Choose a V-memory address to use as the starting location for the port set-up parameters listed below. This location is the start of protocol memory buffer. It should not be used for other purposes. Buffer size = 2 + (Max receiving data size) / 2 or to allocate the maximum allowable space buffer size = 66 Words (for example V2000-V2102). •U se For Printing Only: Check the box to enable the port settings described below. Match the settings to the connected device. •D ata Bits: Select either 7–bits or 8–bits to match the number of data bits specified for the connected device. •B aud Rate: The available baud rates include 300, 600, 900, 2400, 4800, 9600, 19200, and 38400 baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors or noise problems on the network. Important: You must configure the baud rates of all devices on the network to the same value. Refer to the appropriate product manual for details. •S top Bits: Choose 1 or 2 stop bits to match the number of stop bits specified for the connected device. •P arity: Choose none, even, or odd parity for error checking. Be sure to match the parity specified for the connected device. Then click the button indicated to send the Port configuration to the CPU, and click Close. DL205 User Manual, 4th Edition, Rev. D

Page 223

Chapter 4: System Design and Configuration

RS–422 Network RS–422 signals are for long distances (1000 meters max.). Use termination resistors at both ends of RS–422 network wiring, matching the impedance rating of the cable (between 100 and 500 ohms). NOTE: For RS–422 cabling, we recommend AutomationDirect L19853 (Belden 8103) or equivalent.

RXD+ RXD– TXD+ TXD– Signal GND

ASCII Slave Device

9 TXD+ 10 TXD– 13 RXD+ 6 RXD– 11 RTS+ 12 RTS– 14 CTS+ 15 CTS– 7 0V

Termination Resistor at both ends of network PORT 2 Master

RS–232 Network RS–232 signals are used for shorter distances (15 meters maximum) and limited to communications between two devices. NOTE: For RS–232 cabling, we recommend AutomationDirect L19772 (Belden 8102) or equivalent.

Port 2 Pin Descriptions (DL250-1)

6 GND RXD TXD CTS RTS

ASCII Slave ASCII Device Device

Signal GND

1 2

TXD RXD

7

11

3 4

RTS CTS

5

10

15

CPU Port 2 CPU Port 2 Master

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

5V TXD2 RXD2 RTS2 CTS2 RXD2– 0V 0V TXD2+ TXD2 – RTS2 + RTS2 – RXD2 + CTS2 + CTS2 –

5 VDC Transmit Data (RS-232) Receive Data (RS-232) Ready to Send (RS–232) Clear to Send (RS–232) Receive Data – (RS–422) Logic Ground Logic Ground Transmit Data + (RS–422) Transmit Data – (RS–422) Request to Send + (RS–422) Request to Send – (RS–422) Receive Data + (RS–422 ) Clear to Send + (RS422) Clear to Send – (RS–422)

DL205 User Manual, 4th Edition, Rev. D

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

4-57

Page 224

Chapter 4: System Design and Configuration

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4-58

Notes

DL205 User Manual, 4th Edition, Rev. D

Page 225

RLL and Intelligent Box Instructions In This Chapter:

Chapter

5

Introduction. ..............................................................................5–2 Using Boolean Instructions..........................................................5–5 Boolean Instructions . .................................................................5–10 Comparative Boolean. ................................................................5–27 Immediate Instructions. ..............................................................5–33 Timer, Counter and Shift Register Instructions............................5–41 Accumulator/Stack Load and Output Data Instructions. .............5–53 Logical Instructions (Accumulator)..............................................5–71 Math Instructions. ......................................................................5–88 Transcendental Functions (DL260 only)......................................5–121 Bit Operation Instructions...........................................................5–123 Number Conversion Instructions (Accumulator). ........................5–130 Table Instructions. ......................................................................5–144 Clock/Calendar Instructions........................................................5–175 CPU Control Instructions. ...........................................................5–177 Program Control Instructions......................................................5–179 Interrupt Instructions..................................................................5–187 Intelligent I/O Instructions..........................................................5–191 Network Instructions. .................................................................5–193 Message Instructions. .................................................................5–197 Modbus RTU Instructions (DL260)..............................................5–205 ASCII Instructions (DL260)..........................................................5–211 Intelligent Box (IBox) Instructions (DL250-1/DL260 Only)..........5–230

Page 226

Chapter 5: Standard RLL Instructions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Introduction The DL205 CPUs offer a wide variety of instructions to perform many different types of operations. Several instructions are not available in all of the CPUs. This chapter shows you how to use these individual instructions. There are two ways to quickly find the instruction you need: • you know the instruction category (Boolean, Comparative Boolean, etc), use the header at the top of the page to find the pages that discuss the instructions in that category. you know the individual instruction name, use the following table to find the page that discusses the instruction.

Instruction ACON ACOSR ACRB ADD ADDB ADDBD ADDBS ADDD ADDF ADDR ADDS AEX AFIND AIN AND AND STR ANDB ANDD ANDE ANDF ANDI ANDMOV ANDN ANDNB ANDND ANDNE ANDNI ANDPD ANDS ASINR ATANR ATH ATT BCD BCDCPL

5-2

ASCII Constant Arc Cosine Real ASCII Clear Buffer Add BCD Add Binary Add Binary Double Add Binary Top of Stack Add Double BCD Add Formatted Add Real Add Top of Stack ASCII Extract ASCII Find ASCII IN And for contacts or boxes And Store And Bit–of–Word And Double And if Equal And Formatted And Immediate And Move And Not And Not Bit–of–Word And Negative Differential And if Not Equal And Not Immediate And Positive Differential And Stack Arc Sine Real Arc Tangent Real ASCII to Hex Add to Top of Table Binary Coded Decimal Tens Complement

Page 5–199 5–122 5–229 5–88 5–101 5–102 5–117 5–89 5–109 5–90 5–113 5–220 5–217 5–212 5–14, 5–32, 5–71 5–16 5–15 5–72 5–29 5–73 5–35 5–171 5–14, 5–32 5–15 5–23 5–29 5–35 5–23 5–74 5–121 5–122 5–137 5–166 5–131 5–133

Instruction BIN BCALL BEND BLK BTOR CMP CMPD CMPF CMPR CMPS CMPV CNT COSR CV CVJMP DATE DEC DECB DECO DEGR DISI DIV DIVB DIVBS DIVD DIVF DIVR DIVS DLBL DRUM EDRUM ENCO END ENI

DL205 User Manual, 4th Edition, Rev. D

Binary Block Call (Stage) Block End (Stage) Block (Stage) Binary to Real Compare Compare Double Compare Formatted Compare Real Number Compare Stack ASCII Compare Counter Cosine Real Converge (Stage) Converge Jump (Stage) Date Decrement Decrement Binary Decode Degree Real Conversion Disable Interrupts Divide Divide Binary Divide Binary Top of Stack Divide Double Divide Formatted Divide Real Number Divide Top of Stack Data Label Timed Drum Event Drum Encode End Enable Interrupts

Page 5–130 7–27 7–27 7–27 5–134 5–83 5–84 5–85 5–87 5–86 5–221 5–46 5–121 7–25 7–25 5–175 5–100 5–108 5–129 5–136 5–188 5–97 5–106 5–120 5–98 5–112 5–99 5–116 5–199 6–12 6–14 5–128 5–177 5–188

Page 227

Chapter 5: Standard RLL Instructions Instruction FAULT FDGT FILL FIND FINDB FOR GOTO GRAY GTS HTA INC INCB INT INV IRT IRTC ISG JMP LBL LD LDI LDIF LDA LDD LDF LDR LDX LDLBL LDSX MDRMD MDRMW MLR MLS MOV MOVMC MRX MWX MUL MULB MULBS MULD MULF MULR MULS NCON NEXT

Fault Find Greater Than Fill Find Find Block For/Next Goto/Label Gray Code Goto Subroutine Hex to ASCII Increment Increment Binary Interrupt Invert Interrupt Return Interrupt Return Conditional Initial Stage Jump Label Load Load Immediate Load Immediate Formatted Load Address Load Double Load Formatted Load Real Number Load Indexed Load Label Load Indexed from Constant Masked Drum Event Discrete Masked Drum Event Word Master Line Reset Master Line Set Move Move Memory Cartridge Read from MODBUS Network Write to MODBUS Multiply Multiply Binary Multiply Binary top of stack Multiply Double Multiply Formatted Multiply Real Multiply Top of Stack Numeric Constand Next (For/Next)

Page 5-197 5-152 5–150 5–151 5–173 5–180 5–179 5–141 5–182 5–138 5–100 5–107 5–187 5–132 5–188 7–188 7–24 5–24 5–179 5–58 5–39 5–40 5-61 5–59 5–60 5–64 5–62 5–145 5–63 6–19 6–21 5–185 5–185 5–144 5–145 5–205 5–208 5–94 5–105 5–119 5–95 5–111 5–96 5–115 5–199 5–180

Instruction NJMP NOP NOT OR OR OUT OR OUTI OR STR ORB ORD ORE ORF ORI ORMOV ORN ORNB ORND ORNE ORNI ORPD ORS OUT OUTB OUTD OUTF OUTI OUTIF OUTL OUTM OUTX PAUSE PD POP PRINT PRINTV RADR RD RFB RFT ROTL ROTR RST RSTB RSTBIT RSTI RSTWT

Not Jump (Stage) No Operation Not Or Or Out Or Out Immediate Or Store Or Bit–of–Word Or Double Or if Equal Or Formatted Or Immediate Or Move Or Not Or Not Bit–of–Word Or Negative Differential Or if Not Equal Or Not Immediate Or Positive Differential Or Stack Out Out Bit–of–Word Out Double Out Formatted Out Immediate Out Immediate Formatted Out Least Out Most Out Indexed Pause Positive Differential Pop Print ASCII Print from V–Memory Radian Real Conversion Read from Intelligent Module Remove from Bottom of Table Remove from Top of Table Rotate Left Rotate Right Reset Reset Bit–of–Word Reset Bit Reset Immediate Reset Watch Dog Timer

Page 7–24 5-177 5–19 5–12, 5–31, 5–75 5–19 5–36 5–16 5–13 5–76 5–28 5–77 5–34 5–171 5–12, 5–31 5–13 5–22 5–28 5–34 5–22 5–78 5–17, 5–65 5–18 5–66 5–67 5–36 5–37 5–69 5–69 5–68 5–26 5–20 5–70 5–201 5–227 5–136 5–191 5–157 5–163 5–126 5–127 5–24 5–25 5–148 5–38 5–178

DL205 User Manual, 4th Edition, Rev. D

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5-3

Page 228

Chapter 5: Standard RLL Instructions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Instruction RT RTC RTOB RX SBR SEG SET SETB SETBIT SETI SFLDGT SG SGCNT SHFL SHFR SINR SQRTR SR STOP STR STRB STRE STRI STRN STRNB STRND STRNE STRNI STRPD STT

5-4

Subroutine Return Subroutine Return Conditional Real to Binary Read from Network Subroutine (Goto Subroutine) Segment Set Set Bit–of–Word Set Bit Set Immediate Shuffle Digits Stage Stage Counter Shift Left Shift Right Sine Real Square Root Real Shift Register Stop Store Store Bit–of–Word Store if Equal Store Immediate Store Not Store Not Bit–of–Word Store Negative Differential Store if Not Equal Store Not Immediate Store Positive Differential Source to Table

Page 5–182 5–182 5–135 5–193 5–182 5–140 5–24 5–25 5–148 5–38 5–142 7–23 5–48 5–124 5–125 5–121 5–122 5–52 5–177 5–10, 5–30 5–11 5–27 5–33 5–10, 5–30 5–11 5–21 5–27 5–33 5–21 5–160

Instruction SUB SUBB SUBBD SUBBS SUBD SUBF SUBS SUBR SUM SWAP SWAPB TANR TIME TMR TMRF TMRA TMRAF TSHFL TSHFR TTD UDC VPRINT WT WX XOR XORD XORF XORMOV XORS

DL205 User Manual, 4th Edition, Rev. D

Subtract Subtract Binary Subtract Binary Double Subtract Binary Top of Stack Subtract Double Subtract Formatted Subtract Top of Stack Subtract Real Number Sum Swap Table Data ASCII Swap Bytes Tangent Real Time Timer Fast Timer Accumulating Timer Fast Accumulating Timer Table Shift Left Table Shift Right Table to Destination Up Down Counter ASCII Print to V–Memory Write to Intelligent Module Write to Network Exclusive Or Exclusive Or Double Exclusive Or Formatted Exclusive Or Move Exclusive Or Stack

Page 5–91 5–103 5–104 5–118 5–92 5–110 5–114 5–93 5–123 5–174 5–228 5–121 5–176 5–42 5–42 5–44 5–44 5–169 5–169 5–154 5–50 5–222 5–192 5–195 5–79 5–80 5–81 5–171 5–82

Page 229

Chapter 5: Standard RLL Instructions

Using Boolean Instructions

1 2 3 4 5 6 The following paragraphs show how these instructions are used to build simple ladder programs. 7 END Statement All DL205 programs require an END statement as the last instruction. This tells the CPU that 8 this is the end of the program. Normally, any instructions placed after the END statement will not be executed. There are exceptions to this such as interrupt routines, etc. Chapter 5 9 discusses the instruction set in detail. 10 11 12 13 Simple Rungs You use a contact to start rungs that contain both contacts and coils. The boolean instruction that does this is called a Store or, STR instruction. The output point is represented by the 14 Output or, OUT instruction. The following example shows how to enter a single contact and a single output coil. A B C D Do you ever wonder why so many PLC manufacturers always quote the scan time for a 1K boolean program? Simple, most programs utilize many boolean instructions. These are typically very simple instructions designed to join input and output contacts in various series and parallel combinations. Our DirectSOFT programming package is a similar program. It uses graphic symbols to develop a program; therefore, you don’t necessarily have to know the instruction mnemonics in order to develop your program. Many of the instructions in this chapter are not program instructions used in DirectSOFT, but are implied. In other words, they are not actually keyboard commands but they can be seen in a Mnemonic View of the program once the DirectSOFT program has been developed and accepted (compiled). Each instruction listed in this chapter will have a small chart to indicate how the instruction is used with DirectSOFT and the HPP. DS HPP

X0

Implied Used

DirectSOFT Example

All programs must have an END statement

Y0

OUT

END

DirectSOFT Example

X0

Handheld Mnemonics

Y0

OUT

STR X0 OUT Y0 END

END

DL205 User Manual, 4th Edition, Rev. D

5-5

Page 230

Chapter 5: Standard RLL Instructions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5-6

Normally Closed Contact Normally closed contacts are also very common. This is accomplished with the Store Not, or STRN instruction. The following example shows a simple rung with a normally closed contact. DirectSOFT Example

Handheld Mnemonics

X0

Y0 OUT

STRN X0 OUT Y0 END

END

Contacts in Series Use the AND instruction to join two or more contacts in series. The following example shows two contacts in series and a single output coil. The instructions used would be STR X0, AND X1, followed by OUT Y0. DirectSOFT Example X0

Handheld Mnemonics Y0

X1

OUT

STR X0 AND X1 OUT Y0 END

END

Midline Outputs Sometimes it is necessary to use midline outputs to get additional outputs that are conditional on other contacts. The following example shows how you can use the AND instruction to continue a rung with more conditional outputs. DirectSOFT Example X0

Handheld Mnemonics Y0

X1

OUT Y1

X2

OUT X3

Y2 OUT

END

DL205 User Manual, 4th Edition, Rev. D

STR X0 AND X1 OUT Y0 AND X2 OUT Y1 AND X3 OUT Y2 END