Serial data communication device

文档序号:157483 发布日期:2021-10-26 浏览:28次 中文

阅读说明:本技术 串行数据通信装置 (Serial data communication device ) 是由 佐藤健司 于 2020-02-26 设计创作,主要内容包括:本发明,使接收侧通信装置适当地检测出起始位。一种串行通信单元(100),通过高电平信号及低电平信号的组合来发送串行数据,所述串行通信单元(100)包括:串行通信部(111),在串行数据的开头设置起始位,并且在紧接于所述起始位之前,在规定的持续时间内发送高电平信号;以及持续时间设定部(113),设定所述持续时间。(The invention enables a receiving side communication device to properly detect a start bit. A serial communication unit (100) that transmits serial data by a combination of a high-level signal and a low-level signal, the serial communication unit (100) comprising: a serial communication unit (111) that sets a start bit at the head of serial data and transmits a high-level signal for a predetermined duration immediately before the start bit; and a duration setting unit (113) that sets the duration.)

1. A serial data communication apparatus for transmitting serial data by a combination of a high level signal and a low level signal, comprising:

a signal transmitting unit that sets a start bit at the head of the serial data and transmits a high-level signal for a predetermined duration immediately before the start bit; and

and a duration setting unit that sets the duration.

2. The serial data communication device according to claim 1, further comprising a setting receiving portion that receives a setting value of the duration from an external device,

the duration setting unit sets the duration using the setting value received by the setting receiving unit.

3. The serial data communication device according to claim 1, further comprising a communication establishment determination section that determines whether communication with a communication device of a communication destination is established,

the duration setting unit gradually increases the duration, and determines the duration at the time when the communication establishment determination unit determines that communication is established.

4. The serial data communication device according to claim 3, further comprising a setting receiving portion that receives a setting value of the duration from an external device,

the duration setting unit switches, in response to an instruction from the external device, (1) the duration to be set using the setting value received by the setting reception unit, or (2) the duration to be gradually increased and determined at the time when the communication establishment determination unit determines that communication is established.

5. A serial data communication method implemented by a serial data communication apparatus that transmits serial data by a combination of a high-level signal and a low-level signal, the serial data communication method comprising:

a signal transmission step of setting a start bit at the head of the serial data and transmitting a high level signal for a predetermined duration immediately before the start bit; and

and a duration setting step of setting the duration.

Technical Field

The present invention relates to a serial data communication apparatus that performs serial data communication with a communication apparatus of a communication destination.

Background

Conventionally, when serial data communication (serial data communication) is performed between devices, when the serial data communication is to be started, a signal with a low potential called a start bit (start bit) is first transmitted by a transmission side, and the signal is detected by a reception side, thereby starting the serial data communication. On the receiving side, a falling edge of the potential of the signal of the reception data is detected, and reception of the start bit is recognized in association with the detection of the falling edge (see, for example, patent document 1).

Documents of the prior art

Patent document

Patent document 1: japanese laid-open patent publication No. 2002-252660

Disclosure of Invention

Problems to be solved by the invention

However, when the potential of a signal immediately before the start bit output from the transmission side is lower than a predetermined level and a fail-safe (fail-safe) circuit is not built in the device on the reception side, the reception of the start bit may not be recognized and serial data communication may not be started.

An embodiment of the present invention has been made in view of the above circumstances, and an object thereof is to realize a technique that enables a receiving-side communication device to appropriately detect a start bit.

Means for solving the problems

In order to solve the above problem, a serial data communication device according to an embodiment of the present invention is a serial data communication device for transmitting serial data by a combination of a high level signal and a low level signal, including: a signal transmitting unit that sets a start bit at the head of the serial data and transmits a high-level signal for a predetermined duration immediately before the start bit; and a duration setting unit that sets the duration.

In order to solve the above-described problems, a serial data communication method according to an embodiment of the present invention is a serial data communication method implemented by a serial data communication apparatus that transmits serial data by a combination of a high-level signal and a low-level signal, the serial data communication method including: a signal transmission step of setting a start bit at the head of the serial data and transmitting a high level signal for a predetermined duration immediately before the start bit; and a duration setting step of setting the duration.

