Communication device

Abstract: A communication control section (14) is provided with a plurality of receiving channels (RXDA1) and (RXDA2). An address separated by an address separating section (30) constituting the receiving channel (RXDA1) is compared with a reference address (100) denoting a token, and if the separated address corresponds thereto, an interrupt request is generated by an interrupt processing section (38). An address separated by an address separating section (34) constituting the receiving channel (RXDA2) is compared with a reference address (110) denoting the station number of that particular station, and if the separated address corresponds thereto, the interrupt request is similarly generated. When the interrupt has been requested, the processing of a CPU (24) transfers from the processing of a main routine by a main routine processing section (44) to an interrupt processing by an interrupt processing section (46).

Description: BACKGROUND OF THE INVENTION (i) Field of the Invention The present invention relates to a communication device for use in communication between, for example, programmable controllers. (ii) Description of the Prior Art As a technique for preventing transmitted data from colliding on a communication medium in a network constituting a plurality of communication devices (stations), there is, for example, control by a token. Fig. 5A shows one constitutional embodiment of a system using such control and Fig. 5B shows the constitution of frames in this system, while Fig. 6 shows frame formats of the token and data in this system. In the system shown in Fig. 5A, a plurality of stations 10 to which station numbers 12, 13, 14 ... are attached are connected to a communication line 11. Each station 10 acquires a data transmission right, when it has received the token addressed to itself from another station via the communication line 11. The station 10 which has acquired the data transmission right transmits the data through the communication line 12 to other stations, and then transmits the token to the next station 10 via the communication line 12 after the data transmission has finished. As is apparent from the foregoing, in the data transmission system using token passing, the token is circulated through the respective stations 10 to carry out acquisition and transfer of the transmission right, whereby the collision of the data on the communication line 11 can be prevented. A frame regarding the data which are transmitted among the respective stations 10 is usually called an LLC (logical link control) data frame, and another frame regarding the control of a medium (the communication line 11 ), such as the token, is called an MAC (media access control) frame. For example, when having received a frame shown in Fig. 5 B a), the station 10 having the station number 12 acquires the token. As shown generically in Fig. 6 a), the frame regarding the token has flags (each 1 byte) regarding HDLC (high level data link control) procedure at the head and tail thereof, and it further contains a hexadecimal code (EX wherein X is optional) denoting the token, the station number of the destination station, the station number of the station from which the transmission is made, and CRC (cyclic redundancy check) code (each 1 byte). The frame shown in Fig. 5 B a), which station number 12 has received is, a frame regarding the token transmitted from the station number 11 to the station number 12, and so the station number 12 acquires the token. The station number 12 which has acquired the token transmits the data in the form of a frame shown in Fig. 5 B b). The frame regarding the data, as shown in Fig. 6 b), has flags regarding the HDLC procedure at the head and tail thereof, and it further contains the station number of the destination station, the station number of the station from which the transmission is made, the data and the CRC code. After having transmitted the data in the form of the frame shown in Fig. 5 B b), station number 12 transfers the transmission right to station number 13 by transmitting the token in the form of a frame shown in Fig. 5 B c). The station number 13 which has acquired the token transmits the data in the form of a frame shown in Fig. 5 B d), and then transmits the token in the form of a frame shown in Fig. 5 B e) to the next station, i.e., station number 14. In order to achieve the above-mentioned control by the use of the token, each station 10 has a function for judging whether or not the frame regarding the token or the data received via the communication line 11 is addressed to itself. For example, as shown in Japanese Patent Application Laid-open No. Hei 3-44236, the judgement as to whether or not the frame is addressed to that station can be made by software processing. However, in the conventional technique having such a constitution, an interrupt is often generated to processing means (CPU) constituting the respective stations, so that the throughput of the processing means disadvantageously deteriorates. That is, the frame transmitted through the communication line is received by a single receiving channel of each station, and in compliance with this receive action, the interrupt is generated to the processing means, such as a CPU. Responding to the interrupt request, the CPU checks the address region of a predetermined position (e.g., the second byte in an embodiment in Fig. 6) of the received frame by software means. As a result of this check, only when the information stored in this address region corresponds to its own station number or a specific address (EX) representing the token, does the CPU execute processes corresponding to the data or the token. If the information stored in this address region does not correspond to its own station number or the specific address regarding the token, the processing means discontinues the receiving operation or abandons the received data. As described above, in the conventional technique, the interrupt must be generated to check the station number even in the case of the frame regarding the data or the token for a different station, and because of this, performance has been noticeably poor. Another technique is shown in EP-A-0064347 which described a communication device including a processor and a communication controller in which the communication controller checks the address region of received data frames and only when the information stored in this address region corresponds to its own station number does the communication controller interrupt the processor to analyse the frame communication data. This system avoids interrupting the processor to check the station number even where the frame is intended for a different station but it is not capable of operating in systems employing MAC frames. SUMMARY OF THE INVENTION Objects of the present invention are to relieve the load on the progressing means and to improve processing performance of a device by inhibiting the generation of an interrupt request to the processing means in the case that a frame regarding a received token or data is addressed to a different station and to allow the device to respond both an LLC data frame and an MAC data frame. In a first aspect, this invention provides a communication device used as at least one of a plurality of stations constituting a communication network, the communication device comprising: processing means for conducting communication processing; and interrupt means for requesting interrupt processing from the processing means; the interrupt means including; a first communication channel, in connection with a communication medium, for judging whether or not a frame received through the communication medium is a logical link control data frame for data transmission addressed to the communication device by comparing a destination address contained in the frame with a first reference address; and characterised by further comprising; a second communication channel, in connection with the communication medium, for judging whether or not the frame received through the communication medium is a media access control frame for the maintenance and control of normal communication addressed to all stations including the communication device by comparing a destination address contained in the frame with a second reference address; and interrupt request means for requesting, from the processing means, the interruption processing regarding the media access control frame in the case that the frame received through the communication medium is judged to be the media access control frame by the second communication channel, or the interrupt processing regarding the logical link control data frame in the case that the frame received through the communication medium is judged to be the logical link control data frame by the first communication channel. In the present invention, the interrupt processing is requested from the processing means, only when the frame received from the communication medium meets predetermined conditions. This condition is that the frame received from the communication medium is the LLC data frame addressed to that station or is the MAC frame which all the stations taking part in the communication generally receive. That is, the interrupt processing is requested from the processing means, only when the LLC data frame addressed to that station, or the MAC frame is received. The reason why such processing is possible is that the first and second channels are provided as communication channels in one station or communication device and it is judged by each communication channel whether or not the interrupt is necessary. That is, since the need for the interrupt is judged by each channel, it is no longer necessary to interrupt the processing means with the frame which need not be processed by that station, so that the processing performance of the whole device can be improved. The necessity of the interrupt is judged by comparing a destination address contained in the frame on the communication medium with first and second reference addresses set by the processing means. As the first reference address, a specific address indicating the MAC frame is set, and as the second reference address, an own station address, inherent in the each station itself, is set. In the first communication channel, the destination address is separated from the MAC frame, and this destination address is then compared with the first reference address to judge whether or not the received frame is the MAC frame. In the second communication channel, the destination address is separated from the LLC data frame, and this destination address is then compared with the second reference address to judge whether or not the received frame is the LLC data frame addressed to that station. Furthermore, the communication device of the present invention can be used for communication between application control devices such as programmable controllers. In such a use, when no interruption request is generated, the processing means executes usual processing inclusive of reception and transmission of commands and data between the processing means and the application device as well as the analysis of the commands and data. Once the interrupt processing is requested, the processing means discontinues the usual processing and executes reception processing. In the reception processing, there are conducted at least the extraction of the data from the received frame and the processing of the preparation for the subsequent reception processing. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing the constitution of a communication device regarding one embodiment of the present invention. Fig. 2 is a block diagram showing the constitution of a communication control section and a CPU in the embodiment of Fig. 1. Figs. 3A and 3B are flow charts showing the operation sequence of the communication control section in the embodiment of Fig. 1. Fig. 4 is a flow chart showing the operation sequence of the CPU in the embodiment of Fig. 1. Fig. 5A shows one exemplary constitution of a system involving control by a token. Fig. 5B shows the constitution of frames. Fig. 6 shows one example of each frame format of the token and data. DETAILED DESCRIPTION OF PREFERRED EMBODIMENT Next, the present invention will be described in detail with reference to suitable examples. The present invention can be carried out in accordance with a system constituted as shown in Fig. 5A, and therefore in the following description, symbols in Fig. 5A will also be referred to. Fig. 1 shows the constitution of a communication device 16 regarding one embodiment of the present invention in which an LSI for communication is mounted as a communication control section 14. The communication device 16 shown in this drawing can be used as each station 10 in the system constitution in Fig. 5A, and it is connected to a communication line 18. This communication device 16 is constituted of a modulation/demodulation section 20, a communication control section 14, a data storage section 22, a CPU 24, a ROM 26 and an area 28 for sending and receiving data to and from an application processor. The modulation/demodulation section 20 demodulates a frame regarding a token or data from a signal input through the communication line 18 at the time of receiving, and feeds the demodulated frame to the communication control section 14. This communication control section 14 detects an address from the frame demodulated by the modulation/demodulation section 20, and then generates an interrupt request to the CPU 24, if this address meets certain conditions. The CPU responds to this request to discontinue the processing, and then stores the information constituting the frame received via the modulation/demodulation section 20 in the data storage section 22. The ROM 26 is memory means for storing the operation program of the CPU 24. The area 28 for sending and receiving the data to and from the application processor, is a memory area for sending and receiving communication data to and from the application processor, for example, a processor of a programmable controller. The CPU 24 carries out predetermined processing on the received information stored in the data storage section 22, and then writes the processed information into the area 28 for sending and receiving the data to and from the application processor. Fig. 2 shows the constitution of the communication control section 14 and the CPU 24 in this embodiment. As shown in this drawing, the communication control section 14 is equipped with two receiving channels RXDA1 and RXDA2. These receiving channels RXDA1 and RXDA2 are both connected to the communication line 18 via the modulation/demodulation section 20. The receiving channel RXDA1 is constituted of an address separating section 30 and an address comparing section 32, and the receiving channel RXDA2 is constituted of an address separating section 34 and an address comparing section 36. The communication control section 14 further has an interrupt processing section 38. Figs. 3A, 3B and 4 show the operation sequence of the communication control section 14 and the CPU 24 in this embodiment. As shown in Figs. 3A and 3B, each of the address separating sections 30 and 34 extracts the address region of the frame demodulated by the modulation/demodulation section 20, for example, the second byte of a frame constitution shown in Fig. 6 (step 202 or 302). Each of the address comparing sections 32 and 36 compares an address separated by the corresponding address separating section 30 or 34 with a reference address 100 or 110 (step 204 or 304). As the reference address 100 or 110, a predetermined address is set by a reference address setting section 40 of the CPU 24, prior to the step 202 to 302 (step 200 or 300). That is, as the reference address 100 regarding the receiving channel RXDA1, EX denoting the token is set, and as the reference address 110 regarding the receiving channel RXDA2, the station number of that actual station is set. Therefore, by the processing of the step 204, it is detected that the information demodulated by the modulation/demodulation section 20 is the token, and by the processing of the step 304, it is detected that the information is the data addressed to that particular station. When the detection is made in the step 204 or 304 by the comparison, an interrupt request is generated to the CPU 24 by the interrupt processing section 38 in the subsequent step 206 or 306. In compliance with this interrupt request, the CPU 24 discontinues the processing of a main routine and starts the interrupt processing. That is, when the interrupt request is generated by the interruption processing section 38, an interrupt control section 42 of the CPU 24 switches the processing from a main routine processing section 44 to an interrupt processing section 46. Concretely, before the occurrence of the interruption, the CPU 24 executes the main routine shown in Fig. 4. That is, it carries out data exchange with an application region (400), the analysis of commands from the application region (402), the delivery of a response to the application region (404), and the analysis and processing of the received data (406). When the interrupt request is generated by the interrupt processing section 38 of the communication control section 14, the processing of the main routine is discontinued by the operation of the interrupt control section 42, and the processing of the interrupt processing section 46, i.e., interrupt processings shown by numerals 500 to 504 in Fig. 4 are conducted. In the step 500, the received data are read from the data storage section 22 by the CPU 24, and in the step 502, a receiving completion processing and preparation for the next receiving are conducted. In the step 504, the interrupt processing ends and the processing returns to the main routine. As described above, in the present embodiment, the address search of a frame regarding a token and data is conducted by the use of a plurality of channels of the receiving channels RXDA1 and RXDA2, and therefore it is no longer necessary for the CPU 24 to execute the judgement processing as to whether or not the frame is addressed to that station itself by software means. Thus, a look-up table system is established by the decrease of interrupt frequency and the simplification of an interrupt processing content, and owing to this look-up table system, there can be obtained effects such as the load relief of the CPU 24 and the improvement of processing performance of the whole device. Furthermore, these receiving channels RXDA1 and RXDA2 can be used as hardware (in an exclusive state). In addition, priority can be assigned, and for example, the interrupt of the token can have priority over the interrupt of the data.

