Scan sign indicating number rifle distributor

文档序号:8683 发布日期:2021-09-17 浏览:33次 中文

1. A sweep sign indicating number rifle distributor which characterized in that: the system comprises a singlechip, a power supply chip and a level conversion chip; the single chip microcomputer comprises a plurality of serial ports, and the serial ports comprise an input serial port and a plurality of output serial ports; the input serial port and the output serial port of the single chip are both connected with a level conversion chip;

the input serial port of the single chip microcomputer is connected with a code scanning gun, and data collected by the code scanning gun is converted by a level conversion chip and then input to the single chip microcomputer; the single chip microcomputer analyzes and processes the received data and then sends the data to the back-end equipment through the output serial port; the single chip microcomputer is further connected with the plurality of status indicator lamps, and the power supply chip is used for supplying power to the single chip microcomputer.

2. The code scanning gun distributor according to claim 1, wherein the level conversion chips are RS-232 and TTL level conversion chips, and the single chip microcomputer is of a model STM32F091RBT 6.

3. The code scanning gun distributor according to claim 1, wherein the single chip microcomputer comprises a flash storage module, and the flash storage module is used for storing bar code interception rule information of each output port received by the single chip microcomputer.

4. The code scanning gun distributor according to claim 1, wherein the power chip is connected with an external power adapter, and the power chip supplies power to the single chip microcomputer by converting the voltage of the external power adapter.

5. The code scanning gun dispenser according to claim 1, wherein the status indicator light is used to display the dispenser operating status, including power on, barcode receiving and off.

6. The control method of the code scanning gun dispenser according to any one of claims 1 to 5, characterized by comprising the following steps:

the method comprises the following steps: setting of bar code interception rule

The bar code intercepting rules of each output port of the bar code gun distributor are managed by special upper computer setting software. Connecting any output port of the code scanning gun distributor with a computer serial port provided with upper computer setting software, wherein the upper computer setting software is communicated with the distributor single chip microcomputer through a communication protocol; the distributor inquires the number of output ports according to the instruction of the communication protocol, inquires and sets bar code interception rules of each output port, and automatically stores the bar code interception rules;

step two: receiving and analyzing bar code data

The single chip caches data received by the serial port by using a queue or an array, wherein the single chip judges the integrity of bar code receiving by acquiring the time interval of data receiving;

after the single chip receives the complete bar code data, analyzing the bar code data, and separating the content of the bar code and the control character;

step three: barcode transmission

For the received bar codes, the single chip microcomputer selects and sends the bar codes according to the intercepting rule of each output port;

the singlechip compares the interception rule combinations of each output port one by one, and if the interception rule combinations meet the interception conditions, the bar code is not sent; if the code does not meet the intercepting rule or the intercepting rule does not exist, the bar code and the associated special characters (if the code exists) are directly transmitted to a sending queue to wait for sending;

the single chip microcomputer completes bar code sending of all the output ports in sequence according to the mode.

Background

The test system of the factory production line usually starts the test by scanning the bar code pasted on the product with a bar code scanning gun by the detection personnel to complete the product detection. A code scanning gun used in a production line needs to have industrial-level requirements of long transmission distance, interference resistance, stability, simple configuration and the like, and an RS-232 serial port communication scheme is adopted more.

With the upgrade of the product over the years, the items required to be detected in the production line are increased, and if the original production line test system cannot meet the test requirements of new functions, the production line needs to be upgraded and modified synchronously. Considering that the original test system is old and high in upgrading cost, or the original equipment supplier does not have the detection capability of the new functions of the product, brand new detection equipment needs to be introduced, and the old equipment and the new equipment respectively perform their own functions to detect the different functions of the product. But the two devices are independent of each other, and the detection software is not compatible with each other. The conventional production detection process needs to arrange two stations on a detection line, and code scanning guns corresponding to new and old detection equipment are used for code scanning tests respectively, so that the labor cost is increased.

For the above situation, in order to save labor cost, the serial port of the code scanning gun is usually connected to the input of an RS-232 serial port distributor, and the output of the distributor is respectively connected with two detection devices, namely code scanning data of the code scanning gun is transmitted to the back-end device in two parts. Thus, only one person is required to scan the code in the production line.