ADVANTAGEOUS EFFECTS OF INVENTION

According to an embodiment of the present invention, the receiving-side communication apparatus can appropriately detect the start bit.

Drawings

Fig. 1 is a block diagram showing a main part configuration of a serial data communication device according to embodiment 1 of the present invention.

Fig. 2 is a diagram showing an example of a signal transmitted from the serial data communication apparatus.

Fig. 3 is a diagram showing an example of a setting edit window of the setting device, where (a) is a diagram showing an edit window when manual setting is selected, and (b) is a diagram showing an edit window when auto-tuning (auto-tuning) is selected.

Fig. 4 is a flowchart showing a processing flow of the duration setting unit.

Detailed Description

Hereinafter, an embodiment (hereinafter, also referred to as "the present embodiment") according to one aspect of the present invention will be described with reference to the drawings.

Application example § 1

An example of a scenario to which the present invention is applied will be described with reference to fig. 1. Fig. 1 is a diagram showing an outline of a system environment in which a serial communication unit 100 (serial data communication apparatus) according to the present embodiment is used.

The serial communication unit 100 is connected to a serial communication device 200 (communication destination communication apparatus) and a Programmable Logic Controller (PLC) 400. The PLC400 performs transmission of transmission data to the serial communication apparatus 200 and reception of reception data from the serial communication apparatus 200 via the serial communication unit 100.

The PLC400 is a device that collectively controls devices to be controlled, and is connectable to a plurality of devices to be controlled including the serial communication device 200 via the serial communication unit 100.

The serial communication unit 100 starts serial data communication for transmitting a control signal from the PLC400 to the serial communication apparatus 200. The serial communication unit 100 sets a start bit at the beginning of serial data and detects the start bit with the serial communication device 200, thereby starting serial data communication. In addition, the serial communication unit 100 makes the start bit appropriately detectable by the serial communication device 200 by transmitting a high level signal for a prescribed duration immediately before the start bit.

In this manner, the serial communication unit 100 performs serial data transmission and reception between the serial communication apparatus 200 and the PLC400 by setting a start bit at the head of the serial data and transmitting a high-level signal for a prescribed duration immediately before the start bit to appropriately start communication with the serial communication apparatus 200.

Construction example 2

[ concerning the system environment ]

Fig. 1 is a diagram showing an outline of a system environment in which a serial communication unit 100 is used. As shown in fig. 1, the serial communication unit 100 is connected to the serial communication device 200, the setting device 300, and the PLC 400.

The PLC400 is an industrial controller and controls a device to be controlled. The PLC400 is connected to a plurality of control target devices including the serial communication device 200 via the serial communication unit 100. The Control unit (central processing unit (CPU)) of the PLC400 may be connected to the serial communication unit 100 via a bus, or may be connected to the serial communication unit 100 via a communication coupler by using Ethernet for Control Automation Technology (EtherCAT) (registered trademark), Ethernet/industrial protocol (Ethernet/ip) (registered trademark), device network (DeviceNet) (registered trademark), component network (CompoNet) (registered trademark), or the like.

The setting device 300 is a device that accepts a setting instruction corresponding to a user operation for various settings of the serial communication unit 100, the serial communication apparatus 200, and the PLC 400. The setting device 300 may be directly connected to the serial communication unit 100 via a Universal Serial Bus (USB) cable 3, or may be connected to the PLC400 via a USB connection, and transmit a setting instruction corresponding to a user operation to the serial communication unit 100 via the PLC. The PLC400 may transmit the setting information corresponding to the setting instruction received from the setting device 300 to the serial communication unit 100, or may generate the setting information by executing a program by a calculation processing unit of its own device and transmit the setting information to the serial communication unit 100.

The setting device 300 displays a setting value editing screen (see fig. 3) and accepts a user operation on the setting value editing screen. The setting device 300 transmits setting information corresponding to a user operation to the serial communication unit 100.

