Automatic identification number setting method, automatic identification number setting program, and automatic identification number setting device

By employing half-duplex and serial communication with terminating resistor detection, the method automates ID setting for multiple slave devices, reducing setup time by eliminating sequential master-slave communication.

JP7604071B2Active Publication Date: 2024-12-23NISSHA PRINTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2020134525
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-08-07
Publication Date
2024-12-23
Estimated Expiration
2040-08-07

AI Technical Summary

Technical Problem

Conventional automatic identification number setting methods require time-consuming communication between the master device and slave devices for each ID setting, leading to prolonged setup times.

Method used

A method utilizing half-duplex and serial communication, where slave devices detect a terminating resistor to set their own IDs, and then transmit these IDs to higher-level devices via serial communication, allowing all IDs to be set in a sequential manner without repeated master-slave communication.

Benefits of technology

This approach significantly reduces the time required for ID setting by eliminating the need for individual master-slave communication during the ID assignment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007604071000001
    Figure 0007604071000001
  • Figure 0007604071000002
    Figure 0007604071000002
  • Figure 0007604071000003
    Figure 0007604071000003
Patent Text Reader

Abstract

To provide an automatic identification number setting method, automatic identification number setting program and automatic identification number setting apparatus which can easily shorten the time of ID setting.SOLUTION: An automatic identification number setting method comprises: a step in which a plurality of slave devices detect whether terminal resistances are attached to themselves; a step in which the slave devices detecting the terminal resistances set identification numbers of themselves; and a step in which the slave devices detecting the terminal resistances transmit the identification numbers of themselves to the slave device in a higher order than themselves with serial communication. Up to a master device, each slave device excluding the slave device detecting the terminal resistance automatically sets the identification numbers to all the slave devices by repeating the operations of setting a value obtained by incrementing the identification number received from the slave device in a lower order than itself as the identification number of itself, and transmitting the identification number to the device in a higher order than itself with the serial communication.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an automatic identification number setting method, an automatic identification number setting program, and an automatic identification number setting device. [Background technology]

[0002] There is known a communication system that is configured with one master device and multiple slave devices that are serially connected to the master device so that they can communicate with each other. There is a method for automatically setting an identification number (ID) for each slave device in such a communication system (see, for example, Patent Document 1). This method uses an automatic identification number setting device 70 configured as shown in FIG.

[0003] First, the highest-level slave device (slave device 30 closest to master device 20) disconnects from the slave device 40 that is one level lower than itself, receives ID=1 transmitted from master device 20 via management data line 60, and sets it as its own ID. Next, the highest-level slave device 30 transmits a confirmation signal to master device 20 via management data line 60 indicating that ID=1 has been set. Next, the highest-level slave device 30 connects to the slave device 40 that is one level lower than itself.

[0004] Having received a confirmation signal from the top-level slave device 30, master device 20 transmits ID=2 through management data line 60. The top-level slave device 30 receives ID=2 but ignores it because an ID has already been set for itself. Slave device 40 receives ID=2 and sets it as its own ID. At this time, slave device 40 and slave device 50 are disconnected. After setting the ID, slave device 40 transmits a confirmation signal to master device 20 through management data line 60 indicating that ID=2 has been set. Slave device 40 then connects to slave device 50.

[0005] Upon receiving the confirmation signal from slave device 40, master device 20 transmits ID=3 over management data line 60. Slave devices 30 and 40 ignore this, and slave device 50 receives ID=3 and sets it as its own ID.

[0006] In this way, according to the conventional automatic identification number setting method, an ID can be set to each slave device in order of proximity to the master device. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] Japanese Patent Application Publication No. 8-37538 Summary of the Invention [Problem to be solved by the invention]

[0008] However, in the conventional method of automatically setting an ID number, the master device transmits an ID, and the slave device that receives it transmits a confirmation signal to the master device. In other words, every time an ID is set, communication is required between the master device and the slave device, and there is a problem that it takes a long time to set IDs to multiple slave devices.