Disclosure of Invention

The invention aims to provide a code scanning gun distributor, which intercepts a bar code by arranging a singlechip and filters out unwanted bar code data according to a preset intercepting rule, so that the work of simultaneously triggering a plurality of devices by one code scanning station is realized under the condition that the bar code data required by the plurality of devices are incompatible, the labor cost is reduced, and the production efficiency is improved.

In order to solve the technical problems, the invention is realized by the following technical scheme:

the invention relates to a code scanning gun distributor, which comprises a single chip microcomputer, a power supply chip and a level conversion chip, wherein the single chip microcomputer is connected with the power supply chip; the single chip microcomputer comprises a plurality of serial ports, and the serial ports comprise an input serial port and a plurality of output serial ports; the input serial port and the output serial port of the single chip are both connected with a level conversion chip; the input serial port of the single chip microcomputer is connected with a code scanning gun, and data collected by the code scanning gun is converted by a level conversion chip and then input to the single chip microcomputer; the single chip microcomputer analyzes and processes the received data and then sends the data to the back-end equipment through the output serial port; the single chip microcomputer is further connected with the plurality of status indicator lamps, and the power supply chip is used for supplying power to the single chip microcomputer.

Further, the level conversion chip is an RS-232 and TTL level conversion chip, and the single chip microcomputer is STM32F091RBT6 in model number.

Further, the single chip microcomputer comprises a flash storage module, and the flash storage module is used for storing the data information received by the single chip microcomputer.

Furthermore, the power chip is connected with an external power adapter, and the power chip supplies power to the single chip microcomputer by converting the voltage of the external power adapter.

Further, the status indicator light is used for displaying the working status of the dispenser, and the working status comprises power-on, bar code receiving and closing.

A control method of a code scanning gun distributor comprises the following steps:

the method comprises the following steps: setting of bar code interception rule

The bar code intercepting rules of each output port of the bar code gun distributor are managed by special upper computer setting software. Connecting any output port of the code scanning gun distributor with a computer serial port provided with upper computer setting software, wherein the upper computer setting software is communicated with the distributor single chip microcomputer through a communication protocol; the distributor inquires the number of output ports according to the instruction of the communication protocol, inquires and sets bar code interception rules of each output port, and automatically stores the bar code interception rules;

step two: receiving and analyzing bar code data

The single chip caches data received by the serial port by using a queue or an array, wherein the single chip judges the integrity of bar code receiving by acquiring the time interval of data receiving;

after the single chip microcomputer receives the complete bar code data, intercepting and analyzing the bar code data;

step three: barcode transmission

For the received bar codes, the single chip microcomputer selects and sends the bar codes according to the intercepting rule of each output port;

the singlechip compares the interception rule combinations of each output port one by one, and if the interception rule combinations meet the interception conditions, the bar code is not sent; if the code does not meet the intercepting rule or the intercepting rule does not exist, the bar code and the associated special characters (if the code exists) are directly transmitted to a sending queue to wait for sending;

the single chip microcomputer completes bar code sending of all the output ports in sequence according to the mode.

The invention has the following beneficial effects:

according to the invention, the bar code is intercepted by the singlechip, and unnecessary bar code data is filtered according to the preset intercepting rule, so that the work of simultaneously triggering a plurality of devices by one code scanning station is realized under the condition that the bar code data required by the plurality of devices are incompatible, the labor cost is reduced, and the production efficiency is improved.

Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.

FIG. 1 is a system block diagram of a code scanning gun dispenser;

FIG. 2 is a flow chart of the control of a code scanning gun dispenser.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to fig. 1, the invention relates to a code scanning gun distributor, which comprises a single chip microcomputer, a power supply chip and a level conversion chip; the model of the singlechip is STM32F091RBT 6; the single chip microcomputer comprises a plurality of serial ports, and the serial ports comprise an input serial port and a plurality of output serial ports; the input serial port and the output serial port of the single chip are both connected with a level conversion chip; the level conversion chip is an RS-232 and TTL level conversion chip;

