The text of a manual · part 36 of 53
DL06 Micro PLC User Manual, Volume 1 of 2, pages 350 to 359
Pages 350 to 359 of 524
The original document is the PDF (6.4 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 Direct Logic DL06 and Koyo DL06 D0-06DD1
Page 350
Chapter 5: Standard RLL Instructions - Network Instructions
Network Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Read from Network (RX) DS32
Used
HPP
Used
5–196
The Read from Network instruction is used by the master device on a network to read a block of data from a slave device on the same network. The function parameters are loaded into the first and second level of the accumulator stack and the accumulator by three additional instructions. Listed below are the steps necessary to program the Read from Network function.
RX A aaa
• Step 1: Load the slave address (0-- 90 BCD) into the first byte and the PLC internal port (KF2) or slot number of the master DCM or ECOM (0-- 7) into the second byte of the second level of the accumulator stack. • Step 2: Load the number of bytes to be transferred into the first level of the accumulator stack. • Step 3: Load the address of the data to be read into the accumulator. This parameter requires a HEX value. • Step 4: Insert the RX instruction which specifies the starting Vmemory location (Aaaa) where the data will be read from in the slave.
Helpful Hint:, For parameters that require HEX values, the LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. Operand Data Type ....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP Program Memory . . . . . . . . . . . . . . . . . . . . . . . $
DL06 Micro PLC User Manual, 3rd Edition Rev. A
DL06 Range aaa See memory map See memory map 0–777 0–777 0–1777 0–1777 0–377 0–177 0–777 0–7680 (2K program mem.)
Page 351
Chapter 5: Standard RLL Instructions - Network Instructions In the following example, when X1 is on and the port busy relay SP116 (see special relays) is not on, the RX instruction will access port 2 operating as a master. Ten consecutive bytes of data (V2000 – V2004) will be read from a CPU at station address 5 and copied into Vmemory locations V2300–V2304 in the CPU with the master port. Direct SOFT32 DirectSOFT 5 X1
SP116
LD KF205 The constant value KF205 specifies the port number (2) and the slave address (5)
Master CPU
Slave CPU
LD K10 The constant value K10 specifies the number of bytes to be read LDA O 2300 Octal address 2300 is converted to 4C0 HEX and loaded into the accumulator. V2300 is the starting location for the Master CPU where the specified data will be read into
V2277
X
X
X
X
X
X
X
X V1777
V2300
3
4
5
7
3
4
5
7
V2000
V2301
8
5
3
4
8
5
3
4
V2001
V2302
1
9
3
6
1
9
3
6
V2002
V2303
9
5
7
1
9
5
7
1
V2003
V2304
1
4
2
3
1
4
2
3
V2004
V2305
X
X
X
X
X
X
X
X V2005
RX V2000 V2000 is the starting location in the for the Slave CPU where the specified data will be read from
Handheld Programmer Keystrokes $
B STR
1
W ANDN
SHFT
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
R ORN
X SET
ENT SP STRN
3 3
B
B
ENT
1
6
SHFT
K JMP
SHFT
F
SHFT
K JMP
B
A
C
D
A 3
G
1
0
1
A 2
A
A 0
0
3
2 C
5
0
C
A 2
F 0
5
ENT A
0 A
0
SHFT
0
ENT
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
ENT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5–197
Page 352
Chapter 5: Standard RLL Instructions - Network Instructions
Write to Network (WX)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
Used
5–198
The Write to Network instruction is used to write a block of data from the master device to a slave device WX on the same network. The function parameters are A aaa loaded into the accumulator and the first and second level of the stack. Listed below are the program steps necessary to execute the Write to Network function. Step 1: Load the slave address (0–90 BCD) into the low byte and “F2” into the high byte of the accumulator (the next two instructions push this word down to the second layer of the stack). Step 2: Load the number of bytes to be transferred into the accumulator (the next instruction pushes this word onto the top of the stack). Step 3: Load the starting Master CPU address into the accumulator. This is the memory location where the data will be written from. This parameter requires a HEX value. Step 4: Insert the WX instruction which specifies the starting V-memory location (Aaaa) where the data will be written to in the slave. Helpful Hint:, For parameters that require HEX values, the LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. Operand Data Type ....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP Program Memory . . . . . . . . . . . . . . . . . . . . . . . $
DL06 Micro PLC User Manual, 3rd Edition Rev. A
DL06 Range aaa See memory map See memory map 0–777 0–777 0–1777 0–1777 0–377 0–177 0–777 0–7680 (2K program mem.)
Page 353
Chapter 5: Standard RLL Instructions - Network Instructions In the following example when X1 is on and the module busy relay SP116 (see special relays) is not on, the WX instruction will access port 2 operating as a master. Ten consecutive bytes of data is read from the Master CPU and copied to V-memory locations V2000–V2004 in the slave CPU at station address 5. Direct SOFT32 DirectSOFT 5 X1
SP116
LD KF205 The constant value KF205 specifies the port number (2) and the slave address (5)
Master CPU
Slave CPU
LD K10 The constant value K10 specifies the number of bytes to be written LDA O 2300 Octal address 2300 is converted to 4C0 HEX and loaded into the accumulator. V2300 is the starting location for the Master CPU where the specified data will be read from.
V2277
X
X
X
X
X
X
X
X V1777
V2300
3
4
5
7
3
4
5
7
V2301
8
5
3
4
8
5
3
4
V2001
V2302
1
9
3
6
1
9
3
6
V2002
V2303
9
5
7
1
9
5
7
1
V2003 V2004
V2000
V2304
1
4
2
3
1
4
2
3
V2305
X
X
X
X
X
X
X
X V2005
WX V2000 V2000 is the starting location in the for the Slave CPU where the specified data will be written to Handheld Programmer Keystrokes B
$ STR
1
W ANDN
SHFT
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
W ANDN
X SET
ENT SP STRN
3 3
B
C
ENT
1
6
SHFT
K JMP
SHFT
F
SHFT
K JMP
B
A
C
D
A 3
E
1
0
1
2 C
A 2
0 A
3 A
0
5
0
C
A 2
F 0
5
ENT
ENT A
0 A
0
SHFT
0
ENT
ENT
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
5–199
Page 354
Chapter 5: Standard RLL Instructions - LCD
LCD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
N/A
When enabled, the LCD instruction causes a user-defined LCD text message to be displayed on the LCD Display Panel. Kn Line Number: The display is 16 characters wide by 2 rows high so a total "text message" of 32 characters can be displayed. Each row is addressed separately; the maximum number of characters the instruction will accept is 16. The text message can be entered directly into the message field of the instruction set-up dialog, or it can be located anywhere in user V-memory. If the text is located in V-memory, the LCD instruction is used to point to the memory location where the desired text originates. The length of the text string is also required. From the DirectSOFT 5 project folder, use the Instruction Browser to locate the LCD instruction. When you select the LCD instruction and click OK, the LCD dialog will appear, as shown in the examples. The LCD instruction is inserted into the ladder program via this set-up dialog box. Display text strings can include embedded variables. Date and time settings and V-memory values can be embedded in the displayed text. Examples of each are shown.
Direct Text Entry The two dialogs to the right show the selections necessary to create the two ladder instructions below. Double quotation marks are required to delineate the text string. In the first dialog, the text “Sludge Pit Alarm“ uses sixteen character spaces and will appear on line 1 when the instruction is enabled. Note, the line number is K1. Clicking the “check” button causes the instruction to be inserted into the ladder program. LCD Line Number: "Sludge Pit Alarm"
K1
LCD Line Number: "Effluent Overflo"
K2
By identifying the second Line Number as K2, the text string “Effluent Overflow” will appear on the second line of the display when the second instruction is enabled. S l E f
5–200 u d g e P f l u e n t i t A l O v e r a f r m l o
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 355
Chapter 5: Standard RLL Instructions - LCD
Embedding date and/or time variables The date and/or time can be embedded in the displayed text by using the variables listed in the table below. These variables can be included in the “LCD message” field of the LCD dialog. In the example the time variable (12 hour format) is embedded by adding _time:12. This time format uses a maximum of seven character spaces. The second dialog creates an instruction that prints the date on the second line of the display, when enabled. Date and Time Variables and Formats _date:us _date:e _date:a _time:12 _time:24
US format European format Asian format 12 hour format 24 hour format
MM/DD/YY DD/MM/YY YY/MM/DD HH:MMAM/PM HH:MM:SS
LCD K1 Line Number: "Alarm 1 " _time:12 LCD Line Number: _date:us
A l a r m 0 5 - 0 8 -
1 0 2
1 1
K2
:
2 1 P M
Embedding V-memory data Any V-memory data can be displayed in any one of six available data formats. An example appears to the right. A list of data formats and modifiers is on the next page. Note that different data formats require differing numbers of character positions on the display. LCD Line Number: "Count = " V2500:B
C o u n t
=
K1
0 4 1 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 5–201
Page 356
Chapter 5: Standard RLL Instructions - LCD
Data Format Suffixes for Embedded V-memory Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Several data formats are available for displaying V-memory data on the LCD. The choices are shown in the table below. A colon is used to separate the embedded V-memory location from the data format suffix and modifier. An example appears on the previous page. Data Format
Modifier none (16-bit format) [:S]
[:C0] [:0]
:B (4 digit BCD)
[:B] [:BS] [:BC0] [:B0]
:D [:D] (32-bit decimal) [:DS] [:DC0] [:D0]
:DB (8 digit BCD)
[:DB] [:DBS] [:DBC0] [:DB0]
Example V2000 = 0000 0000 0001 0010 V2000 V2000:S V2000:C0 V2000:0 V2000 = 0000 0000 0001 0010 V2000:B V2000:BS V2000:BC0 V2000:B0 V2000 = 0000 0000 0000 0000
1
V2001 = 0000 0000 0000 0001 V2000:D V2000:DS V2000:DC0 V2000:D0 V2000 = 0000 0000 0000 0000
1
2
3
4
Double Word 5 6 7 8 9 10 11
6 0
5 0
5 0
3 0
6 0
V2001 = 0000 0000 0000 0011 V2000:DB V2000:DBS V2000:DBC0 V2000:DB0
1
2
3
4
Double Word 5 6 7 8
0 3 0
0 0 0
0 0 0
3 0 3 3
0 0 0 0
V2001/V2000 = 222.11111 (real number)
:R (DWord floating [:R] point number) [:RS] [:RC0] [:R0]
:E (DWord floating [:E] point number [:ES] with exponent) [:EC0]
5–202
[:E0]
Displayed Characters
V2000:R V2000:RS V2000:RC0 V2000:R0 V2001/V2000 = 222.1 (real number)
2
3
4
1
8
1 1
8 8
1 0
8 0
1
2
3
4
0 1 0
0 2 0
1
2
1 1
2 2
0
6
5
5
3
6
6 6
5 5
5 5
3 3
6 6
0
0
0
0 0
0 0
0 0
1
2
3
4
Double Word 5 6 7 8 9 10 11 12 13 f f
2 0
2 0 f 2 0 f
2 . 2 2
4
Double Word 5 6 7 8 9 10 11 12 13
1
2
3
V2000:E f 2 . 2 V2000:ES f 2 . 2 2 V2000:EC0 f 2 . 2 2 V2000:E0 f 2 . 2 2 f = plus/minus flag (plus = no symbol, minus = - )
2 1 2 2
2 1 1 1
2 1 2 2
1 0 0 0
. 1 . .
0 0 0 0
1 1 1 1
0 E E E
1 1 1 1
E + + +
1
1
1
1 1
1 1
1 1
+ 0 0 0
0 2 2 2
The S, C0, and 0 modifiers alter the presentation of leading zeros and spaces. S removes leading spaces and left justifies the result. C0 replaces leading spaces with leading zeros. 0 is a modification of C0. 0 eliminates any leading zeros in the C0 format version and converts them to spaces. DL06 Micro PLC User Manual, 3rd Edition Rev. A
2
Page 357
Chapter 5: Standard RLL Instructions - LCD
Text Entry from V-memory Alternatively, text that resides in V-memory can be displayed on the LCD following the example on this page. The LCD dialog is used twice, once for each line on the display. The dialog requires the address of the first character to be displayed and the number of characters to be displayed. For example, the two dialogs shown on this page would create the two LCD instructions below. When enabled, these instructions would cause the ASCII characters in V10000 V10017 to be displayed. The ASCII characters and their corresponding memory locations are shown in the table below.
V10000 V10001 V10002 V10003 V10004 V10005 V10006 V10007 V10010 V10011 V10012 V10013 V10014 V10015 V10016 V10017
LCD Line Number:
K1
Starting V Memory Address: Number of Characters:
V10000 K16
LCD Line Number:
K2
Starting V Memory Address: Number of Characters:
A d m i n O f f H i g h T e m p
V10010 K16 i c e A l a d i f i e i h T m l r
A m n O f c
H g e p A a m r m
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
5–203
Page 358
Chapter 5: Standard RLL Instructions - MODBUS
MODBUS RTU Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
MODBUS Read from Network (MRX) DS5
Used
HPP
N/A
5–204
The MODBUS Read from Network (MRX) instruction is used by the DL06 network master to read a block of data from a connected slave device and to write the data into V–memory addresses within the master. The instruction allows the user the to specify the MODBUS Function Code, slave station address, starting master and slave memory addresses, number of elements to transfer, MODBUS data format and the Exception Response Buffer. • CPU/DCM: select either CPU or DCM module for communications • Slot Number: select PLC option slot number if using DCM module • Port Number: must be K2 when using CPU port 2 • Slave Address: specify a slave station address (0–247) • Function Code: The following MODBUS function codes are supported by the MRX instruction: 01 – Read a group of coils 02 – Read a group of inputs 03 – Read holding registers 04 – Read input registers 07 – Read Exception status • Start Slave Memory Address: specifies the starting slave memory address of the data to be read. See the table on the following page. • Start Master Memory Address: specifies the starting memory address in the master where the data will be placed. See the table on the following page. • Number of Elements: specifies how many coils, inputs, holding registers or input register will be read. See the table on the following page. • MODBUS Data Format: specifies MODBUS 584/984 or 484 data format to be used • Exception Response Buffer: specifies the master memory address where the Exception Response will be placed. See the table on the following page.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 359
Chapter 5: Standard RLL Instructions - MODBUS
MRX Slave Address Ranges Function Code
MODBUS Data Format
01 – Read Coil 01 – Read Coil 02 – Read Input Status
484 Mode 584/984 Mode 484 Mode
02 – Read Input Status
584/984 Mode
03 – Read Holding Register
484 Mode
03 – Read Holding Register
584/984 Mode
04 – Read Input Register
484 Mode
04 – Read Input Register
584/984 Mode
07 – Read Exception Status
484 and 584/984 Mode
Slave Address Range(s) 1–999 1–65535 1001–1999 10001–19999 (5 digit) or 100001–165535 (6 digit) 4001–4999 40001–49999 (5 digit) or 4000001–465535 (6 digit) 3001–3999 30001–39999 (5 digit) or 3000001–365535 (6 digit) N/A
MRX Master Memory Address Ranges Operand Data Type
DL06 Range
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Control Relays. . . . . . . . . . . . . . . . . . . . . . . . . . C Stage Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S Timer Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T Counter Bits . . . . . . . . . . . . . . . . . . . . . . . . . . CT Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . SP V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Global Inputs . . . . . . . . . . . . . . . . . . . . . . . . . GX Global Outputs . . . . . . . . . . . . . . . . . . . . . . . . GY
0–1777 0–1777 0–3777 0–1777 0–377 0–377 0–777 all 0–3777 0–3777
Number of Elements Operand Data Type V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL06 Range all Bits: 1–2000 Registers: 1–125
Exception Response Buffer Operand Data Type
DL06 Range
V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . V all
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
5–205