The text of a manual · part 9 of 19
C-series SYSMAC LINK System Manual, pages 74 to 83
Pages 74 to 83 of 174
The original document is the PDF (983 KB). 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 Omron C200HW-SLK24
Page 74
Section 5-9
Data Link Status
5-9
Data Link Status The operational status of the data links in operating levels 0 and 1 is indicated in the data link operating flags. SR 25202 is turned ON when a data link is active in operating level 0 and SR 25205 is turned ON when a data link is active in operating level 1. These flags and corresponding SR bits are shown below. SR bit
Node Status
Flag
25202
Operating Level 0 Data Link Operating Flag
25205
Operating Level 1 Data Link Operating Flag
In addition to the overall operational status of the data link, the status of any node involved in data link operations can be checked from any other node included in data link operations. The Data Link Status Flags are contained in SR 238 to SR 245 when data link tables are generated automatically. The user selects the location of the data link status flags in the refresh parameters when data link tables are generated manually. Note
1. If the Data Link Operating Flag for the local node is OFF, the data link status will remain the same as the status right before the data link was stopped. Therefore, there is no guarantee that other status information will be correct. When using the data link status, make sure that the Data Link Operating Flag for the local node is ON. 2. The Data Link Operating Flag for other nodes and PC Operating Flags are used to confirm that the system has been properly started. These flags alone cannot be used to detect communications errors. To detect communications errors, use the Communications Error Flag and PC Error Flag. The operation of each flag is described in the following table. Flag Data Link Operating Flag for local node
PC Operating Flag
PC Error Flag
Communications Error Flag
Data Link Operating Flag for other nodes
Programming Example
Flag operation ON when the local node is participating in the data links. When this flag is OFF, data link communications will not be performed properly., and there is no guarantee that other status information is correct. ON when the PC in the node is operating. This flag operates according to data sent from the remote node and is thus valid only when the Communications Error Flag is OFF. ON when an error (fatal error or watchdog timer error) has occurred in the PC. This flag operates according to data sent from the remote node and is thus valid only when the Communications Error Flag is OFF. ON when data link data is not received continually from the subject node due to a disconnection or other cause. The flag will turn OFF when data is received properly from the remote node. ON after the remote node properly participates in the data links. The flag will remain ON even after the remote node ends participation in the data links.
Programming examples using data link status are shown below for the C200H, C200HS, and C200HX/C200HG/C200HE. Checking Data Link Participation of Other Nodes As shown below, use an AND condition of a NO input of the Data Link Operating
60
Page 75
Section 5-9
Data Link Status
Flag for the local node, a NC input of the Communications Error Flag for each node, and a NO input of the Data Link Operating Flag for each node. Node A: Data link participation Local Node Data Link Operating Flag
Node A Communications Error Flag
Node A Data Link Operating Flag
Node B: Data link participation Node B Communications Error Flag
Node B Data Link Operating Flag
Node n Communications Error Flag
Node n Data Link Operating Flag
Node n: Data link participation
Checking for Data Link Errors any Node As shown below, use an OR condition of a NC input of the Data Link Operating Flag for the local node and NO inputs of the Communications Error Flags of the other nodes. Data link error occurred in one of the nodes. Local Node Data Link Operating Flag
Node A Communications Error Flag
Node B Communications Error Flag
Node n Communications Error Flag
Outputting a Local Node Error The following programming can be used to output an error signal when local node data link operation stops. Local Node Data Link Operating Flag DIFU (13) 10000
10000
Reset bit Local node error output
Local node error output
61
Page 76
Section 5-9
Data Link Status
5-9-1 Automatic Data Link Table Generation When data link tables are generated automatically, data link status is output to SR 238 through SR 241 for the operating-level-0 data link. And to SR 242 through SR 245 for the operating-level-1 data link. Level 0
Level 1
Bits 00 to 03
04 to 07
08 to 11
12 to 15
SR 238
SR 242
Node 1
Node 2
Node 3
Node 4
SR 239
SR 243
Node 5
Node 6
Node 7
Node 8
SR 240
SR 244
Node 9
Node 10
Node 11
Node 12
SR 241
SR 245
Node 13
Node 14
Node 15
Node 16
Each of the above sets of four bits contains the four flags indicating data link status for a node, as shown below. Bits
Flag
Function
00, 04, 08, or 12
PC Mode*
Turned ON to indicate the PC is in RUN or MONITOR mode. OFF indicates PROGRAM mode.
01, 05, 09, or 13
PC Fatal Error*
02, 06, 10, or 14
Communications Error
03, 07, 11, or 15
Data Link Status
Turned ON to indicate the PC has stopped because of a fatal error. Turned ON to indicate that there is a communications error (time out), that the Unit is not part of the System, or that the data link is not active. Turned ON to indicate the node is part of the data link. OFF indicates that the data link tables of the start-up node do not match, or no operation is possible because the data link table has not been created.
Note *The PC Mode and PC Fatal Error Flags are not valid when a communications error has occurred. Any of the above bits that are not used by the System (i.e., those bits assigned to node numbers beyond the possible range) can be used for work bits.
5-9-2 Manual Data Link Table Generation When data link tables are generated manually, data link status is output to consecutive words starting with the beginning status word designated in the refresh parameters. Data status is only available for the nodes designated in the refresh parameters, i.e., the nodes from which link data is being received. In the following table “m” is the beginning status word. Word
Bits 00 to 03
04 to 07
08 to 11
12 to 15 m
Link no. 1
Link no. 2
Link no. 3
Link no. 4 m+1
Link no. 5
Link no. 6
Link no. 7
Link no. 8 m+2
Link no. 9
Link no. 10
Link no. 11
Link no. 12 m+3
Link no. 13
Link no. 14
Link no. 15
Link no. 16
...
...
...
...
... m+14
Link no. 57
Link no. 58
Link no. 59
Link no. 60 m+15
Link no. 61
Link no. 62
The actual link status table will be only as long as required to store the status of each node for which there is a link (see Example, below. Each of the above sets of four bits operates as shown below.
62
Page 77
Section 5-10
Data Link Characteristics
Each of the above sets of four bits contains the four flags indicating data link status for a node, as shown below. Bits
Note
Example
Flag
Function
00, 04, 08, or 12
PC Mode*
Turned ON to indicate the PC is in RUN or MONITOR mode. OFF indicates PROGRAM mode.
01, 05, 09, or 13
PC Fatal Error*
02, 06, 10, or 14
Communications Error
03, 07, 11, or 15
Data Link Status
Turned ON to indicate the PC has stopped because of a fatal error. Turned ON to indicate that there is a communications error (time out), that the Unit is not part of the System, or that the data link is not active. Turned ON to indicate the node is part of the data link. OFF indicates that the data link tables of the start-up node do not match, or no operation is possible because the data link table has not been created.
1. *The PC Mode and PC Fatal Error Flags are not valid when a communications error has occurred. 2. This status must not overlap other areas which may be in use (for example, the data link area, SEND(90)/RECV(98) area, or areas used by the other Network). This example illustrates the location of data link status flags for a 10-node data link with the following parameters. These are the only words that will be used. Refreshed nodes
1, 2, 3, 4, 10, 15, 20, 28, 55, 62
Beginning status word
DM 0120
Word
Bits 00 to 03
Status Areas
04 to 07
08 to 11
12 to 15
DM 0120
Node 1
Node 2
Node 3
Node 4
DM 0121
Node 10
Node 15
Node 20
Node 28
DM 0122
Node 55
Node 62
(Not used.)
(Not used.)
The following memory areas can be used to store the status data. Be sure to allow enough words after the beginning status word so that the entire link status area fits within the same data area. Area
C200H
C200Hj
C1000H
C2000H
IR and SR 0 to 252, 300 to 511
0 to 252
0 to 252
0 to 252
LR
0 to 63
0 to 63
0 to 63
0 to 63
HR
0 to 99
0 to 99
0 to 99
0 to 99
AR
0 to 27
0 to 27
0 to 27
0 to 27
T/C
0 to 511
0 to 511
0 to 511
0 to 511
DM
0 to 5999
0 to 999
0 to 4095
0 to 4095
Note The C200Hj PCs include the C200HX, C200HG, C200HE, and C200HS.
5-10 Data Link Characteristics 5-10-1 Data Link Communications Cycle Time Data link servicing is given priority in SYSMAC LINK Systems. The communications time for a data link can thus be maintained as a constant, regardless of whether or not SEND(90)/RECV(98) are used. Fixing the data link communications time at a constant value fixes the data link I/O response time as well.
63
Page 78
Section 5-10
Data Link Characteristics
The communications cycle time can be set either automatically (the default) or controlled externally.
Automatic Generation When data link tables have been generated automatically, the communications time will be as follows for systems using coaxial cable: No. of nodes
Data link area LR and DM Areas
LR Area only
DM Area only
2
19 ms
17 ms
18 ms
4
19 ms
17 ms
18 ms
8
19 ms
18 ms
18 ms
16
19 ms
18 ms
19 ms
The communications time will be as follows for systems using optical fiber cable. No. of nodes
Data link area LR and DM Areas
LR Area only
DM Area only
2
21 ms
20 ms
21 ms
4
22 ms
20 ms
21 ms
8
22 ms
21 ms
21 ms
16
22 ms
21 ms
22 ms
Manual Generation When data link tables have been generated manually, the communications cycle time can be set to a constant value or generated automatically. The communications cycle time can be set as a constant from 5 to 255 ms in increments of 1 ms via the SSS/CVSS to eliminate variations caused by noise or other factors. When the communications cycle time is not set as a constant, it will be generated automatically according to the equations below. Round the result of the calculation to the nearest millisecond. Communications cycle time (coaxial cable systems) = Maximum node number × 85 ms + maximum number of frames × 654 ms + number of polled units × 750 ms + number of Link Units × 56 ms + total number of words × 10 ms + 1.322 ms Communications cycle time (optical fiber cable systems) = maximum node number × 111.5 ms + maximum number of frames × 770 ms + number of polled units × 750 ms + number of Link Units × 56 ms + total number of words × 10 ms + 1.322 ms Note The present and maximum values of the communications cycle time can be monitored from a SSS/CVSS. 3.Example Calculations
The examples below calculate the communications cycle time for both coaxial and optical fiber cable with the following characteristics: Maximum node number: . . . . . . 62 Maximum number of frames: . . 10 Number of polled units: . . . . . . . 4 Number of Link Units . . . . . . . . 32 Total number of words . . . . . . . 2000 Communications cycle time (coaxial cable systems) = 62 × 85 ms + 10 × 654 ms + 4 × 750 ms + 32 × 56 ms + 2000 × 10 ms + 1.322 ms = 37.924 ms (38 ms after rounding) Communications cycle time (optical fiber cable systems) = 62 × 111.5 ms + 10 × 770 ms + 4 × 750 ms + 32 × 56 ms + 2000 × 10 ms + 1.322 ms = 40.727 ms (41 ms after rounding)
64
Page 79
Section 5-10
Data Link Characteristics
Note Data links might not operate correctly if the communications cycle time is set to a value shorter than that generated automatically by the system.
Changing the Communications Cycle Time When the communications cycle time is generated automatically, it can be changed by changing the other network parameters at the SSS/CVSS. The default values and setting ranges of the other network parameters are shown in the table below. Network parameter
Default value
Setting range
Maximum node number
62
2 to 62
Number of polled units
4
1 to 62
Maximum number of frames
10
5 to 255
Use the following formulae to calculate the change in the communications cycle time that results from a change in other network parameters. A positive result indicates the communications cycle time has been decreased and a negative result indicates it has been increased. Round the result of the calculation to the nearest millisecond. Change of the communications cycle time (coaxial cable systems) = (old maximum node number - new maximum node number) × 85 ms + (old maximum number of frames - new maximum number of frames) × 654 ms + (old number of polled units - new number of polled units) × 750 ms Change of the communications cycle time (optical fiber cable systems) = (old maximum node number - new maximum node number) × 111.5 ms + (old maximum number of frames - new maximum number of frames) × 770 ms + (old number of polled units - new number of polled units) × 750 ms Example Calculations
The examples below calculate the change of the communications cycle time for both coaxial and optical fiber cable when the other network parameters are changed as shown below: Maximum node number: . . . . . . Changed from 62 to 16 Maximum number of frames: . . Changed from 10 to 13 Number of polled units: . . . . . . . Changed from 4 to 5 Change of the communications cycle time (coaxial cable systems) = (62 – 16) × 85 ms + (10 – 13) × 654 ms + (4 – 5) × 750 ms = 1.198 ms (1 ms after rounding) Change of the communications cycle time (optical fiber cable systems) = (62 – 16) × 111.5 ms + (10 – 13) × 770 ms + (4 – 5) × 750 ms = 2.069 ms (2 ms after rounding) Note
1. If the maximum node number is set below the node number of any nodes in the data link, those nodes will no longer be part of the data link. 2. If the maximum number of frames is set too low, errors might occur during execution of events such as SEND(90) and RECV(98) instructions, internode echo tests, and remote monitoring. 3. Lowering the number of polled units will increase the delay between resetting a Unit or turning on its PC’s power and its entrance into the network.
5-10-2 Data Exchange Timing Data exchange takes place at the end of the cycle during CPU Unit servicing for the SYSMAC LINK Unit, as indicated by the shaded areas in the diagrams. Data exchange is limited to maximum of 1,642 words per cycle.
65
Page 80
Section 5-10
Data Link Characteristics
The timing relationship between program execution and the exchange of data between the PC and the SYSMAC LINK Unit’s buffer memory is illustrated in the diagram below. 1 cycle Program executed
Program executed
Program executed
Program executed Data exchange I/O refresh
Note Data exchange is not synchronized with data link processing.
5-10-3 Data Link I/O Response Time The data link I/O response time is the time it takes for data to be transferred to another node via the data link and output after it is input to the local node. In this section, example calculations of the minimum and maximum data link I/O response time are provided. The following system configuration is used in both calculations (just one SYSMAC LINK Unit is mounted on each PC):
System Configuration Cable type: . . . . . . . . . . . . . . . . . Coaxial Maximum node number: . . . . . . 62 Number of Link Units . . . . . . . . 8 Number of LR words . . . . . . . . . 8 words/node Number of DM words . . . . . . . . 16 words/node Maximum number of frames: . . 10 Number of polled units: . . . . . . . 4
Unit 1
SYSMAC LINK Unit
SYSMAC LINK Unit
PC
PC
Input
Input on PC of Unit 1
LR bit
Output on PC of Unit 7
Unit 7
X Output
X
Input
LR XXXX
LR XXXX
Output X
The data link I/O response time depends on the communications cycle time, input ON delay, output ON delay, and the cycle times of the PCs involved. The values are detailed below. Communications Cycle Time The communications cycle time is calculated in the manner described in 5-10-1 Data LInk Communications Cycle Time. Communications cycle time = 62 × 85 ms + 10 × 654 ms + 4 × 750 ms + 8 × 56 ms + 24 × 10 ms + 1.322 ms = 18.500 ms (19 ms after rounding) Input ON Delay
The input ON delay is the time it takes for an input device to turn ON an input to the PC after receiving an input signal. In this system the input ON delay is 1.5 ms.
Output ON Delay
The output ON delay is the time it takes for an output device to turn ON an output signal after receiving an output from the PC. In this system the output ON delay is 15 ms.
Node #1 PC Cycle Time
The cycle time of the PC at node #1 is 20 ms or 15 ms.
66
Page 81
Section 5-10
Data Link Characteristics Node #7 PC Cycle Time
The cycle time of the PC at node #7 is 50 ms or 15 ms.
Minimum Response Time The following diagram illustrates the data flow that will produce the minimum response time, i.e., the time required if all signals and data transmissions are processed as soon as they occur. Input
I/O refresh Input device Data exchange
Input ON delay 1 cycle Program
PC at node #1 SYSMAC LINK Unit transmission processing Data link transmission 1 cycle Communications cycle time
Program
PC at node #7 Output device Output ON delay
Data link I/O response time
Output
The equation for minimum data link I/O response time is as follows: Response time = input ON delay (0 ms) + cycle time of PC at node #0 (20 ms) + communications cycle time (19 ms) × 2 + cycle time of PC at node #7 (50 ms) + output ON delay (0 ms) = 108 ms Note Noise may increase I/O delays.
67
Page 82
Section 5-10
Data Link Characteristics Maximum Response Time
The maximum data link I/O response time is calculated for four cases. Case 1
The following diagram illustrates the data flow that will produce the maximum data link I/O response time when the cycle time of the PC at nodes #1 and 7 are greater than the communications cycle time.
Input
I/O refresh Input device Data exchange
Input ON delay
X
1 cycle
(1) Program
PC at node #1
X
(2)
SYSMAC LINK Unit transmission processing Data link transmission
Communications cycle time
X
(3)
X
SYSMAC LINK Unit transmission processing
Previous communications cycle data
X
(4) Program
PC at node #7 1 cycle
Output device Data link I/O response time
Output ON delay Output
There are four points shown in the diagram above where processing is delayed, increasing the data link I/O response time.
68
1, 2, 3...
1. The input arrives in the PC just after I/O refreshing, causing a delay of up to one cycle before the input is read into the PC. 2. Data exchange occurs just after the PC at node #1 passes the token that makes it the polling unit, causing a delay of up to one communications cycle time before the data is transferred in data link processing. 3. At node #7, data from the previous data exchange is still being transferred, causing a delay of up to one cycle before the input is read into the PC. 4. The data transferred in data link processing arrives at the PC at node #7 after data exchange, so the data will not be read into the PC until the next data exchange, causing a delay of up to one cycle. Up to 1,642 words can be transferred in a single data exchange, so a delay of another cycle will occur if more than 1,642 words are being transferred. The equation for maximum data link I/O response time is as follows: Response time = input ON delay (1.5 ms) + cycle time of PC at node #1 (20 ms) × 2 + communications cycle time (19 ms) × 3 + PC cycle time at node #7 (50 ms) × 3* + output ON delay (15 ms) = 263.5 ms*
Note
1. *If more than 1,642 words are being transferred, 4 cycles of the PC at node #7 are required and the total response time becomes 313.5 ms. 2. Noise may increase I/O delays.
Page 83
Section 5-10
Data Link Characteristics Case 2
The following diagram illustrates the data flow that will produce the maximum data link I/O response time when the cycle time of the PC at node #1 y the communications cycle time and the cycle time of the PC at node #7 t the communications cycle time.
Input I/O refresh Input device Data exchange
Input ON delay
X
1 cycle
(1) Program
PC at node #1
X
(2)
SYSMAC LINK Unit transmission processing Data link transmission SYSMAC LINK Unit transmission processing
Communications cycle time
X
(3) Program
PC at node #7 1 cycle
Output device Output ON delay Data link I/O response time
Output
There are three points shown in the diagram above where processing is delayed, increasing the data link I/O response time.
1, 2, 3...
1. The input arrives in the PC just after I/O refreshing, causing a delay of up to one cycle before the input is read into the PC. 2. Data exchange occurs just after the PC at node #1 passes the token that makes it the polling unit, causing a delay of up to one communications cycle time before the data is transferred in data link processing. 3. The data transferred in data link processing arrives at the PC at node #7 after data exchange, so the data will not be read into the PC until the next data exchange, causing a delay of up to one cycle. Up to 1,642 words can be transferred in a single data exchange, so a delay of another cycle will occur if more than 1,642 words are being transferred. The equation for maximum data link I/O response time is as follows: Response time = input ON delay (1.5 ms) + cycle time of PC at node #1 (20 ms) × 2 + communications cycle time (19 ms) × 3 + PC cycle time at node #7 (15 ms) × 2* + output ON delay (15 ms) = 143.5 ms*
Note
1. *If more than 1,642 words are being transferred, 3 cycles of the PC at node #7 are required and the total response time becomes 158.5 ms. 2. Noise may increase I/O delays.
69