[0009] The present invention has been made to solve the above-mentioned problems, and aims to provide an automatic identification number setting method, an automatic identification number setting program, and an automatic identification number setting device that can easily shorten the time required for ID setting. [Means for solving the problem]

[0010] The method for automatically setting an identification number according to the present invention comprises the steps of: A master device and a plurality of slave devices are provided, A plurality of slave devices are serially connected to the master device so as to be capable of communicating with each other; The communication at the connection point is half-duplex communication for exchanging command information from the master device and response information from the slave device, and serial communication for setting the identification number. A step in which a plurality of slave devices detect whether a termination resistor is attached to the slave device; a slave device that detects the termination resistor setting its own identification number; a step in which the slave device that has detected the termination resistor transmits its own identification number to a slave device that is one rank higher than itself by serial communication; Each slave device up to the master device, except for the slave device that detected the termination resistance, sets its own identification number to the incremented value of the identification number received from the slave device one level lower than itself, and repeats the operation of transmitting the incremented value via serial communication to the device one level higher than itself, thereby automatically setting identification numbers in all slave devices.

[0011] In the above embodiment, the half-duplex communication and the serial communication may be wired communication.

[0012] In either of the above two aspects, the serial communication may be UART communication.

[0013] The automatic identification number setting program of the present invention comprises: A program for automatically setting identification numbers to a plurality of slave devices serially connected to a master device so as to be able to communicate with the master device, comprising: A plurality of slave devices are made to function as a means for detecting whether a termination resistor is installed in the slave device itself, The slave device that detects the termination resistor is made to function as a means for setting its own identification number and as a means for transmitting its own identification number to a slave device one rank higher than itself, Each slave device, except for the slave device that detected the termination resistance, is made to function as a means for setting its own identification number to an incremented value of the identification number received from the slave device one level lower than itself, and transmitting the value to the device one level higher than itself.

[0014] The automatic identification number setting device of the present invention comprises: A master device and a plurality of slave devices are provided, A plurality of slave devices are serially connected to the master device so as to be capable of communicating with each other; The communication at the connection point is half-duplex communication for exchanging command information from the master device and response information from the slave device, and serial communication for setting the identification number. A means for detecting whether a termination resistor is installed in each of the slave devices; A means for a slave device that detects a termination resistor to set its own identification number; a means for transmitting its own identification number to a slave device one rank higher than itself by serial communication, Each slave device up to the master device, except for the slave device that detected the termination resistance, sets its own identification number to the incremented value of the identification number received from the slave device one level lower than itself, and repeats the operation of transmitting the incremented value via serial communication to the device one level higher than itself, thereby automatically setting identification numbers in all slave devices. Effect of the Invention

[0015] According to the automatic identification number setting method of the present invention, the time required for ID setting can be easily shortened. Also, by using the automatic identification number setting program and automatic identification number setting device of the present invention, the time required for ID setting can be easily shortened. [Brief description of the drawings]

[0016] [Figure 1] 1 is a configuration diagram showing an embodiment of an automatic identification number setting device of the present invention; [Diagram 2] FIG. 2 is a diagram showing an example of the wiring diagram of FIG. 1. [Diagram 3] FIG. 1 is a diagram showing the pin arrangement of USB-TypeC. [Figure 4] 2 is a flowchart showing an embodiment of an automatic identification number setting method of the present invention. [Diagram 5] FIG. 2 is a block diagram showing an embodiment of a slave device. [Figure 6] FIG. 2 is a block diagram showing an embodiment of a slave device. [Figure 7] FIG. 2 is a block diagram showing the main internal configuration of a slave device. [Figure 8] FIG. 1 is a configuration diagram showing a conventional automatic identification number setting device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0017] Hereinafter, an embodiment of an automatic identification number setting method, an automatic identification number setting program, and an automatic identification number setting device of the present invention will be described with reference to the drawings.

