Overview
- Token Ring Networks
- Gap Updates
- Tokens, Masters, and Slaves
- Bringing in a New Master
- “Busy’s” and Starving
- CP vs PC/PPI
- Busy’s Revisited
- Addendum A: A Note for Micro/WIN and Micro/DOS Users
- Addendum B: Network Component Matrix
- Addendum C: Physical Data
- Addendum D: Panel-Tec Information
- General Notes
Networking The four connected devices in Figure 42.1 form a simple network. There are two CPU 224s and two CPU 222s. This network will be the basis for a discussion of more complicated networks and will help to illustrate some of the Dos and Don’ts of networking. We will be using PPI protocol for our communication. PPI is the default communications protocol of the CPU 224 and CPU 222. Freeport mode (in which serial communications are handled by the user program) are not discussed here.
Figure 1 The Basic Network
Token Ring Networks PPI networks are “Token Ring Networks.” This means that the masters pass control of the network to each other by passing a ‘token.’ For example, the network shown in Figure 1 has four stations. Stations 2 and 3 are masters, and Stations 4 and 5 are slaves.
At power-up the slaves start up, run their programs, and listen to the network for a request. Each master listens for network traffic. If it finds traffic, it builds a list of the active master stations before it is ready to join the network. If a master has listened to the network for a preset listening time without hearing any network traffic, it establishes a network by passing the token to itself. The listening time is shorter for lower station addresses, so the master with the lowest station address normally establishes the network. If the master receives its own token successfully, the network is established. The other masters continue listening and are later brought on-line. See the example below.
Figure 2 At Power-up, each master sits idle for a period based on its station address. The master with the lowest station address finishes its timeout first, and passes itself the token, preventing any of the other masters from seizing control.
In Figure 2 the network has just been powered up and both of the masters are sitting idle in listening mode. The first master to finish its listening (Station 2) passes itself the token, letting all the other masters on the network know that it has control. This is the simplest token ring, one master continually passing the token to itself (See Figure 3).
Figure 3 Station 2 is in a single master ring, continually passing itself the token, but also looking at a different station before each token pass, trying to find other masters waiting to come online. When it polls Station 3 and gets a positive response, Station 3 is brought into the ring.
Gap Updates Before each token pass, the master with the token performs what is called a ‘gap update.’ In a gap update, a single station address in the ‘gap’ is polled to see if a master is waiting there to come into the network. A master’s gap consists of all station addresses between the master itself and the next known master. So if the first master on-line is Station 2, then before the first time it passes the token, it checks to see if there is a master ready to come on at Station 3. During the next token cycle it checks Station 4, then Station 5, and so on, until it reaches the ‘Highest Station Address’. The address checking then continues with zero and back to the address of the master (See Figure 4).
The highest station address (HSA) is the highest address that a master checks when it is looking for another master. This value is specified for each master on the network. The highest station address must be set to a value greater than the all master addresses. If a master address is set to a value greater than the highest station address of the other masters on the network, it will never be brought on-line by the other masters. The highest station address is usually set as low as possible so that the gap is small and new masters will be brought on-line quickly.
Another parameter affecting the gap update is the ‘gap factor’. The gap factor tells a master how often to check for a new master in the gap. A gap factor of one causes a master to check a station in the gap each time it holds the token. A gap factor of ten causes a master to check a station in the gap every tenth time it holds the token. A low gap factor allows new masters to be brought on-line quickly because the gap is checked more often. A high gap factor increases network performance because less time is spent looking for new masters, but it increases the time required to bring a new master on-line.
Figure 4 A Token Ring Network: Station 3 queries a different station in the gap between itself and Station 2 each time before passing the token; it even queries stations with no devices.
After all the masters have given a positive reply during a gap update and are brought into the network, the token is passed among them in a ring. Each master whose station address is not adjacent to the next master is still performing a gap update (See Figure 5).
Figure 5 The token ring now consists of Stations 2 and 3. Since Station 2 is adjacent to the next master, it no longer checks for new masters. Station 3, however, still checks a different space in the gap during each token rotation.
In our example, all the masters are now in the network and Station 3 is performing the only gap update.
Tokens, Masters, and Slaves It is important to understand the difference between masters and slaves. In the network, a master is a device who can hold the token. A slave is a device that cannot hold the token. In this example, the CPU 222 is always a slave, meaning that it can only receive network requests and respond to them. It cannot hold the token or issue network commands independently. The CPU 224 is set up as a master. When it becomes a master it can hold the token and issue network commands, but it can still answer the requests of other masters. This is a point that is frequently missed: One master can still be the object of another master’s Network Read or Write.
Bringing in Another Master For example, suppose that another master is added into the network as Station 20 and is powered up. When it first comes on-line, Station 20 starts its listening cycle. Seeing the token is already moving around the network, it stays in a listening mode for at least two complete token rotations (two cycles of the network) in order to create a map of the current network before it attains a ‘ready to join’ status (See Figure 6).
Figure 6 Station 20 has joined the token ring. At this point, Stations 3 and 20 are both performing a ‘gap update’ (checking for new masters) during every cycle, because the masters are not adjacent.
When it is ready to join the network, Station 20 waits for Station 3 to ask it to join the network. When the gap update of Station 3 cycles back to Station 20 again, Station 20 replies positively and enters the token ring (See Figure 7).
As a further example, let’s say that at Station 20 we have a computer running Micro/WIN, instead of a CPU. A problem arises when both Station 20 and Station 2 both have several messages for Station 3
Figure 8 Station 20 has been changed to a computer with a CP card running Micro/WIN. In this situation, it is possible for the computer to “starve out” one or more of the other devices in the network.
Busys and Starving The basic problem is this: Micro/WIN, with a hardware-implemented PPI and a fast processor, can keep a CPU or another station so busy that no other masters can contact it (starving the other masters out). In this case, the CPU responds to requests from other masters that it is busy.
There is a simple solution to this problem. You can prevent Micro/WIN from performing a gap update by placing another master at the next station address. As shown in Figure 9, Micro/WIN is now at address 3 and another master is directly after it at Station 4. This setup prevents Micro/WIN from executing a gap update, which forces it to pass the token more quickly and prevents it from tying up a CPU.
Figure 9 Station 20 has been moved to Station 3 to prevent it from performing a gap update and starving out the other masters.
CP vs PC/PPI In the above example, the programmer has a CP (Communication Processor) card. A programmer with a CP card is always a master device. The CP cards have hardware and software which manage the network for the programming package. CP cards allow programmers to communicate on networks with all types of masters and at any baud rate. NOTE: All devices on a network must be at the same baud rate to work correctly.
The PC/PPI cable is very different because it only converts the RS 232 communication port of the PC to the RS 485 network used by the S7 200 CPUs. Micro/WIN allows a PC using a PC/PPI cable and running Windows 95, Windows 98, Windows 2000, or Windows Me to be a master by installing a special communication port driver. This driver allows the PC to hold and manage a token, but it is limited to operating at 9600 or 19.2K baud. You enable the master driver by checking the ‘Multiple Master Network’ option on the PG/PC communication interface in Micro/WIN.
The multiple master driver generally operates correctly on most PCs. There are some PCs on which the user must adjust the communication port FIFO settings to allow the driver to operate. On these PCs the receive FIFO should be moved to its lowest setting to allow the driver to operate more efficiently. In addition, for PCs running Windows 2000 or Windows Me the transmit FIFO should also be moved to its lowest setting. Some other PCs do not allow the multi-master driver to operate because of other applications running on the PC. On these systems you may have to close other applications or disable the multi-master driver and use the single master driver.
If you are operating Micro/WIN on a PC running the Windows NT operating system or you have not enabled the ‘Multiple Master Network’ option, Micro/WIN operates in single master mode on the network. In this mode Micro/WIN does not operate as a network master or pass the token to other masters. If you try connecting Micro/WIN to a network with active master devices, you will receive errors and disrupt the communications of the other masters.
Peripherals There are many other peripherals, such as the TD 200 and the OP 7, that can connect to a network. Both of these devices talk to a certain CPU in the network and behave as masters. Figure 10 shows the physical connection of two TD 200s, an OP 7, and a programmer with a CP card to a basic network.
Figure 10 The Basic Network Adds Peripherals
Figure 11 The Basic Network Talks to Its Peripherals
The reason these devices are masters is that each peripheral has to initiate a request to gather data from the CPUs. To do this, it needs access to the network. Generally each device talks to a separate CPU (See Figure 12).
Figure 12 The Peripherals Communicate on the Basic Network
Peripherals Addressing the Same Unit If each of these peripherals were trying to address the same unit, the “busy” problems discussed above can arise (Figure 13). The TD 200 and the programmer with the CP card can handle the problem, but the OP 7 (and up) can only perform moderately well and the OP 3 will not cooperate at all.
Figure 13 The Basic Network Gets Confused
Note for Micro/WIN When a PC with a CP card running Micro/Win is connected to a network, you may get a time-out error saying that the programmer can’t join the network. This situation occurs because each master has to wait to be polled before it can come into the network, and because some ‘gaps’ may contain a hundred or more different addresses. Ignore the message, wait a few seconds, and then proceed normally. Generally, by the time you need to do network tasks the programmer will have joined the network.
Note: Some of the most common errors in networking occur because the network has devices in it that can’t communicate effectively. To prevent this communication problem, do the following:
- Be sure that you don’t have multiple masters on a network with a device that doesn’t support multi-master connections.
- Be sure that you don’t have devices that can’t handle ‘busy’s on the same network as devices with a hardware-implemented communication protocol.
Addendum C: Physical Data
- A network can have no more than 32 devices without a RS485 repeater
- Including repeaters, a network can have up to 128 devices
- The maximum number of masters on the network is 32.
- Cable can be no longer than 10km
(Certain cables may vary; check with your manufacturer)
- Recommended Cables:
Beldin Cable No: 3079A Siemens Cable No: 6XVI 830-0AH10
- Recommended Connectors:
Without programming device port: 6ES7 972-0BA40-0XA0 With programming device port: 6ES7 972-0BB40-0XA0
- The ends of the network should be terminated.
Addendum D: Panel-Tec Information
The Panel-Tec device listed in the component matrix (Model Number: DTU-3000) is a serial device which transfers information between unlike CPUs. It supports over 25 protocols and includes 2 CPU Ports and 1 Configuration Port / Expansion Port. (Each Port is configurable for RS232 or RS422.)
|