CN108400801B - Device for carrying data communication by using sensor output line and setting method thereof - Google Patents
Device for carrying data communication by using sensor output line and setting method thereof Download PDFInfo
- Publication number
- CN108400801B CN108400801B CN201810372228.1A CN201810372228A CN108400801B CN 108400801 B CN108400801 B CN 108400801B CN 201810372228 A CN201810372228 A CN 201810372228A CN 108400801 B CN108400801 B CN 108400801B
- Authority
- CN
- China
- Prior art keywords
- mpu
- triode
- sensor
- setting unit
- resistor
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000004891 communication Methods 0.000 title claims abstract description 41
- 238000005070 sampling Methods 0.000 claims abstract description 19
- 230000000087 stabilizing effect Effects 0.000 claims abstract description 11
- 230000004044 response Effects 0.000 claims description 25
- 230000005540 biological transmission Effects 0.000 claims description 23
- 238000012790 confirmation Methods 0.000 claims description 14
- 230000006641 stabilisation Effects 0.000 claims description 6
- 238000011105 stabilization Methods 0.000 claims description 6
- 238000012546 transfer Methods 0.000 claims description 6
- 230000009471 action Effects 0.000 claims description 5
- 230000008859 change Effects 0.000 claims description 4
- 238000012795 verification Methods 0.000 claims description 3
- 230000007246 mechanism Effects 0.000 abstract description 3
- 230000015654 memory Effects 0.000 description 15
- 238000001514 detection method Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 238000009434 installation Methods 0.000 description 6
- 230000035945 sensitivity Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 230000005291 magnetic effect Effects 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 238000013459 approach Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000007789 sealing Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000003936 working memory Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B3/00—Line transmission systems
- H04B3/02—Details
- H04B3/04—Control of transmission; Equalising
-
- G—PHYSICS
- G08—SIGNALLING
- G08C—TRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
- G08C19/00—Electric signal transmission systems
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K17/00—Electronic switching or gating, i.e. not by contact-making and –breaking
- H03K17/51—Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the components used
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K17/00—Electronic switching or gating, i.e. not by contact-making and –breaking
- H03K17/51—Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the components used
- H03K2017/515—Mechanical switches; Electronic switches controlling mechanical switches, e.g. relais
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
The application provides a device for carrying data communication by using a sensor output line and a setting method thereof, a sensor unit and a setting unit, wherein the sensor unit comprises: the sensor MPU, resistance R1, resistance R2, NPN triode Tr1, NPN triode Tr2, voltage stabilizing circuit Reg and sampling resistor Rsense, the setting unit includes: the application can directly drive the actuating mechanism such as a relay and the like, can also carry out simple data exchange with an upper computer, and does not increase the cost.
Description
Technical Field
The application relates to a device for carrying data communication by using a sensor output line and a setting method thereof.
Background
When the output line of the conventional sensor is used as an electronic switch, the state detected by the sensor is transmitted to a controller, and the load capacity of the electronic switch is generally in the range of 100-200 mA and 10-30 vDC, and the electronic switch is used for driving an actuating mechanism such as an electromagnetic valve, a miniature relay and the like. But this output line can no longer exchange data with the upper controller.
When the output line of the existing sensor is used as a bus mode, such as I/O link, the output line and the upper controller transmit the detection state of the sensor in a data interaction mode. However, the output line cannot directly drive the actuator.
Disclosure of Invention
An object of the present application is to provide a device for carrying data communication by using a sensor output line and a setting method thereof, which can realize that the output line can directly drive an actuator such as a relay and can exchange data with an upper computer without increasing the cost.
According to one aspect of the present application, there is provided an apparatus for carrying data communication using a sensor output line, the apparatus comprising: a sensor unit and a setting unit, wherein,
the sensor unit includes: the sensor MPU, the resistor R1, the resistor R2, the triode Tr1 of NPN, the triode Tr2 of NPN, the voltage stabilizing circuit Reg and the sampling resistor Rsense, wherein one end of the voltage stabilizing circuit Reg is connected with a 12V power supply, and the other end of the voltage stabilizing circuit Reg outputs a 5V power supply; the port P1.0 of the sensor MPU is connected with one end of the R2, and the port P2.0 of the sensor MPU is connected with the collector of the Tr2 and one end of the R1; one end of a resistor R1 is connected with a 5V power supply, and the other end of the resistor R1 is connected with a collector of a triode Tr2 and a port P2.0 of a sensor MPU; one end of the electric group R2 is connected with a port P1.0 of the sensor MPU, and the other end of the electric group R2 is connected with the base electrode of the triode Tr 1; the base electrode of the triode Tr1 is connected with one end of a resistor R2, and the emitter electrode of the triode Tr1 is connected with the base electrode of the triode Tr2 and one end of a sampling resistor Rsense; the collector of the triode Tr2 is connected with one end of the ports P2.0 and R1 of the sensor MPU, the base of the triode Tr2 is connected with the emitter of the Tr1 and one end of the sampling resistor Rsense, and the emitter of the triode Tr2 is grounded; one end of the sampling resistor Rsense is connected with the emitter of the Tr1 and the base of the Tr2, and the other end of the sampling resistor Rsense is grounded;
the setting unit includes: the device comprises a setting unit MPU, a PNP triode Tr3, an NPN triode Tr4, a resistor R3, a resistor R4, a resistor R5 and a setting panel, wherein the setting panel is connected with the setting unit MPU, a port P3.0 of the setting unit MPU is connected with one end of the resistor R3, and a port P3.1 of the setting unit MPU is connected with one end of the resistor R4 and a collector of the triode Tr 4; the collector of the triode Tr3 is connected with a 12V power supply, the base of the triode Tr3 is connected with one end of a resistor R3, the emitter of the triode Tr3 is connected with one end of R5, and the emitter of the triode Tr3 is connected with the collector of the triode Tr1 to serve as a signal input output line (SIO); the collector of the NPN triode Tr4 is connected with a port P3.1 of the setting unit MPU and one end of a resistor R4, the base of the triode Tr4 is connected with one end of a resistor R5, and the emitter of the triode Tr4 is grounded; one end of a resistor R3 is connected with a port P3.0 of the setting unit MPU, and the other end of the resistor R3 is connected with a base electrode of the Tr 3; one end of the resistor R4 is connected with a 12V power supply, and the other end of the resistor R4 is connected with a port P3.1 of the setting unit MPU and a collector electrode of the triode Tr 4; one end of the resistor R5 is connected with the base electrode of the triode Tr4, and the other end is connected with the collector electrode of the triode Tr1 and the emitter electrode of the triode Tr3
Further, in the above apparatus, the time of one data transmission of the apparatus sequentially includes a working period T1 and a rest period T2, where the working period T1 sequentially includes:
a signal stabilization period T10, which is used for the setting unit MPU to change from other states to a data exchange state after the sensor MPU sends out a signal and wait for the signal;
a confirmation period T11 for confirming the confirmation signal by the sensor MPU after the confirmation signal is sent by the setting unit MPU;
the response and data transfer period T12 sequentially includes a response bit of the sensor MPU, a start bit, a data bit, and a check bit of the data sent by the setting unit MPU.
And the data return period T13 is used for returning data to the setting unit MPU according to the data sent by the setting unit MPU by the sensor MPU.
Further, in the above apparatus, the signal stabilizing period T10 sequentially includes:
the port P1.0 changes from low to high;
the transistor Tr1 is turned on;
the transistor Tr4 is turned off;
the port P3.1 goes from low to high.
Further, in the above apparatus, the confirmation period T11 sequentially includes:
the port P3.0 changes from low to high;
the transistor Tr3 is turned off;
the overcurrent disappears;
the transistor Tr2 is turned off;
the port P2.0 changes from low to high.
Further, in the above apparatus, the reply and data transfer period T12 sequentially includes:
the port P1.0 changes from high level to low level;
the transistor Tr1 is turned off;
the transistor Tr4 is turned on;
the port P3.1 goes from high to low.
According to another aspect of the present application, there is also provided a method for setting a device for carrying data communication using a sensor output line as set forth in any one of the above, wherein the method includes:
a signal input/output line connecting the setting unit and the sensor unit;
the setting unit is electrified to prepare for data transmission;
the sensor MPU is electrified and is in an action state, the triode Tr1 is conducted, and a T1 period is started and a T10 period is entered;
the sensor MPU reads the handshake signal and enters a T11 period;
the setting unit MPU detects the start of a T1 period, waits for a preset time such as 50us and sends a handshake signal;
the sensor MPU verifies the handshake signal, and after verification is passed, the triode Tr1 is closed for a preset time such as 5us to answer the setting unit MPU;
the setting unit MPU judges whether a response is received, and if the response is received, a set of setting data is sent to the sensor MPU;
after receiving the setting data, the sensor MPU enters a T13 period, judges whether the sensor MPU returns the reading data to the setting unit MPU, if so,
a setting unit MPU verifies the returned read data;
judging whether the setting unit MPU has operation or not, and if not, entering a T2 period.
Further, in the above method, after the setting unit MPU determines whether the response is received, the method further includes:
if no response is received, waiting for the next T1 period to start again.
Further, in the above method, after determining whether the sensor MPU returns the read data to the setting unit MPU, the method further includes:
if not, entering a T2 period, closing the triode Tr1, and preventing the triode Tr1 from being burnt;
the transmission fails, and the transmission is started again in the next T1 period.
Further, in the above method, after determining whether the setting unit MPU has an operation, the method further includes:
if there is an operation, indicating that the setting unit MPU has data to send, then the sending is started again in the next T1 period.
Compared with the prior art, the application has the following advantages:
1. improving efficiency of parameter debugging in sensor manufacturing process
Some system-level parameters of the sensor can be set after assembly is completed, and for the parameters, the current practice is to place a test pad on a circuit board, and make on-line adjustment after contact by using a thimble. The disadvantage of this approach is that the test pads occupy circuit board space and cannot be set after complete assembly, with low parameter accuracy. The method of the application can achieve the purpose of parameter writing through the communication of the output line after the product is completely assembled.
2. Contribution to product in installation and debugging process
In the product installation and debugging process, the installation points of some equipment are too narrow, and the problem can be solved if the occasion that hand and instrument can't get into is adjusted through the output line. The device for connecting the output line to adjust can be an upper controller or a hand-held adjusting box.
3. Contribution to reducing material and processing costs
The communication function is added, but expensive communication circuits and chips are not needed, and the short circuit detection circuit in the sensor output circuit is utilized to exchange data with the controller capable of setting parameters through the time sequence and the method provided by the application. Therefore, the adjusting structure and the adjusting circuit can be omitted, and the assembly time is greatly shortened and the processing cost is saved because the adjusting structure is not provided.
4. The difficulty of structural design and assembly of the product are reduced, the development progress is accelerated, and the assembly time is shortened
The use of communication means can reduce structural parts such as knobs, buttons, sealing rings, etc., reducing structural costs (by about 10%) and assembly costs (by about 20%).
5. The environmental resistance of the product can be achieved more easily, and the low cost and high protection are achieved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 shows a schematic diagram of an output circuit according to an embodiment of the application;
FIG. 2 shows a timing diagram of short circuit detection according to an embodiment of the present application;
FIG. 3 shows a periodic schematic of an embodiment of the present application;
FIG. 4 is a schematic diagram of data organization according to an embodiment of the application;
FIG. 5 shows a hardware interface schematic of an embodiment of the application;
FIG. 6 is a timing diagram of data transmission according to an embodiment of the present application;
fig. 7 shows a data transmission flow chart of an embodiment of the present application.
The same or similar reference numbers in the drawings refer to the same or similar parts.
Detailed Description
The application is described in further detail below with reference to the accompanying drawings.
In one exemplary configuration of the application, the terminal, the device of the service network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
Parameters of the sensor are set by using potentiometers, buttons and switches. For example, sensitivity (sensitivity) adjustment is generally performed by two methods, i.e., analog method, in which the sensitivity is adjusted by adjusting the resistance of a potentiometer and changing the level of a signal. In addition, the sensor is digital, and the sensitivity is adjusted by operating a button.
The method for communicating between the sensor and the host computer may generally include: the sensor communicates with the upper computer to obtain the sensitivity parameters through a special communication chip and a communication circuit and by setting a necessary communication protocol. The upper computer can be a computer or a special handheld device. This approach allows for large capacity data exchanges, but requires additional transmission lines and transmission circuitry.
The purpose of the sensor output control line is to output the state detected by the sensor to the lower controller in a current mode with a certain load capacity (usually about 100 mA). The lower controller can be an input circuit such as a relay coil, a PLC, an IPC and the like. As shown in fig. 1 by taking a general output circuit (NPN) as an example, in fig. 1, an output transistor and a sampling resistor form the simplest output circuit, and the function of the sampling resistor is that when an output line and a load power supply are short-circuited, when a voltage generated by a short-circuit current on the sampling resistor is greater than a conduction voltage of Tr2, a low level occurs at an MPU port, and after the CPU detects the low level, P1.0 outputs the low level, so that the output transistor Tr1 is ensured not to be damaged due to the short circuit. After the output is turned off for a period of time (T2), P1.0 outputs a high level, the output triode is turned on (T1), whether the short circuit signal disappears or not is detected, if the short circuit signal disappears, the output is normally output according to the detected state, and if the short circuit signal is still in the on state, the output is continuously turned off. Wherein the choice of T1 and T2 ensures that Tr1 is not destroyed by short-circuit currents. The duty cycle of T1 and T2 is typically 1:100, data as used herein are 200us and 20ms. If the output current is lower than the short-circuit current that can be detected, the short-circuit detection port of P2.0 is at a high level as indicated by a dotted line in fig. 2. The short circuit detection timing diagram is shown in fig. 2.
1. Communication constitution
From the above description, it can be found that, in the output operation, i.e., the T1 phase where P1.0 is at a high level, the transistor Tr1 is always in the on state, and the on state of the transistor Tr2 depends on the state of the load. This state is 200us according to the time now normally set. Depending on the basic concept of data communication, and the operating speed of the CPU, it is entirely possible to perform data communication of several tens of bits in a 200us process.
As shown in fig. 3, in the 200us period of T1, the segments T10 to T13 are respectively:
t10: signal settling time of about 50us
T11: handshake signal of about 30us
T12: response and data reception 10 bits, about 50us
T13: data return, about 70us
T10 is a signal stabilization period, after the sensor MPU sends out a signal, the setting unit MPU (the device for exchanging data with the sensor) changes from other states to a data exchange state, and a waiting signal is needed. This state may be 10us or 50us, depending on the hardware
T11 is a confirmation period, and a confirmation signal is sent by the setting unit MPU, and is confirmed by the sensor MPU, in order to distinguish whether the sensor is short-circuited during use or intentionally short-circuited for exchanging data. In the use process, the state of instantaneous disconnection can also appear in the short circuit process because the jitter of the circuit or the insecure wiring, so the confirmation period is ensured to identify whether the communication state or the unexpected state is realized. The longer this period, the more reliable.
T12 is a response and data transfer period, which can be divided into response bits of the sensor MPU, and a setting unit MPU sends out a start bit, a data bit and a check bit of data, wherein the period is between 50 and 60us, and 8 to 10bit data is transmitted.
T13 is a group of data returned to the setting unit MPU after receiving the data sent by the setting unit MPU, and can return the characteristic value of the data according to the value just received or the characteristic value of the just received. And the correctness of the received data is ensured.
2. Construction of data
Because the communication is not implemented by using the serial port resource of the MPU, the upper computer and the lower computer are in the highest level response during the communication, shield all interrupts and cannot implement the multiplexing, so the data must be short and clean. The upper computer and the lower computer agree that 5us is a data width, and after the response is triggered by the starting signal edge, the calibration is carried out, and the accumulated error is eliminated. The data structure is shown in fig. 4, for example.
The burst data shown in fig. 4 is 010100001010110, which may include a start bit, a data bit, a check bit, etc., and is the same as the data expressed in general communication. But the definition of each bit of data is not exactly the same.
As shown in fig. 3, one data transfer is completed for a time of t1+t2, about 22ms. T2 is the time that must rest, guarantees that output triode is not burnt.
As shown in fig. 5, the present application provides a device for carrying data communication using a Sensor output line, comprising a Sensor unit (Sensor) and a Setting unit (Setting unit), wherein,
the sensor unit includes: the sensor MPU, the resistor R1, the resistor R2, the triode Tr1 of NPN, the triode Tr2 of NPN, the voltage stabilizing circuit Reg and the sampling resistor Rsense, wherein one end of the voltage stabilizing circuit Reg is connected with a 12V power supply, and the other end of the voltage stabilizing circuit Reg outputs a 5V power supply; the port P1.0 of the sensor MPU is connected with one end of the R2, and the port P2.0 of the sensor MPU is connected with the collector of the Tr2 and one end of the R1; one end of a resistor R1 is connected with a 5V power supply, and the other end of the resistor R1 is connected with a collector of a triode Tr2 and a port P2.0 of a sensor MPU; one end of the electric group R2 is connected with a port P1.0 of the sensor MPU, and the other end of the electric group R2 is connected with the base electrode of the triode Tr 1; the base electrode of the triode Tr1 is connected with one end of a resistor R2, and the emitter electrode of the triode Tr1 is connected with the base electrode of the triode Tr2 and one end of a sampling resistor Rsense; the collector of the triode Tr2 is connected with one end of the ports P2.0 and R1 of the sensor MPU, the base of the triode Tr2 is connected with the emitter of the Tr1 and one end of the sampling resistor Rsense, and the emitter of the triode Tr2 is grounded; one end of the sampling resistor Rsense is connected with the emitter of the Tr1 and the base of the Tr2, and the other end of the sampling resistor Rsense is grounded;
the setting unit includes: the device comprises a setting unit MPU, a PNP triode Tr3, an NPN triode Tr4, a resistor R3, a resistor R4, a resistor R5 and a setting panel (setting panel), wherein the setting panel is connected with the setting unit MPU, a port P3.0 of the setting unit MPU is connected with one end of the resistor R3, and a port P3.1 of the setting unit MPU is connected with one end of the resistor R4 and a collector of the triode Tr 4; the collector of the triode Tr3 is connected with a 12V power supply, the base of the triode Tr3 is connected with one end of a resistor R3, the emitter of the triode Tr3 is connected with one end of R5, and the emitter of the triode Tr3 is connected with the collector of the triode Tr1 to serve as a signal input output line (SIO); the collector of the NPN triode Tr4 is connected with a port P3.1 of the setting unit MPU and one end of a resistor R4, the base of the triode Tr4 is connected with one end of a resistor R5, and the emitter of the triode Tr4 is grounded; one end of a resistor R3 is connected with a port P3.0 of the setting unit MPU, and the other end of the resistor R3 is connected with a base electrode of the Tr 3; one end of the resistor R4 is connected with a 12V power supply, and the other end of the resistor R4 is connected with a port P3.1 of the setting unit MPU and a collector electrode of the triode Tr 4; one end of the resistor R5 is connected with the base electrode of the triode Tr4, and the other end is connected with the collector electrode of the triode Tr1 and the emitter electrode of the triode Tr 3.
The sensor unit may be the simplest three-wire NPN output. Three lines are respectively a power supply 12v, a power supply ground and an action output line (multiplexing ports are used as signal I/O lines when parameters are set)
The three-wire ports of the setting unit are respectively a power supply 12v, a power supply ground and an I/O wire, and can be a handheld regulator or a parameter setting module of a production line inspection machine.
The specific port settings may be as follows:
as shown in fig. 5, when parameter setting is required, the sensor unit and the setting unit are connected according to fig. 5. The setting unit is electrified to place the sensor at the action output. Parameters of the setting unit are adjusted, and the setting unit transmits data to the sensor through the SIO line.
According to the circuit shown in fig. 5, the sensor MPU and the setting unit MPU can monitor and take over the SIO line through the respective input/output ports, and can perform bidirectional data transmission on the SIO line according to a predetermined agreement on the communication parameters.
The signal input and output line (SIO) of the application not only can directly drive the actuating mechanism such as a relay, but also can carry out simple data exchange with an upper computer without increasing the cost.
As shown in fig. 6, in an embodiment of the device for carrying data communication by using a sensor output line, a time of one data transmission of the device sequentially includes a working period T1 and a rest period T2, where the working period T1 sequentially includes:
a signal stabilization period T10, which is used for the setting unit MPU to change from other states to a data exchange state after the sensor MPU sends out a signal and wait for the signal;
a confirmation period T11 for confirming the confirmation signal by the sensor MPU after the confirmation signal is sent by the setting unit MPU;
the response and data transfer period T12 sequentially includes a response bit of the sensor MPU, a start bit, a data bit, and a check bit of the data sent by the setting unit MPU.
And the data return period T13 is used for returning data to the setting unit MPU according to the data sent by the setting unit MPU by the sensor MPU.
In an embodiment of the device for carrying data communication by using a sensor output line of the present application, the signal stabilization period T10 sequentially includes:
the port P1.0 changes from low to high;
the transistor Tr1 is turned on;
the transistor Tr4 is turned off;
the port P3.1 goes from low to high.
In an embodiment of the device for carrying data communication by using a sensor output line of the present application, the confirmation period T11 sequentially includes:
the port P3.0 changes from low to high;
the transistor Tr3 is turned off;
the overcurrent disappears;
the transistor Tr2 is turned off;
the port P2.0 changes from low to high.
In an embodiment of the device for carrying data communication by using a sensor output line of the present application, the response and data transmission period T12 sequentially includes:
the port P1.0 changes from high level to low level;
the transistor Tr1 is turned off;
the transistor Tr4 is turned on;
the port P3.1 goes from high to low.
Specifically, the data flow and signaling are as follows:
(1) and (3) starting a T1 period:
ports P1.0→1, tr1 on, tr4 off, P3.1→1
(2) Handshake signal transmission and reception: taking the example of sending a "1":
p3.0.fwdarw.1, tr3 is cut off, overcurrent disappears, tr2 is cut off, and P2.0.fwdarw.1
(3) Transmission and reception of replies and checks:
the transmission P1.0.fwdarw.0, tr1 is off, tr4 is on, and P3.1.fwdarw.0.
As shown in fig. 7, the method for setting a device for carrying data communication by using a sensor output line according to the present application includes:
a signal input/output line (SIO) connecting between the setting unit and the sensor unit;
the setting unit is electrified to prepare for data transmission;
the sensor MPU is electrified and is in an action state, the triode Tr1 is conducted, and a T1 period is started and a T10 period is entered;
the sensor MPU reads the handshake signal and enters a T11 period;
the setting unit MPU detects the start of a T1 period, waits for a preset time such as 50us and sends a handshake signal;
the sensor MPU verifies the handshake signal, and after verification is passed, the triode Tr1 is closed for a preset time such as 5us to answer the setting unit MPU;
the setting unit MPU judges whether a response is received, and if the response is received, a set of setting data is sent to the sensor MPU;
after receiving the setting data, the sensor MPU enters a T13 period, judges whether the sensor MPU returns the reading data to the setting unit MPU, if so,
a setting unit MPU verifies the returned read data;
judging whether the setting unit MPU has operation or not, and if not, entering a T2 period.
In an embodiment of the setting method of the device for carrying data communication by using a sensor output line of the present application, after the setting unit MPU determines whether a response is received, the setting method further includes:
if no response is received, waiting for the next T1 period to start again.
In an embodiment of the setting method of the device for carrying data communication by using a sensor output line of the present application, after determining whether the sensor MPU returns the read data to the setting unit MPU, the setting method further includes:
if not, entering a T2 period, closing the triode Tr1, and preventing the triode Tr1 from being burnt;
the transmission fails, and the transmission is started again in the next T1 period.
In an embodiment of the present application, after determining whether the setting unit MPU has an operation, the setting method further includes:
if there is an operation, indicating that the setting unit MPU has data to send, then the sending is started again in the next T1 period.
In summary, compared with the prior art, the application has the following advantages:
4. improving efficiency of parameter debugging in sensor manufacturing process
Some system-level parameters of the sensor can be set after assembly is completed, and for the parameters, the current practice is to place a test pad on a circuit board, and make on-line adjustment after contact by using a thimble. The disadvantage of this approach is that the test pads occupy circuit board space and cannot be set after complete assembly, with low parameter accuracy. The method of the application can achieve the purpose of parameter writing through the communication of the output line after the product is completely assembled.
5. Contribution to product in installation and debugging process
In the product installation and debugging process, the installation points of some equipment are too narrow, and the problem can be solved if the occasion that hand and instrument can't get into is adjusted through the output line. The device for connecting the output line to adjust can be an upper controller or a hand-held adjusting box.
6. Contribution to reducing material and processing costs
The communication function is added, but expensive communication circuits and chips are not needed, and the short circuit detection circuit in the sensor output circuit is utilized to exchange data with the controller capable of setting parameters through the time sequence and the method provided by the application. Therefore, the adjusting structure and the adjusting circuit can be omitted, and the assembly time is greatly shortened and the processing cost is saved because the adjusting structure is not provided.
4. The difficulty of structural design and assembly of the product are reduced, the development progress is accelerated, and the assembly time is shortened
The use of communication means can reduce structural parts such as knobs, buttons, sealing rings, etc., reducing structural costs (by about 10%) and assembly costs (by about 20%).
5. The environmental resistance of the product can be achieved more easily, and the low cost and high protection are achieved.
In addition, the present application is not specifically described with respect to the output form of PNP, but is readily implemented by those skilled in the art through analogy, depending on the circuitry and implementation of NPN.
The data used in the above description of the present application, such as T1, T2, response 5us, etc., are for illustration only, and not for special purposes, any other data are within the scope of the present application.
The method described by the application can be applied to a photoelectric switch detection field, and the sensitivity adjustment on the field can be realized by using the method; the method can also be applied to a characteristic checking procedure in the sensor production process, and the checking machine can write characteristic data into the sensor through the method.
The application is characterized in that the sensor and the outside are subjected to data interaction, the output line of the sensor is shared, and no additional circuit is added.
The communication protocol and the time sequence described by the application are different from the general data communication and are data exchange under specific conditions.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, e.g., using Application Specific Integrated Circuits (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application may be executed by a processor to perform the steps or functions described above. Likewise, the software programs of the present application (including associated data structures) may be stored on a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. In addition, some steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
Furthermore, portions of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application by way of operation of the computer. Program instructions for invoking the inventive methods may be stored in fixed or removable recording media and/or transmitted via a data stream in a broadcast or other signal bearing medium and/or stored within a working memory of a computer device operating according to the program instructions. An embodiment according to the application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to operate a method and/or a solution according to the embodiments of the application as described above.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Claims (9)
1. An apparatus for carrying data communications using a sensor output line, wherein the apparatus comprises: a sensor unit and a setting unit, wherein,
the sensor unit includes: the sensor MPU, the resistor R1, the resistor R2, the triode Tr1 of NPN, the triode Tr2 of NPN, the voltage stabilizing circuit Reg and the sampling resistor Rsense, wherein one end of the voltage stabilizing circuit Reg is connected with a 12V power supply, and the other end of the voltage stabilizing circuit Reg outputs a 5V power supply; the port P1.0 of the sensor MPU is connected with one end of the R2, and the port P2.0 of the sensor MPU is connected with the collector of the Tr2 and one end of the R1; one end of a resistor R1 is connected with a 5V power supply, and the other end of the resistor R1 is connected with a collector of a triode Tr2 and a port P2.0 of a sensor MPU; one end of the electric group R2 is connected with a port P1.0 of the sensor MPU, and the other end of the electric group R2 is connected with the base electrode of the triode Tr 1; the base electrode of the triode Tr1 is connected with one end of a resistor R2, and the emitter electrode of the triode Tr1 is connected with the base electrode of the triode Tr2 and one end of a sampling resistor Rsense; the collector of the triode Tr2 is connected with one end of the ports P2.0 and R1 of the sensor MPU, the base of the triode Tr2 is connected with the emitter of the Tr1 and one end of the sampling resistor Rsense, and the emitter of the triode Tr2 is grounded; one end of the sampling resistor Rsense is connected with the emitter of the Tr1 and the base of the Tr2, and the other end of the sampling resistor Rsense is grounded;
the setting unit includes: the device comprises a setting unit MPU, a PNP triode Tr3, an NPN triode Tr4, a resistor R3, a resistor R4, a resistor R5 and a setting panel, wherein the setting panel is connected with the setting unit MPU, a port P3.0 of the setting unit MPU is connected with one end of the resistor R3, and a port P3.1 of the setting unit MPU is connected with one end of the resistor R4 and a collector of the triode Tr 4; the collector of the triode Tr3 is connected with a 12V power supply, the base of the triode Tr3 is connected with one end of a resistor R3, the emitter of the triode Tr3 is connected with one end of R5, and the emitter of the triode Tr3 is connected with the collector of the triode Tr1 to serve as a signal input output line (SIO); the collector of the NPN triode Tr4 is connected with a port P3.1 of the setting unit MPU and one end of a resistor R4, the base of the triode Tr4 is connected with one end of a resistor R5, and the emitter of the triode Tr4 is grounded; one end of a resistor R3 is connected with a port P3.0 of the setting unit MPU, and the other end of the resistor R3 is connected with a base electrode of the Tr 3; one end of the resistor R4 is connected with a 12V power supply, and the other end of the resistor R4 is connected with a port P3.1 of the setting unit MPU and a collector electrode of the triode Tr 4; one end of the resistor R5 is connected with the base electrode of the triode Tr4, and the other end is connected with the collector electrode of the triode Tr1 and the emitter electrode of the triode Tr 3.
2. The apparatus of claim 1, wherein the time of one data transmission of the apparatus comprises a duty cycle T1 and a rest cycle T2 in sequence, wherein the duty cycle T1 comprises in sequence:
a signal stabilization period T10, which is used for the setting unit MPU to change from other states to a data exchange state after the sensor MPU sends out a signal and wait for the signal;
a confirmation period T11 for confirming the confirmation signal by the sensor MPU after the confirmation signal is sent by the setting unit MPU;
a response and data transmission period T12 sequentially comprising response bits of the sensor MPU, and a start bit, a data bit and a check bit of data sent by the setting unit MPU;
and the data return period T13 is used for returning data to the setting unit MPU according to the data sent by the setting unit MPU by the sensor MPU.
3. The apparatus of claim 2, wherein the signal stabilization period T10 comprises, in order:
the port P1.0 changes from low to high;
the transistor Tr1 is turned on;
the transistor Tr4 is turned off;
the port P3.1 goes from low to high.
4. The apparatus of claim 2, wherein the acknowledgement period T11 comprises, in order:
the port P3.0 changes from low to high;
the transistor Tr3 is turned off;
the overcurrent disappears;
the transistor Tr2 is turned off;
the port P2.0 changes from low to high.
5. The apparatus of claim 2, wherein the reply and data transfer period T12 comprises, in order:
the port P1.0 changes from high level to low level;
the transistor Tr1 is turned off;
the transistor Tr4 is turned on;
the port P3.1 goes from high to low.
6. A setting method of a device for carrying data communication using a sensor output line according to any one of claims 1 to 5, wherein the method comprises:
a signal input/output line connecting the setting unit and the sensor unit;
the setting unit is electrified to prepare for data transmission;
the sensor MPU is electrified and is in an action state, the triode Tr1 is conducted, and a T1 period is started and a T10 period is entered;
the sensor MPU reads the handshake signal and enters a T11 period;
the setting unit MPU detects the start of a T1 period, waits for a preset time and sends a handshake signal;
the sensor MPU verifies the handshake signal, and after verification is passed, the triode Tr1 is closed for a preset time such as 5us to answer the setting unit MPU;
the setting unit MPU judges whether a response is received, and if the response is received, a set of setting data is sent to the sensor MPU;
after receiving the setting data, the sensor MPU enters a T13 period, judges whether the sensor MPU returns the reading data to the setting unit MPU, if so,
a setting unit MPU verifies the returned read data;
judging whether the setting unit MPU has operation or not, and if not, entering a T2 period.
7. The apparatus setting method for carrying data communication using a sensor output line according to claim 6, wherein the setting unit MPU judges whether or not a response is received, further comprising:
if no response is received, waiting for the next T1 period to start again.
8. The device setting method using the sensor output line to carry data communication according to claim 6, wherein after judging whether the sensor MPU returns the read data to the setting unit MPU, further comprising:
if not, entering a T2 period, closing the triode Tr1, and preventing the triode Tr1 from being burnt;
the transmission fails, and the transmission is started again in the next T1 period.
9. The device configuration method for carrying data communication using a sensor output line according to claim 6, wherein after determining whether the configuration unit MPU has an operation, further comprising:
if there is an operation, indicating that the setting unit MPU has data to send, then the sending is started again in the next T1 period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810372228.1A CN108400801B (en) | 2018-04-24 | 2018-04-24 | Device for carrying data communication by using sensor output line and setting method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810372228.1A CN108400801B (en) | 2018-04-24 | 2018-04-24 | Device for carrying data communication by using sensor output line and setting method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108400801A CN108400801A (en) | 2018-08-14 |
CN108400801B true CN108400801B (en) | 2023-08-22 |
Family
ID=63100361
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810372228.1A Active CN108400801B (en) | 2018-04-24 | 2018-04-24 | Device for carrying data communication by using sensor output line and setting method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108400801B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008072168A (en) * | 2006-09-12 | 2008-03-27 | Fujitsu Ten Ltd | Monitor circuit for one-wire communication |
CN104834616A (en) * | 2015-04-30 | 2015-08-12 | 徐友华 | Data interface circuit and communication method thereof and multisection sensor system |
CN208299796U (en) * | 2018-04-24 | 2018-12-28 | 上海索迪龙自动化有限公司 | The device of data communication is carried using Sensor output |
-
2018
- 2018-04-24 CN CN201810372228.1A patent/CN108400801B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008072168A (en) * | 2006-09-12 | 2008-03-27 | Fujitsu Ten Ltd | Monitor circuit for one-wire communication |
CN104834616A (en) * | 2015-04-30 | 2015-08-12 | 徐友华 | Data interface circuit and communication method thereof and multisection sensor system |
CN208299796U (en) * | 2018-04-24 | 2018-12-28 | 上海索迪龙自动化有限公司 | The device of data communication is carried using Sensor output |
Also Published As
Publication number | Publication date |
---|---|
CN108400801A (en) | 2018-08-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112653738B (en) | Internet of things network debugging system and method | |
US10169183B2 (en) | Mobile device and chassis with contactless tags to diagnose hardware and software faults | |
US20150099464A1 (en) | Switching device and a method of controlling the same | |
CN103793307A (en) | Electronic device, management method thereof and cabinet servo system | |
CN104516838A (en) | Management path determining method and device | |
US20250027820A1 (en) | New energy vehicle, vehicle-mounted charging device, temperature measurement circuit, and temperature measurement method | |
CN108400801B (en) | Device for carrying data communication by using sensor output line and setting method thereof | |
CN213715749U (en) | A kind of Taiwan comprehensive analyzer | |
CN101267350A (en) | Debugging method and debugging system | |
CN208299796U (en) | The device of data communication is carried using Sensor output | |
CN103425123A (en) | Automated testing method for CAN (controller area network) bus based on software script | |
US20250045229A1 (en) | Data processing method and system, and related components | |
CN217508761U (en) | RS-485 communication circuit, integrated circuit and electronic equipment | |
CN117009155A (en) | High-bandwidth memory test method, high-bandwidth memory, electronic device and storage medium | |
CN112333038A (en) | Vehicle gateway detection method and device | |
CN114003046A (en) | Positioning circuit supporting debugging, debugging control method, electronic device and vehicle | |
JPH043282A (en) | Ic card | |
CN205140523U (en) | Nonvolatile memory read reliability from detection circuitry | |
CN110879550A (en) | A motor control system and CAN communication method | |
TWI447589B (en) | Data exchange between an electronic payment terminal and a maintenance tool over a usb connection | |
CN222365081U (en) | A physical layer interface connection state detection circuit and control system | |
JP2002366505A (en) | Method and device for detecting mounting position | |
CN112711238B (en) | Data replacement method, device, device and storage medium | |
JPH033043A (en) | Semiconductor device | |
JP2896133B1 (en) | Encoder device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: 201399 room 144, building 1, No. 9628, Hunan Road, Huinan Town, Pudong New Area, Shanghai Patentee after: Shanghai sodilon Automation Co.,Ltd. Address before: 201399 room 144, building 1, No. 9628, Hunan Road, Huinan Town, Pudong New Area, Shanghai Patentee before: SHANGHAI SODRON AUTOMATION CO.,LTD. |
|
CP01 | Change in the name or title of a patent holder |