[0018] The automatic identification number setting device 1 includes a master device 2 and a plurality of slave devices 3, 4, and 5 (see FIG. 1). The plurality of slave devices 3, 4, and 5 include at least a control board on which components such as a CPU 8 and a memory 9 are installed, a transmission external connection interface 11, and a reception external connection interface 12 (see FIG. 7). The memory 9 stores at least an automatic identification number setting program 10. A USB-TypeC connector 6 (described later) is connected to the two external connection interfaces 11 and 12 to connect the master device 2 and the plurality of slave devices 3, 4, and 5 in series so that they can communicate with each other. That is, the reception external connection interface 12 of the master device 2 is connected to the transmission external connection interface 11 of the slave device 3. Similarly, the reception external connection interface 12 of the slave device 3 is connected to the transmission external connection interface 11 of the slave device 4. The lowest-order slave device 5 is not connected to any slave device lower than itself, and a termination resistor 7 is attached to the reception external connection interface 12. In other words, the termination resistor 7 is externally connected.

[0019] The devices can be connected to each other using, for example, a connector 6 with USB-Type C on both ends. Communication at the connection point is half-duplex communication and serial communication. In this embodiment, the half-duplex communication is communication by RS485, and the serial communication is UART communication (asynchronous serial communication). Half-duplex communication by RS485 and UART communication have different roles. Half-duplex communication by RS485 is used to exchange command information from the master device 2 and response information from the slave devices 3, 4, 5. UART communication is used to set identification numbers (IDs) to the multiple slave devices 3, 4, 5. After ID setting has been completed for the multiple slave devices 3, 4, 5, half-duplex communication by RS485 is performed. The wiring diagram of FIG. 1 is shown in FIG. 2. H and L indicate the lines for half-duplex communication by RS485, and T x ,R x indicates the UART communication line, and P indicates the power supply (5V) and GND.

[0020] Figure 3 shows the pin arrangement (female) of the USB-TypeC that master device 2 and slave devices 3, 4, and 5 have. For half-duplex communication using RS485, the D+ / D- pair wires A6, A7, B6, and B7 (center of the figure) are used. D+ is HIGH and D- is LOW (corresponding to H and L in Figure 2). For UART communication, the CC1 pin of A5 or the CC2 pin of B5 is used (T in Figure 2). x ,R x (This corresponds to P in Figure 2.) The Vbus pins A4, A9, B4, and B9 are used for power, and the GND pins A1, A12, B1, and B12 (at both ends of the diagram) are used for ground (this corresponds to P in Figure 2). A termination resistor 7 is attached to the lowest-order slave device 5, and the presence or absence of termination resistor 7 is detected using the SBU1 pin of A8 and the SBU2 pin of B8. In this way, by using only one USB-TypeC connector 6, wiring as shown in FIG. 2 can be easily achieved.

[0021] Although synchronous serial communication (SPI communication, I2C communication) can also be used as serial communication, synchronous serial communication requires a clock signal line for synchronization, which increases the number of wires. On the other hand, UART communication is asynchronous and can minimize the number of wires required, so it is preferable to use UART communication.

[0022] The automatic identification number setting method will now be described with reference to a flow chart showing steps performed by each of the slave devices 3, 4, and 5.

[0023] First, when the automatic identification number setting device 1 is turned on, the slave devices 3, 4, and 5 detect whether or not a termination resistor 7 is attached thereto (S1). Next, the slave device 5, among the slave devices 3, 4, and 5, that detects that a termination resistor 7 is attached thereto (S1: YES) sets its own ID=1 (S2). Next, the slave device 5 transmits its own ID=1 to the slave device 4, which is one level higher than itself, by UART communication (S3). The detection means in S1 can be the CPU 8 (see FIG. 7) and the SBU1 pin and the SBU2 pin (see FIG. 3) provided in the slave devices 3, 4, and 5. The setting means in S2 can be the CPU 8 and the memory 9 of the slave device 5. The transmission means in S3 can be the CPU 8 and the connector 6 (CC1 pin or CC2 pin) provided in the slave device 5 (see FIG. 1 and FIG. 3).