the input serial port of the single chip microcomputer is connected with a code scanning gun, and data collected by the code scanning gun is converted by a level conversion chip and then input to the single chip microcomputer; the single chip microcomputer analyzes and processes the received data and then sends the data to the back-end equipment through the output serial port;

the single chip microcomputer is also connected with a plurality of status indicator lamps, the status indicator lamps are used for displaying the working status of the distributor, and the working status comprises power-on, bar code receiving and closing; the power supply chip is used for supplying power to the singlechip; the single chip microcomputer comprises a flash storage module which is used for storing data information received by the single chip microcomputer; the power chip is connected with the external power adapter and supplies power to the single chip microcomputer by converting the voltage of the external power adapter.

As shown in fig. 2, a control method of a code scanning gun dispenser includes the following steps:

the method comprises the following steps: setting of bar code interception rule

The upper computer is provided with software which is installed and operated on a computer, and the computer is connected with any output port of the code scanning gun distributor through an RS-232 serial port. The setting software and the distributor communicate by using a predefined communication protocol, the protocol supports the inquiry of the number of the output ports of the distributor, and the description, reading and setting of the bar code interception rule of each output port; the setting software has a human-computer interaction interface and can display the total number of the output ports of the distributor, the serial numbers of the output ports and the bar code intercepting rules of the output ports; the user can set the bar code interception rule of each output port independently through the interface.

The bar code interception means that when the output port meets bar code data meeting the interception rule, the bar code is intercepted and not sent; and the bar code which does not accord with the intercepting rule is normally sent. The bar code interception mainly comprises two rules, namely, the total length of the bar code is determined, and keywords of a specified position and length in the bar code are determined; wherein, the first rule and the second rule can be matched and superposed for use, such as a plurality of total lengths or bar codes containing a plurality of keywords are appointed;

the bar code intercepting rules of each output port of the bar code gun distributor are managed by special upper computer setting software. Connecting any output port of the code scanning gun distributor with a computer serial port provided with upper computer setting software, wherein the upper computer setting software is communicated with the distributor single chip microcomputer through a communication protocol; the distributor inquires the number of output ports according to the instruction of the communication protocol, inquires and sets bar code interception rules of each output port, and automatically stores the bar code interception rules;

the interception rule may include a superposition of multiple sets of rules one and two, such as outputting a barcode with 3 ports requiring interception of barcode length 12 and characters 4-7 being 6015, and a barcode with barcode length 24 and characters 1-3 being HCL and characters 21-23 being 019. The single chip microcomputer can store superposition and combination of various rules through data structures such as arrays, linked lists, structural bodies and the like;

step two: receiving and analyzing bar code data

The single chip caches data received by the serial port by using a queue or an array, wherein the single chip judges the integrity of bar code receiving by acquiring the time interval of data receiving; if no data is received for more than 60 milliseconds, the barcode data is completely received;

after the single chip microcomputer receives the complete bar code data, intercepting and analyzing the bar code data;

depending on the setting of the code scanning gun, the bar code data may be preceded by a single character such as carriage return, line feed, or a combination of multiple characters. These characters are control characters in ASCII or communication-specific characters, cannot be printed and displayed, and are mainly used for marking the start of one-frame bar code data. The singlechip needs to skip such special character segments when analyzing the bar code; when the bar code is intercepted or sent, the special character segments also need to be intercepted or sent together;

step three: barcode transmission

For the received bar codes, the single chip microcomputer selects and sends the bar codes according to the intercepting rule of each output port;

the singlechip compares the interception rule combinations of each output port one by one, and if the interception rule combinations meet the interception conditions, the bar code is not sent; if the code does not meet the intercepting rule or the intercepting rule does not exist, the bar code and the associated special characters (if the code exists) are directly transmitted to a sending queue to wait for sending;

the single chip microcomputer completes bar code sending of all the output ports in sequence according to the mode.

In the description herein, references to the description of "one embodiment," "an example," "a specific example" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种基于ResNet网络的工具识别方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!