The serial communication apparatus 200 is used at a manufacturing site, such as a manufacturing machine or a cooling device, and operates according to a control signal from the PLC400 received via the serial communication unit 100. In addition, although RS-422/485 is given as an example of a serial communication method effective in the present invention, serial communication section 100 may be adapted to the RS-232C communication method.

[ Structure of Serial communication Unit 100 ]

As shown in fig. 1, the serial communication unit 100 includes a control section 110 and a storage section 120.

The control unit 110 is a calculation device having a function of collectively controlling the respective units of the serial communication unit 100. The control unit 110 can control each unit of the serial communication unit 100 by, for example, one or more processors (e.g., CPUs) executing a program stored in one or more memories (e.g., Random Access Memory (RAM), Read Only Memory (ROM), and the like).

The storage unit 120 stores various software executed by the control unit 110, and various setting information of the serial communication unit 100 and devices connected to the serial communication unit 100.

[ configuration of control unit 110 ]

As shown in fig. 1, the control unit 110 includes a serial communication unit 111 (signal transmission unit), a communication establishment determination unit 112, a duration setting unit 113, a USB communication unit 114 (setting reception unit), and an upper communication unit 115.

The serial communication unit 111 functions as a signal transmission unit that transmits serial data to the serial communication device 200. The serial communication unit 111 functions as a signal receiving unit that receives a response from the serial communication device 200.

The serial communication unit 111 transmits serial data to the serial communication device 200 by combining a high-level signal, which is a signal having a predetermined high level of potential, and a low-level signal, which is a signal having a predetermined low level of potential.

In addition, as will be described in detail later, the serial communication section 111 sets a start bit at the head of serial data transmitted to the serial communication device 200 when communication with the serial communication device 200 is started. Further, immediately before the start bit, the serial communication section 111 transmits a high-level signal to the serial communication device 200 for a predetermined duration.

The serial communication device 200 of the communication destination sometimes becomes a specification that cannot detect the start bit when the high level signal is not set before the start bit or when the duration of the high level signal is short. In this case, according to the above configuration, the serial communication device 200 on the receiving side can detect the start bit by appropriately setting the duration for which the high-level signal is continuously transmitted.

The communication establishment determination unit 112 determines whether or not communication with the serial communication device 200 of the communication destination is established. The communication establishment determination section 112 determines whether or not communication with the serial communication device 200 is established based on whether or not the serial communication section 111 receives a response from the serial communication device 200, the response indicating that serial data transmitted from the serial communication section 111 to the serial communication device 200 has been received by the serial communication device 200.

The duration setting portion 113 sets the duration for which the serial communication portion 111 transmits the high-level signal to the serial communication device 200 immediately before the start bit.

The USB communication unit 114 includes a USB port, and communicates with the setting device 300 via the USB cable 3 connected to the USB port. The USB communication section 114 receives a setting value corresponding to a user input, which is a setting value of the duration of the high level signal immediately before the start bit transmitted to the serial communication apparatus 200 by the serial communication section 111, from the setting device 300.

The duration setting unit 113 may set the duration of the high level signal immediately before the start bit using the setting value received from the setting device 300 via the USB communication unit 114.

The upper communication unit 115 is connected to the PLC400 by a bus connection or via ethernet (registered trademark) or EtherCAT of a communication coupler, and performs data transmission and reception with the PLC 400.

[ concerning data communication using the serial communication unit 100 ]

Fig. 2 is a diagram showing an example of serial data transmitted from the serial communication unit 100 to the serial communication device 200.

Upon receiving the transmission data from the PLC400, the control unit 110 of the serial communication unit 100 sets the port of the serial communication unit 111 to output, and starts the transmission process. After the transmission process is started, the control unit 110 sets a waiting time for waiting for the start of transmission of serial data for the entire predetermined duration set by the duration setting unit 113. The serial communication unit 111 continuously transmits the high-level signal to the serial communication device 200 for a standby time of a predetermined duration.

After the end of the standby time detected by the timer to have a predetermined duration, the control unit 110 starts transmission of serial data in which a start bit including a low-level signal is set at the head. The control section 110 transmits serial data to the serial communication device 200 by a combination of the high-level signal and the low-level signal.