Claims: A communication device (16) used as at least one of a plurality of stations constituting a communication network, the communication device (16) comprising: processing means (24) for conducting communication processing; and interrupt means (14) for requesting interrupt processing from the processing means (24); the interrupt means (14) including; a first communication channel (RXDA2), in connection with a communication medium (18), for judging whether or not a frame received through the communication medium (18) is a logical link control data frame for data transmission addressed to the communication device by comparing a destination address contained in the frame with a first reference address (110); and characterised by further comprising; a second communication channel (RXDA1), in connection with the communication medium (18), for judging whether or not the frame received through the communication medium (18) is a media access control frame for the maintenance and control of communication addressed to all stations including the communication device by comparing a destination address contained in the frame with a second reference address (100); and interrupt request means (38) for requesting, from the processing means (24), the interruption processing regarding the media access control frame in the case that the frame received through the communication medium (18) is judged to be the media access control frame by the second communication channel (RXDA1), or the interrupt processing regarding the logical link control data frame in the case that the frame received through the communication medium (18) is judged to be the logical link control data frame by the first communication channel (RXDA2). The communication device (16) according to claim 1 wherein; the second communication channel (RXDA1) has means (30) for separating the destination address from the frame received through the communication medium (18), and means (32) for comparing the destination address with the second reference address (100) to judge whether or not the frame received through the communication medium (18) is the media access control frame; the first communication channel (RXDA2) has means (34) for separating the destination address from the frame received through the communication medium (18), means (36) for comparing the destination address with the first reference address (110) to judge whether the frame received through the communication medium (18) is the logical link control data frame addressed to the communication device; and the processing means (24) has means (40) for setting a specific address indicating the media access control frame to the second reference address (100), and for setting a communication device address inherent in the communication device to the first reference address (110). The communication device according to claim 1 or 2 wherein the processing means (24) has: first processing routine means (44) for conducting processing inclusive of reception and transmission of commands and data between the processing means and an application device as well as the analysis of the commands and data; second processing routine means (46) for conducting reception processing inclusive of the extraction of the data from the frame received through the communication medium (18) and the processing of preparation for the next reception processing; and control means (44) for discontinuing the processing by the first processing routine means (44) and conducting the reception processing by the second processing routine means (46), when the interrupt processing is requested.

Inventors: ITO SAKAE, OKAMURA NAOKI, TAKANO HIDETOSHI, TAKAO NORIYUKI, ITO, SAKAE, OKAMURA, NAOKI, TAKANO, HIDETOSHI, TAKAO, NORIYUKI
Applicants: SHARP KK, TOYOTA MOTOR CO LTD, SHARP KABUSHIKI KAISHA, TOYOTA JIDOSHA KABUSHIKI KAISHA
Application year: 1994
Main classification: H04L29
IPC codes: H04L12, H04L29