The invention relates to a field bus adapter for transmitting and receiving control data from a field bus network where data is being exchanged according to a specific field bus protocol. The adapter comprises a transmitter for transmitting data to the field bus network and a receiver for receiving data from the field bus network. The invention further relates to a method for transmitting and receiving control data from a field bus network where data is being exchanged according to a specific field bus protocol. The method comprises the step of transmitting data to the field bus network and the step of receiving data from the field bus network. The invention also relates to a storage medium having stored thereon instructions for performing the method of transmitting and receiving control data from a field bus network where data is being exchanged according to a specific field bus protocol. The method comprises the step of transmitting data to the field bus network and the step of receiving data from the field bus network.
Communication networks coupling input and output devices have been increasingly applied to many different control systems. These input devices and output devices allow the controllers to receive and process local I/O functions, such as a measured physical value e.g. a temperature. The devices communicate using bus communication, also called field bus network communication.
In control systems it is essential that the communication is performed reliably and within short time intervals. This is e.g. important since fast and reliable data is often a must in order to obtain a satisfactory control. Therefore, very strict requirements are set to answering times in field bus network communication, typically being much stricter than the requirements of communication in standard IT systems.
In a field bus communication network a variety of different field bus communication protocols can be used, where the most common used field bus types are Profibus PA (PB) and Foundation Fieldbus (FF). One protocol is usually dedicated to a given control system or to a network of control systems having the same type of control.
A field bus adapter is dedicated to a specific network protocol so that the unit cannot be used on networks where a different communication protocol is used. Thereby different network interface units for each different communication protocol are required.
U.S. Pat. No. 6,151,640 describes a field bus network of input and output devices being coupled to a control system through an I/O interface module, regardless of their data structures. The I/O interface module is coupled to the control system through a serial communication port. Local input and output devices are coupled to the interface I/O module through a local I/O interface, and networked input and output devices are coupled to the interface I/O module through a field bus communication adapter. In this example, a different adapter is required for each type of field bus protocol, not solving the problem of requiring specific units for specific network protocols.
EP 0906595 describes a circuit for communication between external field devices and a field bus. The circuit is adapted for detecting the protocol and the supply voltages of the external field devices connected to the circuit and communicating across the field bus via the circuit. In EP 0906595 it has not been described how this protocol detection could be performed.
In order to comply with the strict requirements to answering times in field bus network communication, it is very important that the detection process can be performed very fast. Further, the detection process should have very low requirements to the needed resources, whereby both the size of memory in the circuit and the requirements to the CPU can be less harsh.
It is an object of the present invention to provide a solution to the above mentioned problems.
This is obtained by a field bus adapter for transmitting and receiving control data from a field bus network where data is being exchanged according to a specific field bus protocol, said adapter comprises a transmitter for transmitting data to the field bus network and a receiver for receiving data from the field bus network, characterised in that the adapter further comprises a protocol detector adapted for detecting a field bus protocol between a number of predefined field bus protocols and setting up the receiver and the transmitter for communicating according to said detected field bus protocol, said protocol detector comprising
By having characteristics that uniquely identify a protocol from a number of predefined protocols, the protocol can easily be identified. Since the characteristics only have to identify uniquely a protocol from a limited number of predefined protocols, these characteristics are easier to obtain and thereby determining if the received data complies with the characteristics becomes simple, and as a result the detection process requires few resources.
A further advantage is that the same field bus adapter is compatible with a number of different communication protocols. Adapters communicating in a field bus network, using a first protocol, can then be used for communicating in another field bus network using a different protocol, or the protocol used in a field bus network can be changed without having to change the adapters. This makes the adapter more interesting for the potential buyers. Further, for the producer of the adapters it is an advantage that only one production line is necessary instead of a number of production lines producing adapters being specific for each field bus protocol. The adapter of the present invention also makes it easy for the user since it is not necessary to know exactly which field bus protocol is being used; instead the adapter can be connected and then the field bus protocol is automatically detected and used. In a specific embodiment the protocol detector is adapted for detecting two predefined field bus protocols being a first and a second predefined field bus protocol, the protocol detector comprising
When the detector only has to determine which of two predefined protocols is being used on a field bus network, the detection process becomes very simple since a detection only has to be performed based on one protocol. If it is not the one protocol, then it is the other protocol. This method is very simple and requires few resources.
In an embodiment the data are received in data frames comprising a number of fields and wherein said characteristics uniquely identify data frames of one of said number of predefined field bus protocols. A protocol is normally characterised by its data frame structure; therefore by looking at this structure, the protocol type can be determined in a simple and fast way.
In a specific embodiment the characteristics uniquely identifying a data frame comprise characteristics of the content of specific fields in the data frame. By looking at specific fields, characteristics related to the protocol can be identified in a simple manner.
In a specific embodiment the characteristics uniquely identifying a data frame comprise the length of a data frame. The characteristics related to a specific protocol could also be identified by length. This could e.g. be a supplement to the content detection.
In an embodiment the predefined protocol is detected based on more than one data frame. This is to improve the detection process and thereby reduce the chance of error detection. Further knowledge about concurrent data frames related to the protocol could also make it necessary to check data frames in order to uniquely identify a protocol.
In another embodiment the first field bus protocol is Profibus PA and the second field bus protocol is Foundation Fieldbus. These two protocols are very commonly used in field bus networks.
In a specific embodiment the characteristics uniquely identifying a Profibus PA comprise characteristics of the content of the first field in the data frame and of the length of the data frame. This has proven to be a very efficient way of uniquely identifying a Profibus PA data frame from a Foundation Fieldbus data frame.
In an embodiment the control data to be transmitted is a value representing a measured physical value. The physical value could be both temperature, speed, and/or distance and the physical value is then used for controlling a process performed by a control unit connected to the field bus network.
In a specific embodiment the adapter comprises means for measuring said physical value. Thereby the adapter comprises the measuring means or the transducer and the adapter is dedicated for a specific purpose which makes the adapter both easy to install and which makes it easier to optimize the adapter for the specific purpose.
The object of the present invention is also obtained by a method comprising the step of detecting the field bus protocol and setting up the receiver and transmitter for communicating according to the detected field bus protocol.
In a specific embodiment the step of detecting the field bus protocol and setting up the receiver and the transmitter for communicating, according to the detected field bus protocol, is only performed in an initialisation phase before transmitting and receiving control data via said field bus network.
Thereby, the detection data can be processed faster since no detection process has to be performed.
In another embodiment the step of detecting the field bus protocol is performed periodically in predefined intervals. Thereby the used protocol can be changed in a field bus network and the method will adapt the transmitting and receiving format to the new protocol.
In the following, preferred embodiments of the invention will be described referring to the figures, where
When communicating across a field bus network, different communication protocols can be used and examples of field bus communication protocols are Profibus PA and Foundation Fieldbus. Normally, a protocol is chosen when setting up the control system and then all devices communicating via the field bus network use the selected protocol. Alternatively, the protocol detection could be used in a field bus network where different protocols are used on the same network. In this case the protocol detector detects the protocol each time data is received and processes the data according to the detected protocol.
In 205, the result of the check in 203 is used to determine the next step in the algorithm, and if the protocol has been detected as a protocol referred to as T1, then in 207 the instructions are extracted from the package according to rules defined by the protocol T1. In 209, actions are performed according to the extracted instructions and in 211 all future communication via the field bus network will be performed according to the detected protocol T1. The future communication could be performed by receiving a data packet via the field bus network, extracting information according to T1 and performing an action according to the extracted information. The future communication could also be encoding instructions to be transmitted using the protocol T1 and then transmitting the encoded instructions. If the protocol has been detected as a protocol referred to as T2, then in 215 the instructions are extracted from the package according to rules defined by the protocol T2. In 217, actions are performed according to the extracted instructions and in 219, all future communication via the field bus network will be performed according to the detected protocol T2. Also, in this case, the future communication could be performed by receiving a data packet via the field bus network, extracting information according to T2 and performing an action according to the extracted information. The future communication could also be encoding instructions to be transmitted using the protocol T2 and then transmitting the encoded instructions. T2 and T1 could e.g. be respectively Profibus PA and Foundation Fieldbus.
A further possibility is that in 203 it is not possible to detect the protocol, which could be because of an error in the received data package, and thus the detection process is restarted using a new data package for protocol detection.
In
When it has been determined that the received data frame has not been transmitted according to the protocol T1, then in 309 the received data frame DF is compared to characteristics IDPT2 uniquely identifying a data frame being transmitted according to a second protocol T2. Again, as illustrated in 311, if the data frame DF has the same characteristics as the characteristics IDPT2 uniquely identifying T2, then the received data frame is transmitted according to the T2 protocol, otherwise it is not transmitted according the T2 protocol.
When it has been determined that the received data frame has not been transmitted according to the protocol T1 or T2, then in 313 the received data frame DF is compared to characteristics IDPT3 uniquely identifying a data frame being transmitted according to a third protocol T3. Again, if the data frame DF has the same characteristics as the characteristics IDPT3 uniquely identifying T3, then the received data frame is transmitted according to the T3 protocol, otherwise it is not transmitted according the T3 protocol.
The process can then be repeated for a number of protocols as long as characteristics exist which are uniquely identifying a protocol T4 from a remaining number of predefined protocols T5->. If there are e.g. 5 protocols (T1, T2, T3, T4, T5) to be detected, then the first protocol T1 to be detected has to be detected based on characteristics IDPT1 uniquely identifying T1 from the protocols (T2, T3, T4, T5); the second protocol T2 to be detected has to be detected based on characteristics IDPT2 uniquely identifying T2 from the protocols (T3, T4, T5); the third protocol T3 to be detected has to be detected based on characteristics IDPT3 uniquely identifying T3 from the protocols (T4, T5); the fourth protocol T4 to be detected has to be detected based on characteristics IDPT4 uniquely identifying T4 from the protocol T5. Finally, since the validity of the data frame has already been checked in 301, if there exits knowledge that only the five protocols (T1, T2, T3, T4, T5) are being used on the network, then it can automatically be determined that if the protocol cannot be detected as either (T1, T2, T3, T4), then it must be a T5 protocol and thereby the T5 protocol has been detected.
The order in which the detection is performed could be based on whether it is possible to identify uniquely a protocol from other protocols or on the amount of resources needed to uniquely identify a protocol, and if e.g. a protocol has strong characteristics, which can easily be uniquely identified from the group of possible protocols, then it could be of interest to detect this protocol initially. Further, if a protocol has weak characteristics, then the identification could be performed at a late stage in order to ensure that the protocol only has to be uniquely identified from a small group of protocols.
Other criteria to be used for the detection order could be based on knowledge about which protocol is being used most often on the field bus network. It is of interest to detect this protocol initially whereby a lot of detection steps can be saved and the detection is performed in a way minimising the use of time and resources, which can be crucial factors in field bus systems.
In
The characteristics could e.g. be a set of detection rules and if these rules are fulfilled then a protocol has been uniquely identified. In the following, an example of rules used to identify a Profibus PA protocol is presented.
In order to define characteristics of the rules to be used, it is necessary to look at the data frames used in both Profibus PA and Foundation Fieldbus.
The Profibus PA data frame format specified in the Profibus DLL specification is valid when the physical media is RS-485. For MBP (Manchester Bus Powered) media Preambles, SD, FCS, and ED, octets are added in the Segment coupler. The original FCS and ED are removed, since they are no longer needed. The original SD is not removed, since it has an informative function regarding the length of the frame. The four valid SD's are:
If the frame contains only one octet, it is “E5H”, called SC (=Single Character)
The Foundation Fieldbus (FF) data frame format is specified in the Fieldbus DLL specification (which refers to IEC 61158-4), as communication via the MBP media (H1-network). An FF data frame always begins with a Frame Control FC field. The valid FC values are specified in the table with the data link layer message structure in
It is of interest to compare the first field of each protocol data frame to see if one protocol could be uniquely identified by only looking at this first field. By comparing the data frames of Profibus and Foundation Fieldbus, it is clear that the FF-Frame Control field conflicts with the Profibus SD field under the following conditions:
In theory, an FF frame will match this format in one out of 16 million DC2 frame combinations, see
According to the above observations the following detection rules can be used to identify uniquely the Profibus PA protocol format being the more recognizable of the two.
It can be detected by means of 5 rules. These 5 rules should then represent all possible Profibus PA frames, and accept none of the possible FF frames. Since this is not 100% possible (because of the SD2/DC2), the test must be repeated on more than one data frame, and the majority of results will then determine the protocol type. This should provide a 100% sure result, since the FF-DC2 frame is not a type of frame meant to be repeated by the Publisher.
By checking the first octet of the received frame, it is possible to determine which one (if any) of the 5 rules it is relevant to check. If none of the rules are totally respected, the frame is defined as an FF data frame.
In
Number | Date | Country | Kind |
---|---|---|---|
PA 2002 00978 | Jun 2002 | DK | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/DK03/00034 | 1/20/2003 | WO | 12/27/2004 |