The text of a manual · part 37 of 38
DL06 Micro PLC User Manual, Volume 2 of 2, pages 360 to 369
Pages 360 to 369 of 370
The original document is the PDF (6.0 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.
Page 360
Appendix K: Introduction to Serial Communications
K-Sequence Communications
1 2 3 4 E 6 7 H 9 10 K 12 13 14 A B C D
The K-Sequence protocol can be used for communication with DirectSOFT 5, an operator interface or any other device that can be a K-Sequence master. The DL06 PLC can be a KSequence slave on either port 1 or port 2. The DL06 PLC cannot be a K-Sequence master. In order to use port 2 for K-Sequence communications you first need to setup the port using either DirectSOFT 5 or ladder logic as described above.
DirectNET Communications The DirectNET protocol can be used to communicate to another PLC or to other devices that can use the DirectNET protocol. The DL06 can be either be used as a master using port 2 or as a slave using either port 1 or port 2. In order to use port 2 for DirectNET communications you must first setup the port using either DirectSOFT 5 or ladder logic as previously described. For network slave operation, nothing more needs to be done. Port 2 will function as a slave unless network communications instructions are executed by the ladder logic program. For a network master operation you will simply need to add some ladder rungs using the network communication instructions RX and/or WX. If you use more than one network communidcation instruction is executed at any given time. If you have just a few network communications instructions in your program, you can use discrete bits to interlock them. If you are using many network communications instructions, a counter or a shift register will be a more convenient way to interlock the instructions. The following step-by-step procedure will provide you the information necessary to set up your ladder program to receive data from a network slave.
Step 1: Identify Master Port # and Slave # The first Load (LD) instruction identifies the communications port number on the network master (DL06) and the address of the slave station. This instruction can address up to 99 MODBUS slaves, or 90 DirectNET slaves. The format of the word is shown to the right. The “F2” in the upper byte indicates the use of the right port of the DL06 PLC, port number 2. The lower byte contains the slave address number in BCD (01 to 99).
Step 2: Load Number of Bytes to Transfer
K–10
The second Load (LD) instruction determines the number of bytes which will be transferred between the master and slave in the subsequent WX or RX instruction. The value to be loaded is in BCD format (decimal), from 1 to 128 bytes.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
F
2
0
1
Slave address (BCD) Port number (BCD) Internal port (hex) LD KF201
6
4
(BCD)
# of bytes to transfer LD K64
Page 361
Appendix K: Introduction to Serial Communications The number of bytes specified also depends on the type of data you want to obtain. For example, the DL06 Input points can be accessed by V-memory locations or as X input locations. However, if you only want X0 – X27, you’ll have to use the X input data type because the V-memory locations can only be accessed in 2-byte increments. The following table shows the byte ranges for the various types of DirectLOGIC products.
1 2 DL05 / 06 / 205 / 350 / 405 Memory Bits per unit Bytes 3 V-memory T / C current value Inputs (X, SP) 4 Outputs (Y, C, Stage, T/C bits) E Scratch Pad Memory Diagnostic Status 6 DL330 / 340 Memory Bits per unit Bytes Data registers T / C accumulator 7 I/O, internal relays, shift register bits, T/C bits, stage bits H Scratch Pad Memory Diagnostic Status(5 word R/W) 9 Step 3: Specify Master Memory Area 4 0 6 0 0 (octal) The third instruction in the RX or WX sequence is a 10 Load Address (LDA) instruction. Its purpose is to Starting address of load the starting address of the memory area to be master transfer area K transferred. Entered as an octal number, the LDA instruction converts it to hex and places the result in the accumulator. 12 For a WX instruction, the DL06 CPU sends the number of bytes previously specified from its memory 13 area beginning at the LDA address specified. For an RX instruction, the DL06 CPU reads the 14 number of bytes previously specified from the slave, placing the received data into its memory area A beginning at the LDA address specified. NOTE: Since V-memory words are always 16 bits, you may not always use the whole word. For example, if B you only specify 3 bytes and you are reading Y outputs from the slave, you will only get 24 bits of data. In this case, only the 8 least significant bits of the last word location will be modified. The remaining 8 bits are not affected. C D 16 16 8
2 2 1
8
1
8 8
1 1
8 16
1 2
1
1
8 16
1 10
LDA O40600
MSB
V40600
LSB
15
MSB
0
V40601
LSB
15
0
DL06 Micro PLC User Manual, 3rd Edition Rev. A
K–11
Page 362
Appendix K: Introduction to Serial Communications
Step 4: Specify Slave Memory Area
1 2 3 4 E 6 7 H 9 10 K 12 13 14 A B C D
SP116
LD KF201
The last instruction in our sequence is the WX or RX instruction itself. Use WX to write to the slave, and RX to read from the slave. All four of our instructions are shown to the right. In the last instruction, you must specify the starting address and a valid data type for the slave.
LD K64 LDA O40600
• DirectNET slaves – specify the same address in the WX and RX instruction as the slave’s native I/O address
RX
Y0
• MODBUS DL405, DL205, or DL06 slaves – specify the same address in the WX and RX instruction as the slave’s native I/O address
• MODBUS 305 slaves – use the following table to convert DL305 addresses to MODBUS addresses
DL305 Series CPU Memory Type–to–MODBUS Cross Reference (excluding 350 CPU) PLC Memory Type
PLC Base Address
TMR/CNT Current Values
R600
V0
I/O Points Data Registers Stage Status Bits (D3-330P only)
IO 000 R401,R400 S0
GY0 V100 GY200
K–12
MODBUS PLC Memory Base Address Type TMR/CNT Status Bits Control Relays Shift Registers
DL06 Micro PLC User Manual, 3rd Edition Rev. A
PLC Base Address
MODBUS Base Address
CT600
GY600
CR160 SR400
GY160 GY400
Page 363
Appendix K: Introduction to Serial Communications
Communications from a Ladder Program Typically network SP117 Y1 communications will last longer SET than 1 scan. The program must SP116 wait for the communications to LD KF201 finish before starting the next Port Communication Error transaction. LD Port Busy K0003 Port 2, which can be a master, has two Special Relay contacts LDA O40600 associated with it (see Appendix D for comm port special RX relays).One indicates “Port Y0 busy”(SP116), and the other indicates ”Port Communication Error”(SP117). The example above shows the use of these contacts for a network master that only reads a device (RX). The “Port Busy” bit is on while the PLC communicates with the slave. When the bit is off the program can initiate the next network request. The “Port Communication Error” bit turns on when the Interlocking Relay PLC has detected an error. Use of this bit is optional. SP116 C100 LD When used, it should be ahead of any network instruction KF201 boxes since the error bit is reset when an RX or WX instruction is executed. LD K0003
Multiple Read and Write Interlocks If you are using multiple reads and writes in the RLL program, you have to interlock the routines to make sure all the routines are executed. If you don’t use the interlocks, then the CPU will only execute the first routine. This is because each port can only handle one transaction at a time. In the example to the right, after the RX instruction is executed, C100 is set. When the port has finished the communication task, the second routine is executed and C100 is reset. If you’re using RLLPLUS Stage Programming, you can put each routine in a separate program stage to ensure proper execution and switch from stage to stage allowing only one of them to be active at a time.
LDA O40600
Interlocking Relay SP116
C100
RX VY0 C100 SET LD KF201 LD K0003 LDA O40400 WX VY0 C100 RST
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 E 6 7 H 9 10 K 12 13 14 A B C D
K–13
Page 364
Appendix K: Introduction to Serial Communications
MODBUS RTU Communications
1 2 3 4 E 6 7 H 9 10 K 12 13 14 A B C D K–14
The MODBUS RTU protocol can be used for communication with any device that uses the MODBUS RTU protocol. The protocol is very common and is probably the closest thing to an “industry standard” protocol in existence. The DL06 can be a MODBUS RTU slave on either port 1 or port 2, and it can be a MODBUS RTU master on port 2. The RS 485 wiring standard may be used on port 2 for the MODBUS RTU protocol only. In order to use port 2 for MODBUS RTU communications you must first set up the port using either DirectSOFT 5 or ladder logic as previously described. For network slave operation, nothing more needs to be done. Port 2 will function as a slave unless network communications instructions are executed by the ladder logic program. For network master operation the MODBUS RTU network communication instructions MRX and/or MWX needs to be added to some ladder rungs. If more than one network communication instruction is used, the rungs need to be interlocked to ensure that only one communication instruction is executed at any given time. If only a few network communications instructions are used in your program, discrete bits can be used to interlock them. If many network communicaitons instructions are used, either a counter or a shift register will be a more convenient way to interlock the instructions.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 365
Index
A
C
Accumulating Fast Timer instruction, 5–42 Accumulating Timer (TMRA) instruction, 5–42 Accumulator, 5–69 Accumulator Instructions, 5–52 Aliases, 3–31 Analog IBoxes, 5–230 Approvals, 2–10 ASCII Conversion Table, G-2 ASCII In/Out and PRINT, 4–11 ASCII Instructions, 5–210 Auto tuning error, 8–48 Auto Tuning Procedure, 8–45 Automatic Trapezoidal Profile, E–47 Auxiliary Functions, 3–9, A–2 CPU Configuration, A–5 EEPROM Operations, A–8 Handheld Programmer Configuration, A–8 Password Operations, A–9 RLL Operations, A–4 via DirectSOFT32, A–3 via the Handheld Programmer, A–3 V-memory Operations, A–4
B Basic EMC Installation Guidelines, J-4 Battery Backup, 3–8 BCD Numbering System, I–5 Binary Numbering System, I–2 Bit Override, 9–19 Boolean Instructions, 5–5, 5–10 Bumpless Transfer, 8–2, 8–3, 8–13, 8–26, 8–76, 8–77
C Data Type, 3–26 C-more, I-9 Cables programming, 1–8 Cascade Control, 8–65 Tuning, 8–67 Changing Date and Time, 10–14 Clock / Calendar Instructions, 5–171 Combination Networks, 5–7 Comm Port 2, 3–4 Comm Ports, configuring, 4–7 Communication IBoxes, 5–231 Communications from a Ladder Program, K–13 Read and Write Interlocks, K–13 Communications Problems, 9–7 Communications Protocols, K–3 Comparative Boolean Instructions, 5–26 Components, 1–6 Connecting DC I/O, 2–18 Connections power input, 1–8 programming device, 1–8 toggle switches, 1–7 Contacts in Series, 5–6 Control Relay Bit Map, 3–36 Converge Jump instruction, 7–23 Converge Stage instruction, 7–23 Convergence Jump instruction, 7–20 Convergence Stages, 7–19 Counter Example Using Discrete Status Bits instruction, 5–46 Counter I/O IBoxes, 5–231 Counter Status Bit Map, 3–38 CPU Features, 3–2
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D i-1
Page 366
Index
1 2 3 4 5 6 i 7 9 10 11 12 13 14 A B C D i-2
CPU Operation, 3–12 CPU Setup, 3–5 CPU Specifications, 3–3 CT Data type, 3–27
D Data Type Mismatch, I–7 Date and Time, 10–14 DC input wiring, 2–23 DC output wiring, 2–24 Diagnostics, 9–2 Dimensions, 2–7 DIN rail mounting, 2–9 DirectNET, 4–9, K–10 DirectNET Port Configuration, 4–10 Discrete Helper IBoxes, 5–230 Discrete Inputs with Filter, E–73 DL06 Error Codes, B–2 DL06 PLCMemory, F-2 DL06 Port Pinouts, K–5 DL06 Port Specifications, K–5 Drum Instruction, 6–12 chart representation, 6–3 counter assignments, 6–6 drum control techniques, 6–10 event drum (EDRUM), 6–14 handheld programmer mnemonics, 6–16 masked event drum (MDRMD), 6–19, 6–21 overview, 6–8 powerup state, 6–9 self-resetting, 6–11 step transitions, 6–11 Terminology, 6–2 Drum sequencer programming, 1–11 Duplicate Reference Check, 9–13
E Edits, Run-time, 9–14 Electrical Noise, 9–10 END Instruction, 9–12 END Statement, 5–5 Error Code Locations, 9–3 Error Codes, 9–4, 9–5 Error Term Selection, 8–33 Errors, 9–2 European Union Directives, J-2
F Feedforward Control, 8–70 Force I/O, 3–14 Forcing I/O Points, 9–16 Freeze Bias, 8–11, 8–34 Front Panel, 2–5 Fuse protection, 2–11
H Hexadecimal Numbering System, I–3 High-Speed Counter, E–7 High-speed I/O wiring, 2–25 High-Speed Interrupts, E–64 HSIO Features, E–2 HSIO Operating Mode, E–4 Hysteresis, 8–3, 8–13, 8–36, 8–37, 8–38
I I/O Configuration, 4–4 I/O type selection, 1–5 Indicators, 9–6 Inductive loads, 2–21 Initial Stage (ISG), 7–22
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 367
Index
Instruction execution times, C–3 Instruction index, 5–2 Instructions drum, 6–12 stage, 7–21 stage programming, 7–2 Instructions, by category Accumulator / Stack Load, 5–52 Bit Operation, 5–120 Boolean, 5–10 Clock / Calendar, 5–171 Comparative, 5–26 CPU Control, 5–173 Immediate, 5–32 Logical, 5–69 Math, 5–86 Number Conversion, 5–127 Table, 5–141 Timer, Counter and Shift Register, 5–39 Transcendental, 5–118 Intelligent Box (IBox) Instruction Index, 5–230
K K-Sequence, K–10
L LCD Display Panel, 10–2 LCD Installation, 10–3 LCD instruction, 10–26 LCD Keypad, 10–2 LCD Menu Navigation, 10–5 Loop Mode, 8–27 Loop Table Word Definitions, 8–20
M
Manual, documentation, 1–2 Marine Use, 2–10 Math IBoxes, 5–230 Memory EEPROM, 1–12 FLASH, 1–12 Memory IBoxes, 5–230 Memory Map, 3–25, 3–32 Message Instructions, 5–186 Midline Outputs, 5–6 MODBUS, 4–9 MODBUS RTU Communications, K–14 MODBUS RTU Instructions, 5–204 Mode 10, E–7 Mode 20, E–24 Mode 30, E–38 Mode 40, E–64 Mode 50, E–69 Mode 60, E–73 Mode Switch, 3–6 Motion Control, E–2 Mounting Guidelines, 2–7 Clearances, 2–8 MRX instruction, 4–22 MWX instruction, 4–22
N Network Master, 4–18 Network Slave, 4–12 Network Specification, 4–8 Noise, 9–10 Non-volatile V-memory, F-3 Not Jump, 7–22 Numbering Systems, 3–23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Maintenance, 9–2 DL06 Micro PLC User Manual, 3rd Edition Rev. A i-3
Page 368
Index
O
1 2 3 4 5 6 i 7 9 10 11 12 13 14 A B C D i-4
Octal Numbering System, I–4
P Parallel Branches in Series, 5–7 Parallel Elements, 5–7 Parallel Processing, 7–19 Password, 3–11, 10–17 PAUSE Instruction, 9–12 PID Analog Filter, 8–55 DirectSOFT 5 Filter Intelligent Box Instruction, 8–57 Error Flags, 8–18 Example Program, 8–72 Loop Modes, 8–3, 8–27, 8–53, 8–54, 8–66 Parameters, 8–32 Setup Alarms, 8–35 Special Features, 8–53 PID Alarms, 8–35 Calculation Overflow/Underflow Error, 8–38 Hysteresis, 8–38 Mode/Alarm Bit Description, 8–23 Monitor Limit, 8–35 Programming Error, 8–38 PV Deviation, 8–36 Rate-of-Change, 8–37 PID Loop Alarms, 8–13 Auto Tuning, 8–40 Configure, 8–25 Features, 8–2 Manual Tuning, 8–40, 8–41, 8–44, 8–47, 8–55 Mode, 8–27 Operating Modes, 8–14 Operation, 8–9
Program Setup, 8–72 Reverse Acting, 8–12, 8–14, 8–26, 8–40 Setup, 8–18 Terminology, 8–77 Troubleshooting Tips, 8–75 PID Mode 2 Word Description, 8–22 PID Mode Setting 1 Description, 8–21 Port Setup, K–6 Position Algorithm, 8–9, 8–15, 8–78 Position Form, 8–9 Power Budgeting, 4–5 Power supply, 2–12 Product Weight table, H–2 Products and Data Types, I–9 Program Mode, 3–13 Programming Devices, 2–15 Pulse Catch Input, E–69 Pulse Output, E–38
Q Quick Start, 1–6
R Ramp/Soak Generator, 8–58 Controls, 8–61 DirectSOFT 5 Ramp/Soak Example, 8–63 Profile Monitoring, 8–62 Ramp/Soak Flag Bit Description, 8–23 Ramp/Soak Table Location, 8–24 Relay Ladder, 8–63 Table, 8–59 Table Flags, 8–61 Test Profile with PID View, 8–64 Testing, 8–62 Rate-of-Change, 8–3, 8–13, 8–14, 8–37 Real Numbering System, I–5
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 369
Index Relay outputs, 2–20 Remote I/O Bit Map, 3–39 Reset Windup, 8–10, 8–34, 8–78 Response Time, 3–17 Retentive Memory Ranges, 3–10 RUN Indicator, 9–7 Run Mode, 3–13 Run Time Edits, 9–14
S S Data type, 3–28 Safety, 2–2 Emergency Stops, 2–3 Orderly System Shutdown, 2–4 Scan Time, 3–20 Serial Communications, K–2 RS-232C, K–2 RS-422, K–2 RS-485, K–3 Series Branches in Parallel, 5–7 Signed vs. Unsigned Integers, I–8 Simple Rungs, 5–5 Sinking / sourcing concepts, 2–16 Slot Numbering, 4–3 SP Data Type, 3–28 Special Instructions, 9–12 Special Relays, D–2 Special Relays, Error Codes, 9–3 Specifications, 2–26 Specifications, environmental, 2–10 Square Root, 8–14 Stage Control / Status Bit Map, 3–34 Stage Counter instruction, 7–17 Stage instructions, 7–21 Stage Jump Instruction, 7–7 Stage Programming, 7–2, 7–15 convergence, 7–19 emergency stop, 7–14 four steps to stage programmig, 7–9 garage door opener example, 7–10 introduction, 7–2 jump instruction, 7–7 mutually exclusive transitions, 7–14 parallel processes, 7–12 parallel processing concepts, 7–19 power flow transition, 7–18 program organization, 7–15 questions and answers, 7–27 stage instruction characteristics, 7–6 stage view, 7–18 state transition diagrams, 7–3 supervisory process, 7–17 timer inside stage, 7–13 Startup, 9–11 State Diagram, 7–11 Status Indicators, 3–6 Step Transitions, 6–4 Step Trapezoidal Profile, E–46 STOP Instruction, 9–12 Syntax Check, 9–11 System Design, 1–10
T T Data Type, 3–26 Technical Support, 1–2 Terminal Block Removal, 2–6 Time-Proportioning Control, 8–68 On/Off Control Program, 8–69 Timer (TMR) and Timer Fast (TMRF), 5–40 Timer Example Using Discrete Status Bits instruction, 5–41 Timer Status Bit Map, 3–38
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D i-5