[0024] The slave device 4 that has not detected that the termination resistor 7 is attached (S1: NO) detects whether it has received ID value data from the lowest-order slave device 5 (S4). The detection means can be the CPU 8 provided in the slave device 4.

[0025] If ID value data is not received from the lowest-ranked slave device 5 within a certain period of time (S4: NO), the slave device 4 will have an ID error (S8). In other words, it is possible to detect an error in the slave device 4. If ID value data is received from the lowest-ranked slave device 5 (S4: YES), the slave device 4 increments the received ID value (S5). As the ID value received from the slave device 5 was 1, the incremented value becomes 2. Next, the slave device 4 sets the incremented value = 2 as its own ID (S6). Next, the slave device 4 transmits its own ID = 2 to the slave device 3, which is one level higher than itself, via UART communication (S7).

[0026] The slave device 3 is the highest-ranked slave device closest to the master device 2. If the slave device 3 does not receive ID value data within a certain time (S4: NO), an ID error occurs (S8). In other words, the slave device 3 can detect an error. If the slave device 3 receives ID value data from the slave device 4 (S4: YES), the slave device 3 increments the received ID value (S5). Since the ID value received from the slave device 4 is 2, the incremented value becomes 3. Next, the slave device 3 sets the incremented value = 3 as its own ID (S6). In other words, at this point, the lowest-ranked slave device 5 has ID = 1, the next higher slave device 4 has ID = 2, and the highest-ranked slave device 3 has ID = 3. Next, the slave device 3 transmits its own ID = 3 to the master device 2, which is the device one level higher than itself, by UART communication (S7). The master device 2, which receives the ID value = 3, recognizes that there are three slave devices connected to it.

[0027] The increment in S5 and the ID setting in S6 are performed by the CPU 8 and memory 9 included in each of the slave devices 3 and 4 (see FIG. 7). The transmission in S7 is performed by the CPU 8 and connector 6 (CC1 pin or CC2 pin) included in the slave devices 3 and 4.

[0028] In the above manner, identification numbers can be automatically set for all of the slave devices 3, 4, 5 connected in series to the master device 2 so as to be able to communicate with each other. According to the above-mentioned automatic identification number setting method, IDs 1, 2, 3 are automatically set in order from the slave device 5 that is the furthest from the master device 2. In the conventional method, every time an ID is set, communication occurs between the master device 20 and the slave devices 30, 40, 50, and it takes time to set the ID. However, according to the above-mentioned automatic identification number setting method, when the power is turned on, IDs are set in order from the lowest-ranked slave device 5, so communication from the master device 2 to the slave devices 3, 4, 5 for setting IDs does not occur one by one. In other words, the time required for ID setting can be easily shortened.

[0029] Since the terminator 7 is external, if you forget to attach it to the lowest-level slave device, the ID setting will not start and the ID value data will not be sent from the highest-level slave device to master device 2 within the specified time. Master device 2 can detect this and display an error message.

[0030] Four or more slave devices may be connected. Even in this case, the lowest-ranked slave device executes steps S1 to S3 shown in Fig. 4, and the other slave devices repeatedly execute steps S1 and S4 to S7 shown in Fig. 4 up to the master device 2. In this way, identification numbers can be automatically set to all slave devices.

[0031] Next, the automatic identification number setting program will be described (see FIGS. 5 to 7). The automatic identification number setting program 10 causes the slave devices 3, 4, 5 to function as means F1 for detecting whether or not a termination resistor 7 is attached thereto (see FIG. 5). The automatic identification number setting program 10 then causes the slave device 5 that has detected the termination resistor 7 to function as means F2 for setting its own identification number and means F3 for transmitting its own identification number to the slave device 4 that is one level higher than itself.