The control unit 110 sets a stop bit at the end of the serial data by the function of the serial communication unit 111, and ends the transmission of the serial data.

[ setting on duration ]

Fig. 3 is a diagram showing an example of a setting value editing screen of the setting device 300. As shown in fig. 3, the user can select whether the user manually sets the setting value for the duration of transmission of the high level signal immediately before the start bit or automatically sets (auto-tunes) the setting value through the serial communication unit 100 by operating the setting value editing screen of the setting device 300.

Fig. 3 (a) shows an example of a case where the user selects the setting value for the manual setting duration by operating the setting value editing screen of the setting device 300. When the user manually sets the duration, the user can change the set value of the Hi time (the transmission duration of the high-level signal) before the start bit in the set value editing screen from 0 μ s, which is an initial value, to an arbitrary value after selecting "manual setting".

The setting device 300 transmits the setting value input by the user to the serial communication unit 100. The control unit 110 of the serial communication unit 100 receives the set value of the duration from the setting device 300 via the USB communication unit 114, and then sets the duration using the set value received via the USB communication unit 114 in accordance with an instruction from the setting device 300 by using the function of the duration setting unit 113.

Note that a table of combinations of models and durations of the serial communication device 200 is prepared in the setting device 300, and the user may set the corresponding durations by selecting the model of the serial communication device 200.

Fig. 3 (b) shows an example of a case where the user selects the auto-tuning duration by operating the setting value editing screen of the setting device 300. In the case where the user is to set the duration by auto-tuning, the user selects "auto-tuning". Thus, the setting value change window (edit box) in the Hi time before the start bit in the setting value edit screen displays gray (gray out) and does not accept the operation.

The setting means 300 sends an indication of the auto-tuning duration to the serial communication unit 100. The control unit 110 of the serial communication unit 100 receives the auto-tuning duration instruction from the setting device 300 via the USB communication unit 114, and then sets the duration according to whether or not the communication with the serial communication device 200 is established by the function of the duration setting unit 113.

[ procedure for automatic tuning ]

Fig. 4 is a flowchart showing the flow of the duration setting process by the auto-tuning performed by the control unit 110.

After starting the serial data transmission process to the serial communication device 200, the control unit 110 sets the port of the serial communication unit 111 to output, and waits for the start of serial data transmission for the standby time of the initial value (step S1).

After waiting for the standby time of the initial value, the control unit 110 starts serial data transmission to the serial communication device 200 (step S2).

The control unit 110 determines whether or not communication with the serial communication device 200 is established by the function of the communication establishment determination unit 112 (step S3). The communication establishment determination unit 112 determines whether or not communication with the serial communication device 200 is established based on whether or not the serial communication unit 111 receives a response from the serial communication device 200, which is intended to receive serial data. When the communication establishment determination unit 112 determines that the communication with the serial communication device 200 is established (YES in step S3), the control unit 110 proceeds to step S5. If the communication establishment determination unit 112 determines that the communication with the serial communication device 200 is not established (NO in step S3), the control unit 110 proceeds to step S4.

The controller 110 increases the set value of the standby time by a predetermined amount by the function of the duration setting unit 113, and returns to step S2 (step S4).

The control unit 110 determines the set value of the standby time by the function of the duration setting unit 113, and continues the communication with the serial communication device 200 (step S5).

As described above, when the communication with the serial communication device 200 is not established, the control unit 110 gradually increases the duration for which the high-level signal is continuously transmitted during the standby time by the function of the duration setting unit 113. Then, at the time when the communication establishment determination unit 112 determines that the communication is established, the duration setting unit 113 determines the duration for which the high-level signal is continuously transmitted.

Thus, the duration for which the high-level signal continues to be transmitted before the start bit does not need to be set by the user, and the duration can be automatically set.

In response to an instruction from the setting device 300, the duration setting unit 113 switches to (1) setting the duration using the setting value received by the USB communication unit 114 or (2) gradually increasing the duration and determining the duration at the time when the communication establishment determination unit 112 determines that communication is established.

