CN111405592B - Method for quickly networking digital sensor - Google Patents
Method for quickly networking digital sensor Download PDFInfo
- Publication number
- CN111405592B CN111405592B CN201911214357.9A CN201911214357A CN111405592B CN 111405592 B CN111405592 B CN 111405592B CN 201911214357 A CN201911214357 A CN 201911214357A CN 111405592 B CN111405592 B CN 111405592B
- Authority
- CN
- China
- Prior art keywords
- digital
- netbit
- sensor
- sensors
- correct
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
The invention discloses a method for quickly networking a digital sensor, which comprises the following steps: the digital instrument sends a broadcasting instruction to enable all the digital sensors to enter a networking state; the digital instrument sends an instruction, and the digital sensor with the same ID number from 0 to netBit replies the ID number; the digital instrument judges whether the correct ID number is obtained according to the reply ID number; if the acquisition fails, adding 1 to the netbit value of the current scanning ID number, and reissuing the instruction until the digital instrument acquires the correct ID number; the digital instrument acquires the correct ID number and stores the ID number into the identified ID number group; after the digital instrument acquires the correct ID number, the digital sensor is provided with an address through the ID number, or the information of each digital sensor is directly read through the ID number. The method utilizes the characteristic that the sensors have unique ID numbers and RS485 buses to collide, combines a certain detection flow to detect the ID numbers of all the received sensors, reduces the damage rate of the sensors and also improves the speed of the digital sensor network.
Description
Technical Field
The invention relates to the technical field of vehicle detection, in particular to a method for quickly networking a digital sensor.
Background
The existing truck scale is mostly an electronic truck scale, and compared with a mechanical truck scale, the electronic truck scale is high in precision, good in stability and convenient to operate, and the electronic truck scale adopts digital sensors, and in the same weighing platform, each digital sensor must have different communication addresses, so that the problem of complex connection exists. The existing solutions have the following: in the first method, only a single sensor is connected through an instrument on site, and an address is set. However, after one sensor is set, the instrument needs to be turned off, the sensor is removed, the next sensor is restarted, an address setting interface is entered, and an address is set. The operation steps are more, the wiring is complex, and the sensor can be damaged when the wiring is wrong. And secondly, identifying the sensors by inquiring the unique ID number of each digital sensor. However, the ID number of the sensor ranges from 0 to 999999 to query one by one, and assuming that the query action of each number takes 40ms, the total time is 1000000×40ms=11 hours, and the time is too long.
Disclosure of Invention
The invention mainly solves the technical problems of complex steps and long time consumption of the original digital sensor networking, provides a method for quickly networking the digital sensors, utilizes the characteristics that the sensors have unique ID numbers and RS485 buses to conflict, combines a certain detection flow to detect the ID numbers of all the received sensors, reads the stress signals of the sensors through the ID numbers or reads the stress signals of the sensors through addresses, does not need to connect the sensors one by one and set the addresses, reduces the damage rate of the sensors, and also improves the speed of the digital sensor networking.
The technical problems of the invention are mainly solved by the following technical proposal: the invention comprises the following steps:
(1) The digital instrument sends a broadcasting instruction before automatic networking to enable all the digital sensors to enter a networking state; the digital sensor is only identifiable by the digital meter in the networking state.
(2) The digital instrument sends an instruction, and the digital sensor with the same ID number from 0 to netBit replies the ID number; the ID number of the sensor is set to 10 bits in this scheme, or can be less or more, which is related to one product ID number management, the numerical range of each bit is 0 to 9, and the ID number of the digital sensor is identified from right to left.
(3) The digital sensor replies its ID number;
(4) If a single digital sensor meets the conditions, the digital instrument acquires the correct ID number, and if a plurality of digital sensors meet the conditions and reply the ID number, the RS485 bus is confused, and the digital instrument receives the confused data;
(5) After the digital instrument receives the chaotic data, adding 1 to the netbit value of the current scanning ID number, and reissuing the instruction until the digital instrument acquires the correct ID number; and (3) identifying one more ID number during scanning, and repeating the step (2), the step (3) and the step (4).
(6) After the digital instrument acquires the correct ID number, the ID number is sent to the digital sensor;
(7) If the digital sensor judges that the received ID number is the same as the ID number, a correct response is returned, and the automatic networking state is exited;
(8) If the digital instrument receives the correct response returned by the digital sensor, storing the ID number into the identified ID number group, and if the digital instrument does not receive the response of the sensor, returning to the step (5);
(9) After the digital instrument acquires all the correct ID numbers, addresses are respectively set for the digital sensors from 1 to n through the ID numbers.
Preferably, the digital meter in the step (1) makes all the sensors enter the networking state by means of instructions.
Preferably, the method of scanning the ID in the step (2) is to gradually scan the ID from the 0 th bit to the 1 st bit and the 2 nd bit … …, i.e. scan the ID from right to left.
Preferably, the netBit in the step (2) refers to a netBit, and the netBit is a number of the (n+1) th bits of the ID from right to left. If the ID number of the digital sensor is 123456789 and the netbit value is 3, the corresponding value is 7.
Preferably, in the step (2), the netBit is an integer starting from 0. Since the ID number of the digital sensor is recognized from bit 1, netBit is at least 1-1=0, and the number of digits of the ID number of the digital sensor is an integer, and netBit is also an integer.
Preferably, after the digital instrument in the step (5) receives the chaotic data, the netbit value of the current scanning ID number is added with 1, then the netbit value of the current scanning ID number is set to 0, and the instruction is reissued.
Preferably, the digital meter in the step (9) addresses the digital sensors from 1 to n respectively through ID numbers to obtain sampling data, or directly reads information of each digital sensor through the ID numbers.
The beneficial effects of the invention are as follows: the sensor has the characteristics of unique ID numbers and RS485 bus conflict, the ID numbers of all the received sensors are detected by combining a certain detection flow, the stress signals of the sensors are read through the ID numbers or the stress signals of the sensors are read through the addresses, the sensors are not required to be connected one by one and the addresses are set, the damage rate of the sensors is reduced, and the speed of the digital sensor network is also improved.
Drawings
Fig. 1 is a flow chart of the present invention.
Detailed Description
The technical scheme of the invention is further specifically described below through examples and with reference to the accompanying drawings. Examples: the method for quickly networking the digital sensor in the embodiment, as shown in fig. 1, comprises the following steps:
(1) The digital instrument reads the stress signal of each digital sensor in a command mode, and the digital instrument sends a broadcast command before automatic networking so that all the digital sensors enter a networking state.
(2) The digital instrument sends an instruction, and the digital sensor with the same ID number from 0 to netBit replies the ID number. If no digital sensor replies, judging whether the value of the netBit of the ID number is 9, if so, adding 1 to the netBit value of the current scanning ID number, setting the value of the netBit of the current scanning ID number to 0, reissuing the instruction, and repeating the step (2). The ID number of the sensor is set to 10 bits in the scheme, or can be less or more, which is related to one product ID number management, the numerical range of each bit is 0 to 9, and the ID scanning method is that the ID scanning is gradually carried out from the 0 th bit to the 1 st bit and the 2 nd bit … …. For example, the ID number of the sensor is 123456789, the ID number is: bit 0 has a value of 0; bit 1 value 9; bit 2 value 8; bit 3 value 7; bit 4 value; the value of bit 5 is 5; bit 6 value 3; bit 7 value 2; bit 8 value 1; bit 9 value 0.
(3) The digital sensor replies its ID number. netBit refers to the netBit bit, which is the number of the (n+1) th bits of the ID from right to left. If the ID number of the digital sensor is 123456789 and the netbit value is 3, the corresponding value of the netbit bit is 7. Since netBit is an integer starting from 0 and the ID number of the digital sensor is recognized from bit 1, netBit is at least 1-1=0, the number of bits of the ID number of the digital sensor is an integer, and netBit is also an integer.
(4) If a single digital sensor meets the conditions, the digital instrument acquires the correct ID number, and if a plurality of digital sensors simultaneously reply the ID number, the RS485 bus is disordered, and the digital instrument receives chaotic data.
(5) After the digital instrument receives chaotic data, adding 1 to the netbit value of the current scanning ID number, reissuing an instruction until the digital instrument obtains the correct ID number, namely, identifying one more ID number during rescanning, setting the value of the netbit of the current scanning ID number to 0, and repeating the steps (2), 3 and 4).
(6) After the digital instrument acquires the correct ID number, the ID number is sent to the digital sensor.
(7) If the digital sensor judges that the received ID number is the same as the ID number, a correct response is returned, and the automatic networking state is exited.
(8) If the digital instrument receives the correct response returned by the digital sensor, the ID number is stored in the identified ID number group, and if the digital instrument does not receive the response from the sensor, the step (5) is returned.
(9) After the digital instrument acquires all the correct ID numbers, the digital sensors are respectively provided with addresses from 1 to n through the ID numbers, or the information of each digital sensor is directly read through the ID numbers.
Claims (5)
1. A method for rapid networking of digital sensors, comprising the steps of:
(1) The digital instrument sends a broadcasting instruction before automatic networking to enable all the digital sensors to enter a networking state;
(2) The digital instrument sends an instruction, and the digital sensor with the same ID number from 0 to netBit replies the ID number;
(3) The digital sensor replies its ID number;
(4) If a single digital sensor meets the conditions, the digital instrument acquires the correct ID number, and if a plurality of digital sensors meet the conditions and reply the ID number, the RS485 bus is confused, and the digital instrument receives the confused data;
(5) After the digital instrument receives the chaotic data, adding 1 to the netbit value of the current scanning ID number, reissuing the instruction until the digital instrument acquires the correct ID number, and then setting the netbit value of the current scanning ID number to be 0;
(6) After the digital instrument acquires the correct ID number, the ID number is sent to the digital sensor;
(7) If the digital sensor judges that the received ID number is the same as the ID number, a correct response is returned, and the automatic networking state is exited;
(8) If the digital instrument receives the correct response returned by the digital sensor, storing the ID number into the identified ID number group, and if the digital instrument does not receive the response of the sensor, returning to the step (5);
(9) After the digital instrument obtains all correct ID numbers, addresses are respectively set for the digital sensors from 1 to n through the ID numbers, and in the step (9), the digital instrument respectively sets addresses for the digital sensors from 1 to n through the ID numbers so as to obtain sampling data, or the information of each digital sensor is directly read through the ID numbers.
2. The method for rapid networking of digital sensors according to claim 1, wherein the digital meter of step (1) reads the stress signal of each digital sensor by means of instructions.
3. The method of claim 1, wherein the step (2) scans the ID by gradually scanning from bit 0 to bit 1 and bit 2 to bit … …, i.e. scanning the ID from right to left.
4. The method for fast networking a digital sensor according to claim 3, wherein the netBit in the step (2) refers to a netBit bit, and the netBit is a number of netbit+1 bits from right to left in the ID.
5. The method of claim 1, 3 or 4, wherein the netBit in step (2) is an integer from 0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911214357.9A CN111405592B (en) | 2019-12-02 | 2019-12-02 | Method for quickly networking digital sensor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911214357.9A CN111405592B (en) | 2019-12-02 | 2019-12-02 | Method for quickly networking digital sensor |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111405592A CN111405592A (en) | 2020-07-10 |
CN111405592B true CN111405592B (en) | 2023-10-24 |
Family
ID=71430267
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911214357.9A Active CN111405592B (en) | 2019-12-02 | 2019-12-02 | Method for quickly networking digital sensor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111405592B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5936520A (en) * | 1997-11-13 | 1999-08-10 | Chrysler Corporation | Analog sensor status detection single wire bus multiplex system |
JP2009003949A (en) * | 2008-07-30 | 2009-01-08 | Hitachi Ltd | Transponder and sensor measurement system using the transponder |
CN101452517A (en) * | 2008-12-29 | 2009-06-10 | 浙江大学 | Wireless passive radio frequency sensing system anti-collision data-transmission method |
CN101464941A (en) * | 2009-01-15 | 2009-06-24 | 浙江大学 | Anti-collision method of wireless passive sensing system based on multi-way tree |
WO2011065785A2 (en) * | 2009-11-30 | 2011-06-03 | 부산대학교 산학협력단 | Recognition method of multiple active rfid tags |
WO2012160825A1 (en) * | 2011-05-25 | 2012-11-29 | 日本電気株式会社 | Sensor and receiving device in sensor system |
CN103969401A (en) * | 2014-04-25 | 2014-08-06 | 华南理工大学 | Networked intelligent CO sensor |
CN105323328A (en) * | 2014-07-11 | 2016-02-10 | 北海市深蓝科技发展有限责任公司 | Automatic address identification method by utilizing MODBUS communication protocol on RS-485 |
CN107453844A (en) * | 2016-05-31 | 2017-12-08 | 宁波向往智能科技有限公司 | A kind of method and device of smart machine automatic network-building |
WO2018043203A1 (en) * | 2016-09-01 | 2018-03-08 | 株式会社ワコム | Stylus and sensor controller |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5792661B2 (en) * | 2012-03-06 | 2015-10-14 | 株式会社日立製作所 | Ad hoc network system and meter reading information collection method |
US9411592B2 (en) * | 2012-12-29 | 2016-08-09 | Intel Corporation | Vector address conflict resolution with vector population count functionality |
-
2019
- 2019-12-02 CN CN201911214357.9A patent/CN111405592B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5936520A (en) * | 1997-11-13 | 1999-08-10 | Chrysler Corporation | Analog sensor status detection single wire bus multiplex system |
JP2009003949A (en) * | 2008-07-30 | 2009-01-08 | Hitachi Ltd | Transponder and sensor measurement system using the transponder |
CN101452517A (en) * | 2008-12-29 | 2009-06-10 | 浙江大学 | Wireless passive radio frequency sensing system anti-collision data-transmission method |
CN101464941A (en) * | 2009-01-15 | 2009-06-24 | 浙江大学 | Anti-collision method of wireless passive sensing system based on multi-way tree |
WO2011065785A2 (en) * | 2009-11-30 | 2011-06-03 | 부산대학교 산학협력단 | Recognition method of multiple active rfid tags |
WO2012160825A1 (en) * | 2011-05-25 | 2012-11-29 | 日本電気株式会社 | Sensor and receiving device in sensor system |
CN103969401A (en) * | 2014-04-25 | 2014-08-06 | 华南理工大学 | Networked intelligent CO sensor |
CN105323328A (en) * | 2014-07-11 | 2016-02-10 | 北海市深蓝科技发展有限责任公司 | Automatic address identification method by utilizing MODBUS communication protocol on RS-485 |
CN107453844A (en) * | 2016-05-31 | 2017-12-08 | 宁波向往智能科技有限公司 | A kind of method and device of smart machine automatic network-building |
WO2018043203A1 (en) * | 2016-09-01 | 2018-03-08 | 株式会社ワコム | Stylus and sensor controller |
Also Published As
Publication number | Publication date |
---|---|
CN111405592A (en) | 2020-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200176976A1 (en) | Method for operating a sensor arrangement in a motor vehicle on the basis of a dsi protocol | |
CN114902613B (en) | In-vehicle apparatus, management apparatus, degradation determination method, change factor determination method, abnormality factor determination method, and storage medium | |
RU2002118104A (en) | Universal detonator system | |
US20100131610A1 (en) | Master Nodes and Slave Nodes for a Communication Network, and Methods Thereof | |
JPS6336032B2 (en) | ||
CN114553373B (en) | Data transmission method, device, equipment and storage medium | |
CN109413630B (en) | Bluetooth RSSI value determination method and system | |
CN110390082B (en) | Communication matrix comparison method and system | |
CN111405592B (en) | Method for quickly networking digital sensor | |
CN111130690A (en) | Processing method and device for multiple communication protocols of IR46 smart electric meter | |
CN111275087A (en) | Data processing method and device, electronic equipment and motor vehicle | |
CN112562400B (en) | Parking space line acquisition method and device and parking management system | |
US6697966B1 (en) | Data bus for a plurality of nodes | |
CN109327354B (en) | Method, device and test system for generating signal forwarding test case | |
CN110907986A (en) | Method and device for acquiring seismic data | |
CN215452927U (en) | Railway wireless train dispatching station receiving threshold temperature compensation system | |
CN113655776B (en) | Vehicle detection method and device, electronic equipment and storage medium | |
CN115470108A (en) | Gateway route testing method and device for vehicle, electronic equipment and storage medium | |
CN110658808B (en) | Online diagnosis and identification circuit and method for functional module of discrete board card type controller | |
CN114760322A (en) | Vehicle information association method, Internet of vehicles terminal and Internet of vehicles platform | |
CN102759725A (en) | Mongline digital range radar and communication method | |
CN110572225B (en) | Receiver direct current offset monitoring system, method, electronic device and storage medium | |
CN114114296A (en) | Laser ranging method and device, laser ranging equipment and readable storage medium | |
KR100771916B1 (en) | Data aquisition method for digital protective relay | |
JP2003522477A (en) | Method and apparatus for automatically assigning addresses to a plurality of modules interconnected by a communication network of complex topology |
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 |