[0032] Next, the automatic identification number setting program 10 causes the slave device 4 to function as means F4 for receiving the identification number transmitted by the slave device 5 (see FIG. 6). Next, the automatic identification number setting program 10 causes the slave device 4 to function as means F5 for incrementing the identification number received from the slave device 5, means F6 for setting the incremented value as its own identification number, and means F7 for transmitting its own identification number to the slave device 3 that is one level higher than itself.

[0033] Next, the automatic identification number setting program 10 causes the slave device 3 to function as means F4 for receiving the identification number transmitted by the slave device 4 (see FIG. 6). Next, the automatic identification number setting program 10 causes the slave device 3 to function as means F5 for incrementing the identification number received from the slave device 4, means F6 for setting the incremented value as its own identification number, and means F7 for transmitting its own identification number to the master device 2 that is one level higher than itself.

[0034] The automatic identification number setting program 10 prescribes that the CPU 8 controls the following process. First, the CPU 8 detects whether a termination resistor 7 is attached to its own (slave device 3, 4, 5) external connection interface for receiving. Next, the CPU 8 of the slave device 5 that detects the termination resistor 7 sets its own identification number (ID=1). At this time, ID=1 is stored in the memory 9. Next, the CPU 8 of the slave device 5 transmits its own ID=1 to the slave device 4 that is one level higher than itself. When transmitting, the USB-TypeC connector 6 connected to the external connection interface for transmitting 11 is used.

[0035] Of the slave devices 3 and 4 that did not detect the termination resistor 7, the CPU 8 of the slave device 4 that receives ID value data from the slave device that is one level lower than itself increments the received ID=1 (ID=2). Next, the CPU 8 sets the incremented ID=2 as its own identification number. ID=2 is stored in the memory 9. Next, the CPU 8 of the slave device 4 transmits its own ID=2 to the slave device 3 that is one level higher than itself.

[0036] The CPU 8 of the slave device 3, which has received the ID value data from the slave device 4, increments the received ID=2 (ID=3). Next, the CPU 8 sets the incremented ID=3 as its own identification number. ID=3 is stored in the memory 9. Next, the CPU 8 of the slave device 3 transmits its own ID=3 to the master device 2, which is one level higher than itself.

[0037] By defining the automatic identification number setting program as described above and having a plurality of slave devices 3, 4, 5 function using this program, the time required for ID setting can be easily reduced. [Explanation of symbols]

[0038] 1: Automatic identification number setting device 2: Master device 3,4,5: Slave device 6: Connector 7: Termination resistor 8: CPU 9: Memory 10: Automatic identification number setting program 11: External connection interface for sending 12: External connection interface for receiving 20: Master device 30, 40, 50: Slave device 60: Management data line 70: Automatic identification number setting device

Claims

1. A master device and a plurality of slave devices connected in series to the master device, a step of each of the slave devices detecting whether a termination resistor is attached thereto; a step of the slave device detecting the termination resistor setting its own identification number; the slave device that has detected the termination resistor transmits its own identification number to a slave device one rank higher than itself by UART communication, which is serial communication for setting an identification number; each slave device other than the slave device which detected the termination resistance sets its own identification number to a value obtained by incrementing the identification number received from the slave device which is one level lower than itself, and transmits its own identification number to the slave device which is one level higher than itself by the UART communication; the step of transmitting the own identification number is repeated until identification numbers are set in all slave devices; a step of transmitting its own identification number to the master device via the UART communication by a slave device directly connected to the master device after completing the step of repeating the step until an identification number is set to all of the slave devices.

2. A method for automatically setting an identification number as described in claim 1, wherein the serial communication is wired communication.

Citation Information

Patent Citations

  • Method and device for automatically assigning id to network equipment

    JP1996037538A

  • Power supply system and identification information setting method for power supply system

    WO2012120745A1