Abstract:
Disclosed herein are embodiments of a method for controlling a slave device in a system including a master device and a plurality of groups of slave devices. In one embodiment, the method includes generating, by the master device, a control message containing group data items each corresponding to the respective groups to transmit the control message to a particular group; transmitting, by a slave device included in the particular group, the control message to a next group; extracting, by the slave device, a group data item from the control message after the transmitting the control message; extracting/writing, by the slave device, data from/onto the group data; and transmitting, by the slave device, the group data to the master device after completing the extracting/writing.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims the priority of Korean Patent Application No. KR 10-2015-0054788 filed on Apr. 17, 2015, in the Korean Intellectual Property Office, which is incorporated by reference in its entirety. 
       BACKGROUND 
       [0002]    1. Technical Field 
         [0003]    The present disclosure relates to a slave device and a method for controlling the same. 
         [0004]    2. Description of the Related Art 
         [0005]    Typically, in a network with a number of devices connected thereto, the devices may be divided into a master device and slave devices. The master device monitors operation of slave devices or transmits instructions or data required by the slave devices. In general, when a network includes a large number of slave devices, a master device transmits a control message to each of the slave devices to control them. 
         [0006]      FIG. 1  is a diagram illustrating a data transmission scheme between a master device and slave devices in the related art. Referring to  FIG. 1 , a master device M generates as many control messages as slave devices existing in the network. Then, the master device M transmits the generated control messages to the slave devices S 1  to S 4 , respectively. The slave devices S 1  to S 4  apply there to the received control messages from the master device M or transmit input data to the master device M as requested. 
         [0007]    In doing so, in order to control the slave devices S 1  to S 4 , the master device M has to generate as many control messages as the slave devices S 1  to S 4  in the network and transmits them to the slave devices S 1  to S 4 , respectively. 
         [0008]    However, according to this scheme, there is a problem in that data traffic increases as the number of slave devices increases and in turn the number of control messages increases. As a result, data transmission time increases and thus it becomes difficult to control the slave devices in real-time. 
         [0009]    To overcome this problem, there has been proposed a data transmission scheme using the EtherCAT communications. 
         [0010]      FIG. 2  is a diagram illustrating a data transmission scheme using the EtherCAT communications in the related art. Referring to  FIG. 2 , in order to control slave devices S 1  to S 4  in a network, a master device M packages output data items S 1 _In, S 2 _In, S 3 _In and S 4 _In each having a fixed size into a single control message to transmit it to the slave devices S 1  to S 4 , respectively. Then, the master device M transmits the generated control message to the slave device S 1 . 
         [0011]    In the EtherCAT communications architecture shown in  FIG. 2 , the slave device. S 1  transmits the control message received from the master device M to the slave device S 2  in a cut-through manner, and likewise the slave device S 2  transmits the received control message to the slave device S 3 , and so on. The cut-through manner refers to a technique that a received message is transmitted as soon as the destination of the message is determined to thereby reduce standby time of the message. 
         [0012]    Initially, the slave device S 1  receives a control message from the master device M, and extracts input data S 1 _In from the first field of the control message that is associated with the slave device S 1 . Subsequently, the slave device S 1  writes output data S 1 _Out in the first field of the control message to transmit it to the slave device S 2 . 
         [0013]    The slave device S 2 , upon receiving the control message from the slave device S 1 , extracts input data S 2 _In from the second field of the control message that is associated with the slave device S 2 . Then, the slave device S 2  writes output data S 2 _Out in the second field of the control message to transmit it to the slave device S 3 . 
         [0014]    The slave device S 3 , upon receiving the control message from the slave device S 2 , extracts input data S 3 _In from the third field of the control message that is associated with the slave device S 3  to apply it thereto. Then, the slave device S 3  writes output data S 3 _Out in the third field of the control message to transmit it to the slave device S 4 . 
         [0015]    The slave device S 4 , upon receiving the control message from the slave device S 3 , extracts input data S 4 _In from the fourth field of the control message that is associated with the slave device S 4  to apply it thereto. Then, the slave device S 4  writes output data S 4 _Out in the fourth field of the control message to transmit it to the master device M. 
         [0016]    The master device M may determine whether the slave devices S 1  to S 4  are operating normally based on the output data S 1 _Out, S 2 _Out, S 3 _Out and S 4 _Out, respectively, included in the received control message from the slave device S 4 . 
         [0017]    According to the data transmission scheme using the EtherCAT communications as described above with referring to  FIG. 2 , the master device M only has to generate a single control message regardless of the number of the slave devices S 1  to S 4 . Therefore, the problem of the scheme described above with reference to  FIG. 1 , i.e., increase in data traffic can be addressed. Further, according to the data transmission to scheme using the EtherCAT communications as described above with referring to  FIG. 2 , the data transmission time can be reduced via the hardware switching manner, i.e., the cut-through manner. 
         [0018]    Unfortunately, the slave devices S 1  to S 4  cannot transmit other control messages while a control message is transmitted therebetween, in order to avoid data collision. 
         [0019]    In addition, the control message generated by the master device M has fields of fixed sizes in which input data of each of the slave devices S 1  to S 4  is stored, such that the size of data to be transmitted is limited. Further, for a network including a larger number of slave devices, the size of the data fields allocated to each of the slave devices decreases. 
         [0020]    Furthermore, as the number of the slave devices increases, the transmission delay of the control message increases linearly, such that it becomes difficult to control the slave devices in real-time. 
       SUMMARY 
       [0021]    It is an aspect of some embodiments of the present disclosure to provide a method for controlling a slave device in which slave devices are grouped, and a master device transmits a control message containing group data items, so that data traffic can be reduced even if the number of the slave devices increases. 
         [0022]    It is another aspect of some embodiments of the present disclosure to provide a method for controlling a slave device in which a slave device in a group transmits a control message transmitted from a master device to a next device via cut-through switching manner, so that data traffic can be reduced. 
         [0023]    It is yet another aspect of some embodiments of the present disclosure to provide a method for controlling a slave device in which the size of data transmitted from a slave device to a master device can vary as required. 
         [0024]    It should be noted that objects of the present disclosure are not limited to the above-described objects, and other objects of the present disclosure will be apparent to those skilled in the art from the following descriptions. 
         [0025]    In accordance with one aspect of some embodiments of the present disclosure, a method for controlling a slave device in a system comprising a master device and a plurality of groups of slave devices includes: generating, by the master device, a control message containing group data items each corresponding to the respective groups to transmit the control message to a particular group; transmitting, by a slave device included in the particular group, the control message to a next group; extracting, by the slave device, a group data item from the control message after the transmitting the control message; extracting/writing, by the slave device, data from/onto the group data; and transmitting, by the slave device, the group data to the master device after completing the extracting/writing. 
         [0026]    In accordance with another aspect of some embodiments of the present disclosure, a slave device in a system comprising a master device and a plurality of groups of slave devices includes: a receiving port configured to receive a control message containing group data items each corresponding to the respective groups or the group data items; a transmitting port configured to transmit the control message or the group data items to another device; and a data processing unit configured to extract the group data items from the control message, to extract input data from the group data items, and to write output data onto the group data items, wherein the transmitting port transmits the control message to a next group before the data processing unit extracts the group data items from the control message. 
         [0027]    The above described and other features are exemplified by the detailed description and accompanying drawings. 
         [0028]    Advantages and features of the present disclosure and methods to achieve them will become apparent from the descriptions of embodiments herein below with reference to the accompanying drawings. However, the present disclosure is not limited to embodiments disclosed herein but may be implemented in various different ways. The embodiments are provided for making the disclosure of the present disclosure thorough and for fully conveying the scope of the present disclosure to those skilled in the art. It is to be noted that the scope of the present disclosure is defined only by the claims. Like reference numerals denote like elements throughout the descriptions. 
         [0029]    According to an embodiment of the present disclosure, slave devices are grouped, and a master device transmits a control message containing group data items, so that data traffic can be reduced even if the number of the slave devices increases. 
         [0030]    According to another embodiment of the present disclosure, a slave device in a group transmits a control message transmitted from a master device to a next group via cut-through switching manner, so that data traffic can be reduced. 
         [0031]    In addition, according to an embodiment of the present disclosure, the size of data transmitted from a slave device to a master device can vary as required. 
     
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         [0032]      FIG. 1  is a diagram illustrating a data transmission scheme between a master device and slave devices in the related art; 
           [0033]      FIG. 2  is a diagram illustrating a data transmission scheme using the EtherCAT communications in the related art; 
           [0034]      FIGS. 3 and 4  are diagrams illustrating a data transmission method between a master device and slave devices according to an embodiment of the present disclosure. 
           [0035]      FIG. 5  is a block diagram for illustrating a configuration of a slave device according to an embodiment of the present disclosure; and 
           [0036]      FIG. 6  is a message sequence chart illustrating a data transmission method between a master device and slave devices according to an embodiment of the present disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0037]    Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. 
         [0038]      FIG. 3  is a diagram illustrating a data transmission method between a master device and slave devices according to an embodiment of the present disclosure. 
         [0039]    Referring to  FIG. 3 , a master device M is connected to a number of slave devices  200  existing in a network, and transmits input data items S 1 _In, S 2 _In, S 3 _In and S 4 _In contained in a control message  300  to the slave devices S 1  to S 4 , respectively. In addition, the master device M may determine whether the slave devices S 1  to S 4  are operating normally based on the output data items S 1 _Out, S 2 _Out, S 3 _Out and S 4 _Out written onto the control message by the slave devices S 1  to S 4 , respectively. 
         [0040]    It is to be noted that according to the embodiment, the slave devices S 1  to S 4  are grouped into a plurality of groups G 1  and G 2  as shown in  FIG. 3 . In  FIG. 3 , the first group G 1  includes slave devices S 1  and S 2 , and the second group G 2  includes slave devices S 3  and S 4 . Although four slave devices are grouped into two groups in the embodiment shown in  FIGS. 3 and 4  for convenience of illustration, different numbers of slave devices may be grouped into different numbers of groups in other embodiments. For example, according to an embodiment of the present disclosure, six slave devices may be grouped into two groups each including three devices, or into three groups each including two devices. 
         [0041]    Accordingly, the master device M generates a control message  300  including first group data  301  and second group data  302 . The first group data  301  contains input data items S 1 _in and S 2 _In to be transmitted to the slave devices S 1  and S 2 , respectively, belonging to the first group G 1  The second group data  302  contains input data items S 3 _In and S 4 _In to be transmitted to the slave devices S 3  and S 4 , respectively, belonging to the second group G 2 . The master device M packages the first group data  301  and the second group data  302  into the control message  300  and transmit the generated control message  300  to the first group G 1 . 
         [0042]    Referring to  FIG. 4 , the slave device S 1  of the first group G 1  receives the control message  300  from the master device M. Then, the slave device S 1  may receive the control message  300 , wait for a standby time, and transmit the control message  300  to the next group G 2 . That is, according to the embodiment of the present disclosure, after the groups G 1  and G 2  receive the control message  300 , they transmit the control message  300  to the next group immediately before extracting the group data  301  and  302  from the control message  300 , rather than transmitting the control message  300  to the next group after performing data processing (e.g., extracting input data or writing output data). 
         [0043]    In other words, according to the embodiment of the present disclosure, the groups transmit the control message  300  to the next group as soon as they receive the control message  300 . Then, after the transmission of the control message  300  is completed, group data are extracted, input data items are extracted and output data items are written, which will be described below. Accordingly, it takes less time for the groups G 1  and G 2  to receive the control message  300 , and thus increase in data traffic can be reduced even with more slave devices. 
         [0044]    On the other hand, according to another embodiment of the present disclosure, the slave device S 1  of the first group G 1  may receive the control message  300 , extract first group data  301  from the control message  300  and immediately transmit the control message  300  to the second group G 2 . 
         [0045]    The slave device S 1  may extract an input data item S 1 _In from the first group data  301  extract from the control message  300 . Then, the slave device S 1  generates an output data item S 1 _Out at a predetermined data size for transmission to the master device M and writes it onto the first group data  301 . That is, according to the embodiment of the present disclosure, the size of the output data item S 1 _Out may vary depending on a predetermined size, unlike in the related art. Then, the slave device S 1  transmits the first group data  301  in which the output data S 1 _Out is written to the slave device S 2  of the same group G 1 . 
         [0046]    The slave device S 2  receives the first group data  301  from the slave device  51  and extracts an input data item S 2 _In therefrom. Then, the slave device S 2  generates an output data item S 2 _Out at a predetermined data size for transmission to the master device M and writes it onto the first group data  301 . Then, the slave device S 2  sets the destination address of the first group data  301  to the address of the master device M and transmits the first group data  301  to the master device M. The first group data  301  transmitted by the slave device S 2  may be transmitted to the master device M via the second group G 2  or may be transmitted directly to the master device M. 
         [0047]    In addition, according to yet another embodiment of the present disclosure, the slave device S 4  of the second group G 2  may receive the control message  300 , extract second group data  302  from the control message  300  and then immediately transmit the control message  300  to the first group G 1 . 
         [0048]    The slave device S 4  may extract an input data item S 4 _In from the second group data  302  extract from the control message  300 , and then may generate an output data S 4 _Out for transmission to the master device M at a predetermined data size to write it onto the second group data  302 . That is, according to the embodiment of the present disclosure, the size of the output data item S 4 _Out may vary depending on a predetermined size, unlike in the related art. Then, the slave device S 4  may transmit the second group data  302  in which the output data S 4 _Out is written to the next slave device S 3  of the same group G 2 . 
         [0049]    The slave device S 3  may receive the second group data  302  from the slave device S 4  to extract an input data item S 3 _In, and then may generate an output data S 3 _Out for transmission to the master device M at a predetermined data size to write it onto the second group data  302 . Then, the slave device S 3  sets the destination address of the second group data  302  to the address of the master device M and transmits the second group data  302  to the master device M. The second group data  302  transmitted by the slave device S 3  may be transmitted to the master device M via the first group G 1  or may be transmitted directly to the master device M. 
         [0050]    The control message  300  undergoes the same processing and transmission in the second group. The slave device S 3  of the second group G 2  extracts the second group data  302  from the control message  300  transmitted via the first group G 1 . 
         [0051]    The slave device S 3  extracts the input data item S 3 _In from the second group data  302 , and generates the output data item S 3 _Out at a predetermined data size to write it onto the second group data  302 . Then, the slave device S 3  transmits the second group data  302  in which the output data S 3 _Out is written to the slave device S 4  of the same group G 2 . 
         [0052]    The slave device S 4  receives an input data item S 4 _In from the second group data  302  received from the slave device S 3 . Then, the slave device S 4  generates an output data item S 4 _Out at a predetermined data size for transmission to the master device M and writes it onto the second group data  302 . Then, the slave device S 4  sets the destination address of the second group data  302  to the address of the master device M and transmits the second group data  302  to the master device M. 
         [0053]    The master device M may determine whether the slave devices S 1  to S 4  are operating normally based on the output data item S 1 _Out, S 2 _Out, S 3 _Out and S 4 _Out written in the group data  301  and the group data  302  transmitted from the groups G 1  and G 2 . 
         [0054]    As described above, according to the embodiment of the present disclosure, the process of responding by the slave devices S 1  to S 4  to the master device M, e.g., writing the output data items and transmitting the group data are performed at the group level. Accordingly, it takes less time to transmit data and it is possible to control the slave devices faster than in the related art in which slave devices response individually. 
         [0055]      FIG. 5  is a block diagram for illustrating a configuration of a slave device according to an embodiment of the present disclosure. 
         [0056]    Referring to  FIG. 5 , a slave device  200  includes a receiving port  210 , a transmitting port  220  and a data processing unit  230 . 
         [0057]    The receiving port  210  receives a control message or group data corresponding to each of a plurality of groups. That is, the receiving port  210  may receive a control message containing group data transmitted from a master device or may receive group data transmitted from another slave device in the same group. 
         [0058]    The transmitting port  220  transmits the control message or the group data to another device. That is, the transmitting port  220  may transmit the control message transmitted from the master device or another group to the next group or may transmit the group data to another slave device in the same group. 
         [0059]    According to an embodiment of the present disclosure, the transmitting port  220  may transmit the control message to the next group before the data processing unit  230  extracts the group data from the control message. According to another embodiment of the present disclosure, the transmitting port  220  may transmit the control message to the next group immediately after the data processing unit  230  extracts the group data from the control message. 
         [0060]    The data processing unit  230  extracts group data from the control message received from the receiving port  210 , extracts input data from the extracted group data, and writes output data onto the control message. The size of the output data may vary depending on a predetermined data size. 
         [0061]      FIG. 6  is a message sequence chart illustrating a data transmission method between a master device and slave devices according to an embodiment of the present disclosure. 
         [0062]    Referring to  FIG. 6 , a master device M generates a control message containing group data corresponding to each of a plurality of groups, and transmits the control message to a particular group among the plurality of groups (step S 610 ). 
         [0063]    A slave device belonging to the particular group transmits the control message to the next group (step S 620 ). 
         [0064]    After transmitting the control message to the next group, the slave device included in the particular group extracts group data from the control message (step S 630 ). 
         [0065]    Subsequently, the slave device included in the particular group extracts/writes data from/to the group data (step S 640 ). In an example of step S 640 , the slave device included in the particular group may extract input data from the group data while writing output data onto the group data simultaneously. The size of the output data may vary depending on a predetermined data size. 
         [0066]    The slave device included in the particular group transmits the group data to the master device M after completing extracting and writing data (step S 650 ). 
         [0067]    The master device M determines whether the slave device included in the particular group is operating normally based on the output data contained in the group data (step S 660 ). 
         [0068]    Thus far, although specific embodiments of the present disclosure have been described, various modifications may be made without departing from the scope of the present disclosure. Accordingly, the scope of the present disclosure is not construed as being limited to the above-described embodiments, but is defined solely by the following claims as well as equivalents thereof. 
         [0069]    Although the present disclosure has been described with reference to the embodiments and the accompanying drawings, it is not limited to the above-described embodiments, but may be variously modified and altered from the above description by those skilled in the art. Therefore, the scope and spirit of the present disclosure should be defined only by the following claims, and all of the equivalences and equivalent modifications of the claims should be intended to fall within the scope and spirit of the present disclosure.