The text of a manual · part 14 of 27
SHARP Programmable Controller New Satellite W series: Network module JW-20CM, Remote I/O slave module JW-20RS User's Manual: Chapter 9: Data Link, pages 99 to 108
Pages 99 to 108 of 230, from SHARP Programmable Controller New Satellite W series: Network module JW-20CM, Remote I/O slave module JW-20RS User's Manual
The original document is the PDF (2.5 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.
Filed in the catalog under the Sharp ZW-1PU, Sharp ZW-32IO2 and Sharp ZW-32S2T
Page 99
Chapter 9 Data Link 9-1
Description for data link function
· The data link function us used to send and receive ON/OFF signals (relay link: max. 2048 points) and numerical data (register link : max. 2048 bytes) by PCs or between PC and personal computers connected in the satellite net system. · The master station and slave stations are connected using a single coaxial cable. As the JW-20CM network module can control the data communications, the PC does not need any special programming. · When the JW-20CM is assigned as a slave station, it has the standard function and memory capacity save function for data link. But the data contents for receiving from other stations is different between these two functions. (When the JW-20CM is used as a master station, only the standard function is available.) [When all of a master station and slave stations are JW-20CM] • Master station Data link (Standard function) Receiving data are all relay link area, and • Slave station Data link (Standard function) all register link area of all stations. Data link In order to effectively use the memory, (Memory capacity save function) unify a partial data area or sending/
} receiving address (program) of slave stations.
· A maximum of 6 modules (a mixed installation of master and slave stations is allowed) can be installed on one PC. · A maximum of 64 stations can transfer data on one network with maximum cable length of 1 km. Master station 00(8) Network module (JW-20CM)
Slave station 01(8) Network module (JW-20CM)
PC
PC
Personal computer slave station 02(8)
Slave station 77(8) Network module (ZW-20CM)
PC Network module
(64 stations max., Total extension length: 1km max.) Slave station 01(8) Slave station 02(8) Network module Network module (JW-20CM) JW20 (JW-22CM) JW20H JW30H
Slave station 76(8) Network module (ZW-20CM)
(64 stations max., Total extension length: 1km max.)
· Both JW and ZW model PCs can be connected on the same cable.
9·1
Slave station 77(8) Network module (JW-20CM)
9
Page 100
9-2
Communication method
[1] Data link (standard function) Each station sends data in its sending area cyclically and stores data received from other stations in its receiving area. Station number 00(8)
Station number 01(8)
Station number 02(8)
Station number 03(8)
: Sending area : Receiving area
For the JW-20CM to execute automatically these sending and receiving procedures, a special program for communication is required. Data link have relay link and register link. They can use at the same time.
Function
Contents
Relay link
N: M communication Total no. of link points : 2048 max. (256 bytes)
Register link
N: M communication Total no. of link bytes : 2048 max.
(1) Relay link function Mainly used for sending and receiving ON/OFF information [Example] In the case of sending 1-byte data from a master station and slave stations 01 and 02. Master station (PC00)
Slave station (PC01)
Slave station (PC02)
コ0200 コ0201 コ0202
:Send :Receive
PC00 Program
9
PC01 Program
PC02 Program 02000
02000
02000 02010
02010
02010
02020
02020 02020
• The link relay of the receiving station must be programmed as input signal by the PC programming. Also, it may be used as source (S) side of application instruction. • The sending and receiving data correspond in bits of one point unit. 7
6
5
4
3
2
1
0
7
コ0200
6
5
4
3
2
1
0
コ0200 Is the same value as コ0200 of the master station. 7
6
5
4
3
2
1
0
7
コ0201
コ0201 Is the same value as コ0201 of the slave station.
9·2
6
5
4
3
2
1
0
Page 101
(2) Register link function Mainly used for sending and receiving numerical data. [Example] In the case of sending 1 byte data from a master station and slave station 01 and 02. Master station (PC00)
Slave station (PC01)
Slave station (PC02)
09200 09201 09202
:Send :Receive
F-00 コ0000 09200
Register
Register
09200
09200
Register
Register
09201
F-00 コ0000 09201
09201
Register
Register
Destination side
09202
09202
F-00 コ0000 09202
• The register link area of the sending station may be used as D (Destination) side of the application instruction of the PC program. • The register link area of the receiving station may be used as S (Source) side of the application instruction of the PC program.
9
9·3
Page 102
V5
[2] Data link (Memory capacity save function) The memory capacity save function is to provide a part of the data link area in the slave station data memory as a receiving area. A slave station can receive only the required area by relay link/ register link so that the slave stations can save on use of the memory area. As this function can unify the receiving area address and the sending area address of each slave station, the same program can be used for each slave station. Mixed allocation of the addresses with the data link (standard function) is also possible.
(
①
)
Memory Standard capacity save function function Master station Slave station Slave station 01(8) 02(8) 00(8)
)(
○ : Sending area ● : Receiving area
③ ② ⑤ ⑥ ④ Memory in control module Memory in JW-20CM
9
Adresses continues in order of receiving and sending sequentially.
Function
Contents
Relay link
Total link number of points: Maximum 2048 points (256 bytes) N: M communication Total number of points of sending/receiving data per slave station: Maximum 512 points (64 bytes)
Total link number of points: Maximum 2048 bytes Register link N: M communication Total number of points of sending/receiving data per slave station: Maximum 512 bytes Setting contents
Setting item
① Top address of master station link area ② Number of sending data bytes of master station ③ Number of offset bytes of slave station
Master station 's parameter
④ Number of sending data bytes of slave station ⑤ Top address of slave station link area ⑥ Number of data receiving bytes of slave station
9·4
Slave station's parameter
Page 103
[3] Link function with specific station (F200/F201 link function) There is a function for communicating data other than the parameter setting values using the PC's application instructions F-200 (write to ports) and F-201 (read from ports). The JW-20CM communicates data while executing data link operations. See page 13·22 to 13·25 for application instructions F-200 and F-201 in details. See instruction manual of ZW-98CM and ZW-20AX in case that communicating with host computer.
Master station 00(8)
Slave station 01(8)
Slave station 03(8)
Slave station 02(8)
Data sending Example) In case of sending 8 bytes data from slave station 01(8) to slave station 03(8). Slave station 01(8) Slave station 01(8) Sending data top address
Register 09000
--------------
Receiving data top address
--------------
Register 09000
2
3
JW-20CM installed port number An example of program at slave station 01(8)
An example of program at slave station 03(8)
Transfer switch
Complete data receiving
00000
F-200
TASK0 @09100 PORT2
→POR Complete data transfer to a port 04000
Carry 07356 Non-carry
Wait for data transfer to a port 04001
07354
04004 Complete receiving 10100 Non-carry
F-201
TASK1
PORT3 @コ1000
POR→ Carry
Complete data receiving 04004
07356 Wait for data receiving 04005
07354
Error
Error
No module 04002
07355
No module 04002
07355
Sending data
09000 09001 09002 09003 09004 09005 09006 09007
01 (H) 23 (H) 45 (H) 67 (H) 89 (H) AB (H) CD (H) EF (H)
8 bytes data
09100 09101 09102 09103 09104 09105 09106 09107 09110 09111
000 (8) 010 (8) 000 (8) 010 (8) 003 (8)
Sending data top address (register 09000) File number No. of transfer bytes (8 bytes) Target station number
Not fixed
9·5
09000 09001 09002 09003 09004 09005 09006 09007
01 (H) 23 (H) 45 (H) 67 (H) 89 (H) AB (H) CD (H) EF (H)
コ1000 コ1001 コ1002 コ1003 コ1004 コ1005 コ1006 コ1007 コ1010 コ1011
000(8) 010(8) 000(8) 010 (8) 000 (8) 000 (8) 000 (8) 001 (8) Not fixed Not fixed
Receiving data
8 bytes
Receiving data top address (register 09000) File number No. of transfer bytes (8 bytes)
25. Sending station number Receiving completed flag (D0)
9
Page 104
[4] SEND/RECEIVE function Different from the data link, the SEND/RECEIVE functions are functions which exchange the data of the required station of the required time between a PC and a personal computer or between PCs. The SEND function is the function which writes in the data after assigning the station to send data to, and the RECEIVE function is the function which reads out the data. [An example of the SEND function]
Master Slave Slave Slave station 00(8) station 01(8) station 02(8) station 03(8)
Request to write in Response [An example of the RECEIVE function]
Master Slave Slave Slave station 00(8) station 01(8) station 02(8) station 03(8)
Request to read out Response
9
• In this instruction, the function is completed after the target station replies. A special program is not needed in the connected PC station. If the target station is an upper computer, a program is required for response after decoding the SEND/RECEIVE instructions. But if the upper computer cannot decode the SEND/RECEIVE instructions, these instructions can not be used. • The data route for the SEND/RECEIVE functions between the control module and this module is called a “channel.” Each module has four channels, CH0 to CH3, and is able to transfer a maximum of 256 bytes of data. Therefore, four operations of SEND/RECEIVE functions can be executed simultaneously on a ladder program. [Example] JW-20CM (Slave station 02(8)) Control module
CH0 CH1 CH2 CH3
Slave Slave Slave Slave station station station station 03(8) 04(8) 05(8) 06(8) · There are the “instruction system” and the “data memory starting system” as the starting system in SEND/RECEIVE functions. You can select the starting system in each channel using a parameter. · With the "Data memory start system," the JW-20CM can communicate across different hierarchies of the satellite net. However, this type of communication has the following limitations. 1 JW20/20H cannot be used as relay stations. 2 ZW-98CM/ZW-20AX cannot be used as communication target stations. 3 The maximum amount of data is 256 bytes.
9·6
Page 105
(1) Instruction system The PC's application instruction F-202/203 (open channel), F-204 (sending instruction), and F-204 (receive instruction) to send and receive data between modules in a network, and from a module in a network to an upper stream computer is used. • In this instruction, the function is completed after the target station replies. A special program is not needed in the connected PC station. If the target station is an upper computer, a program is required for response after decoding the SEND/RECEIVE instructions. But if the upper computer cannot decode the SEND/RECEIVE instructions, these instructions can not be used. · SEND/RECEIVE functions of instruction system cannot be communicated two hierarchical layer. Communication contents
Instruction to be used (see page)
Specify communication target station in octal notation. (for ZW/JW-20CM)
F-202 (13-26)
Write data in the specified station (SEND instruction)
F-204 (13-27)
Read data out of the specified station (RECEIVE instruction)
F-205 (13-28)
Master station 00(8)
Slave station 01(8)
Slave station 02(8)
Slave station 03(8)
Writing and reading data Response Input conditions of F-202/204/205 instructions should keep being ON until finishing execution of the instruction (when error flag or carry flag turns to ON.) • If the input condition is turned OFF during execution of the instruction, the instruction ends in an incomplete condition. Under this condition, next, when this instruction is given, it will come to a “communication jam,” and the instruction will not be executed. Turn the power OFF and then ON again for recovery. Take any measure for the cases below: • In case that on instantaneous power failure of min. 10ms occurs and the input conditions turn to OFF. [Countermeasure] Change the input conditions to a latched relay. However if you turn OFF and ON the power during execution of the instruction while the input condition is set to a latched relay, the JW-20CM will come to the following state. F-204/205 instruction processing which is being executed is deleted, and rising edge of input signal can not be detected for the input condition is kept ON so that this instruction can not be executed. [Countermeasure] All flags (07354 to 07357) are turned to OFF. Detect them with the timer, and operate the next instruction after resetting the input conditions. Note: The SEND/RECEIVE instruction is not allowed to use 10 to 2C(H) as the file numbers for the communication target station. The data memory start system can use these numbers.
9·7
9
Page 106
[Example ] In case of writing data of 8 bytes to slave station 03(8) Module number installing own station JW-20CM : 2 Channel number using own station JW-20CM : 0 Data area of slave station 03(8) : 0 (file number) Receive top address of slave station 03(8) : Register 09000 (file address 004000(8)) Send data top address of own station :コ1000
コ1000 コ1001 コ1002 コ1003 コ1004 コ1005 コ1006 コ1007
Receiving data Target station register
001 002 003 004 005 006 007 010
Port No.2 CH0 Sending Response
Target station
Own station register Sending data
0 3(8)
001 002 003 004 005 006 007 010
09000 09001 09002 09003 09004 09005 09006 09007
Flag
■ PC program Switch
F–44 ↑
00000 Sending relay 14000
9
F-32 SET
14000
F-202 OPCH
2-0-03 file 0
F-204 SEND
010
コ1000
Send 8 bytes of コ1000 to コ1007
TMR 000
0010
Detect non-execution after turning ON power (Flag does not change for 1 second)
Non-carry Error Carry Zero 14000 07354 07355 07356 07357 F–44 ↑ T000
F-33 RST
Set sending relay (14000)
004000
Port No.2, CH0, station number 03(8) File number 0 File address 004000(8)
End of execution and the program resets 14000
14000
Error 07355 Carry 07356
For an example to readout data from the assigned station using F-205, see page 13·28.
9·8
Page 107
V5
(2) Data memory starting system The data memory starting system is the system which starts the SEND/RECEIVE functions without using exclusive instructions. Set the target station number, data memory address, etc. on the specified data memory (communication information storage area). You can increase the amount of data to be transferred in one SEND/RECEIVE operation using multiple connected channels. For cases using 1 channel alone, maximum 256 bytes For cases using 2 connected channels, maximum 512 bytes For cases using 3 connected channels, maximum 768 bytes For cases using 4 connected channels, maximum 1024 bytes Set these channel connections on the parameter (address 007700 to 007703(8)). (See page 9·27 and 48) [Setting the contents in a communication information storage area] In order to assign a communication information storage area (64 bytes), set the top address on the parameter (address 007710 to 007713(8)).
Address (8) Top address→
0 +01 +02 +03 +04 +05 +06 +07 +10 +11 +12 +13 +14 +15 +16 +17 +20
FLAGS TIMER G TYPE ST1 R_SL ST2 n (L) n (H) ADR_A(L) ADR_A(H) SEG_A Not used ADR_B(L) ADR_B(H) SEG_B Not used
Channel CH0 (16 bytes)
※
Channel CH1 (16 bytes)
※
Channel CH2 (16 bytes)
※
Channel CH3 (16 bytes)
64 bytes
9
+37 +40 +57 +60 +77
※ The contents of each area (16 bytes) in channel CH1 to CH3 are the same as the contents of CH0.
9·9
Page 108
*Input/ Output
Contents
FLAGS
Input
Flag (the same as コ 0735. Refer to the following table for the details.)
TIMER
Output
Communication monitoring time 001(D) (0.1 second) to 255(D) (25.5 seconds) (Initial value 000(D) is 1 second.)
G (7th bit)
Output
Starting instruction. Turn ON after starting communication.
TYPE (0 bit to 6th bit)
Output
ST1
Output
For cases with one hierarchical layer, the number of the target station is 00 to 77(8). For cases with two hierarchical layer differences, the number of the relay station is 00 to 77(8).
R_SL
Output
For cases with two hierarchical layer differences, the module number of the next hierarchical layer difference in relay station. (When the relay station is JW50/70/100 or JW50H/70H/100H, it represents the rack/ slot number.) For cases with one hierarchical layer difference, invalid.
ST2
Output
For cases with two hierarchical layer differences, the number of the target station is 00 to 77 (8). For cases with one hierarchical layer difference, invalid.
n
Output
Number of transfer bytes 000 to 377(8) (000(8) is 256 bytes)
ADR __ A
Output
File address of own station 000000 to 177777(8)
SEG __ A
Output
File number of own station 0 to 7
ADR __ B
Output
File address of target station 000000 to 177777(8)
SEG __ B
Output
File number of target station 0 to 7 · JW-20CM with 30H mark cannot set 10 to 2C(H)
Area
Transfer type
00(H) : SEND (one hierarchical layer), 01(H) : SEND (two hierarchical layer differences), 02(H) : RCV (one hierarchical layer), 03(H) : RCV (two hierarchical layer differences)
* Input : Control module ← JW-20CM, Output : Control module → JW-20CM
9
• Contents of FLAGS Value of FLAGS (H)
Contents
7 0
Contents of bit 6 5 4 3 to 0 0 0 0 0
00
During non-execution
90
During communicating. Interval after operating the instruction till the completion.
1
0
0
1
0
40
Normal end
0
1
0
0
0
60
Abnormal end (communication time-out)
0
1
1
0
0
E0
Abnormal end (error response)
1
1
1
0
0
9·10