This application claims priority under 35 U.S.C. §119 to German Patent Application No. 10 2006 050 134.9 filed in Germany on Oct. 25, 2006, the entire contents of which are hereby incorporated by reference in their entireties.
The disclosure relates to a method for operation of a bus system.
A bus system consists of a plurality of subscribers, who communicate with one another over a shared line, the line being divisible into sections, so-called segments. It is generally known that each subscriber in such a bus system is assigned an individual subscriber address, which uniquely identifies this subscriber in the bus system.
In particular in field bus systems, the maximum number of subscribers from the address set is limited by definition. Thus it is known from the book by Manfred Popp “Profibus-DP: Grundlagen, Tips und Tricks für Anwender [“Profibus DP: Basics, Tips and Tricks for Users”], Hüthig, Heidelberg, 1998”, that a Profibus system in the maximum configuration can include a maximum of 126 subscribers with the addresses 0 to 125.
It is known for the addresses to be selected by means of switches, in particular by use of DIP switches. While these selected addresses of the bus subscribers can be read at any time, address conflicts can only be avoided if the addresses of all active subscribers are known and the address of the new subscriber is set without errors by the operator. The human intervention inherent in this system is already error-prone. In addition to this, the physical size and the sensitivity to moisture of the DIP switch is a disadvantage. The latter property severely restricts the usage sites of bus subscribers equipped in this manner.
The use of software for selecting the addresses of the bus subscribers is additionally known. However, the address can only be input with software using a second, active bus system. It is thus not possible previously to read out or change the address without this second system. The free address space must likewise be known. Here too, incorrect operator inputs are not ruled out.
In bus systems, such as the Profibus, in which it is possible to add a further subscriber by separating the bus line and inserting a further bus connector, there is the latent risk that two subscribers in the bus system have the same subscriber address. If this doubly assigned subscriber address is called, both subscribers try to answer, causing an access conflict by the simultaneous access to the bus.
The disclosure is therefore based on the object of specifying a method for operating a bus system of this type, in which access conflicts from doubly assigned subscriber addresses are reliably avoided without further aids.
The disclosure is based on a bus system, in which a plurality of subscribers communicate with one another over the same bus line, and all subscribers are assigned a subscriber address from a limited address set. Each newly joining subscriber is also assigned an address, which for a subscriber installed for the first time is based on a factory setting, or, for a subscriber that has already been in service, comes from the past installation. The addresses are stored in a memory, and can be changed by instructions in a program.
The disclosure further assumes that in a bus system each subscriber also actually participates in the communication, and accordingly its address is detectably contained in the bus traffic in a time window that can be specified.
According to the disclosure it is provided that by each subscriber newly added to an existing bus system, the bus traffic will be monitored recursively for a defined time before the first send access to the bus with the current subscriber address, and if the subscriber detects its own subscriber address in the bus traffic the subscriber's own address is independently changed according to a predefinable schema.
In detail, each newly added subscriber will first access the bus for reading only for a defined time, and analyze the bus traffic for the occurrence of its own current subscriber address.
As soon as the newly added subscriber detects its address in the bus traffic, it independently changes its own address according to a predefinable schema, and checks, in renewed read-only access to the bus for the duration of the defined time, whether its new address occurs in the bus traffic. This sequence of steps is repeated recursively until the subscriber no longer detects its address in the bus traffic within the defined time. The subscriber's current address is then regarded as unique in the bus system, and the subscriber is allowed write access to the bus.
According to a further feature of the disclosure, it is provided that the address of the subscriber is changed by a predeterminable offset. The subscriber's address is then changed by the same offset in each recursion.
According to a further feature of the disclosure, it is provided that the bus is monitored by the newly added subscriber before the first send access for the duration of at least one bus cycle. In bus systems in master/slave architecture in particular, each slave is addressed by the master at least once within a bus cycle. This means that after a complete bus cycle has elapsed, all addresses occurring in the bus system have occurred at least once in the bus traffic.
Further particulars and advantages of the disclosure will now be explained in more detail with reference to an example of a Profibus system. As already mentioned in the introductory part of the specification, a Profibus system in the maximum configuration can include a maximum of 126 subscribers with the addresses 0 to 125. Each subscriber is equipped at least with signal-processing means, in particular with a controller, and with storage means for retrievable storage of its address.
Within the exemplary embodiment it is assumed that subscribers with addresses #1 to #47 are already active in the bus system and communicate with one another. It is further assumed that another subscriber is being added to the bus system, and has the address #33 assigned from a previous installation. Accordingly, the address #33 is present in duplicate in the bus system under consideration.
The newly added subscriber with the address #33 monitors the bus for the duration of at least one bus cycle before the first send access to the bus, and will find out from the bus traffic that the address #33 is already held by another active subscriber. The newly added subscriber thereupon independently changes its own subscriber address according to a predefined schema.
In a first exemplary embodiment, it is provided that the subscriber address of the newly added subscriber is changed by a predeterminable offset. This offset is subsequently assumed to have the value “5”. The newly added subscriber accordingly increases its address #33 by the offset to #33+5=#38, and monitors the bus traffic before the first send access to the bus for the duration of at least one bus cycle, for the occurrence of the address #38. Under the assumption specified above, the newly added subscriber will detect its current address #38 in the bus traffic, and again change its address according to the predefined schema to address #38=5=#43. But the next address change according to the predefined schema, to address #43+5=#48, is the first to lead to a unique address in the bus system. The newly added subscriber begins communication in the bus system with this address #48.
In a further exemplary embodiment it can be provided that the offset has the value “1”. The subscriber address of the newly added subscriber is accordingly incremented recursively for each detection of its own address in the bus traffic.
In an alternative exemplary embodiment it can be provided that the offset has a negative numeric value. In particular it can be provided that the offset has the value “−1”. The subscriber address of the newly added subscriber is accordingly decremented recursively for each detection of its own address in the bus traffic.
Increment and decrement are basic commands of customary controllers and are advantageously easy to implement in the program run.
In an alternative development of the disclosure, it can be provided that the bus is monitored by the newly added subscriber before the first send access for a predefinable fixed duration, which is sized such that each subscriber of the bus system is addressed at least once within this time. It is thereby ensured, even for those bus systems for which no bus cycle is defined, that each address of an active subscriber in the bus system is unique.
According to a further feature of the disclosure it is provided that the value range for the address space is selectable. As a result, for subscribers that are suitable based on their technical equipment for operation in various bus systems with different address spaces, the selection of addresses that are outside the permissible address space in the respective bus system is avoided.
After the newly added subscriber is linked to a valid address in the bus system for active communication, a further feature of the invention provides for assigning a new subscriber address operationally to the added subscriber. Advantageously, this means that in a configuration in which certain subscriber groups are assigned predetermined address ranges, the newly added subscriber can be classified, corresponding to its membership of one of the subscriber groups, into the associated address range.
It will be appreciated by those skilled in the art that the present invention can be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The presently disclosed embodiments are therefore considered in all respects to be illustrative and not restricted. The scope of the invention is indicated by the appended claims rather than the foregoing description and all changes that come within the meaning and range and equivalence thereof are intended to be embraced therein.
Number | Date | Country | Kind |
---|---|---|---|
10 2006 050 134.9 | Oct 2006 | DE | national |