Thus, the method of setting the duration for which the high-level signal is continuously transmitted before the start bit can be appropriately switched according to the setting or use state of the serial communication device 200 of the communication destination. This enables the serial communication device 200 on the receiving side to appropriately detect the start bit.

Further, the duration for continuing the transmission of the high level signal can be set from the external setting device 300, and the duration can be automatically set without setting the duration by the user.

[ implementation with software ]

The control block (particularly, the communication establishment determination unit 112 and the duration setting unit 113) of the serial communication unit 100 may be realized by a logic circuit (hardware) formed in an integrated circuit (ic) chip or the like, or may be realized by software.

In the latter case, the serial communication unit 100 includes a computer that executes commands of a program as software that realizes the respective functions. The computer includes, for example, one or more processors, and includes a recording medium readable by the computer and storing the program. Further, in the computer, the processor reads the program from the recording medium and executes the program, thereby achieving the object of the present invention. As the processor, for example, a CPU (central processing unit) can be used. As the recording medium, a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, or the like can be used in addition to a "non-transitory tangible medium", such as a ROM (read only memory), or the like. In addition, a RAM (random access memory) or the like for expanding the program may be further included. The program may be supplied to the computer via an arbitrary transmission medium (a communication network, a broadcast wave, or the like) through which the program can be transmitted. In addition, an embodiment of the present invention can be realized in the form of a data signal embedded in a carrier wave, the data signal embodying the program by electronic transmission.

(conclusion)

As described above, the serial data communication device according to an embodiment of the present invention is a serial data communication device for transmitting serial data by a combination of a high-level signal and a low-level signal, and includes: a signal transmitting unit that sets a start bit at the head of the serial data and transmits a high-level signal for a predetermined duration immediately before the start bit; and a duration setting unit that sets the duration.

In order to solve the above-described problems, a serial data communication method according to an embodiment of the present invention is a serial data communication method implemented by a serial data communication apparatus that transmits serial data by a combination of a high-level signal and a low-level signal, the serial data communication method including: a signal transmission step of setting a start bit at the head of the serial data and transmitting a high level signal for a predetermined duration immediately before the start bit; and a duration setting step of setting the duration.

According to the above configuration, even when the external device of the communication destination is set to a specification in which the start bit cannot be detected when the high-level signal is not provided before the start bit or when the duration of the high-level signal is short, the reception-side communication device can detect the start bit by appropriately setting the duration.

In the above configuration, the serial data communication device according to an embodiment of the present invention further includes a setting receiver that receives the setting value of the duration from an external device, and the duration setting unit sets the duration using the setting value received by the setting receiver.

According to the above configuration, the duration for continuously transmitting the high-level signal before the start bit can be set from the external device.

In the above configuration, the serial data communication device according to an embodiment of the present invention further includes a communication establishment determination unit that determines whether or not communication with a communication device of a communication destination is established, wherein the duration setting unit gradually increases the duration, and determines the duration at a time when the communication establishment determination unit determines that communication is established.

According to the above configuration, the duration for continuing to transmit the high-level signal before the start bit does not need to be set by the user, and the duration can be automatically set.

In the above configuration, the serial data communication device according to an embodiment of the present invention may further include a setting receiver that receives a setting value of the duration from an external device, and the duration setting unit may switch, in response to an instruction from the external device, (1) to set the duration using the setting value received by the setting receiver, or (2) to gradually increase the duration and determine the duration at a time when the communication establishment determination unit determines that communication is established.

According to the above configuration, the method of setting the duration for continuously transmitting the high-level signal before the start bit can be switched as appropriate according to the usage state of the communication device or system of the communication destination.

The present invention is not limited to the above embodiments, and various modifications can be made within the scope shown in the claims, and embodiments obtained by appropriately combining technical means disclosed in different embodiments are also included in the technical scope of the present invention.

Description of the symbols

100: serial communication unit (serial data communication device)

110: control unit

111: serial communication part (Signal transmission part)

112: communication establishment determination unit

113: duration setting unit

114: USB communication part (setting receiving part)

200: serial communication equipment (communication device of communication destination)

300: setting device (external device)

400:PLC

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用管理器设备初始化数据存储设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!