Home > Software engineering >  Someone played to read data from wireless scanning gun receiver?
Someone played to read data from wireless scanning gun receiver?

Time:09-26

Scanning gun divide into two kinds, wireless and wired USB cable, the general points and COM interfaces,
For USB cable scanning gun, the cursor will always locate in the need to accept the location of the data, if the cursor is in other place, can't read scanning data, this is a drawback,
Scanning gun of the COM interface, write code to read data from the COM interface, so incompetent cursor is positioned in need to accept the location of the data, data can be read to want,
A few days ago, bought a 299 yuan wireless scanning gun, want to play, after use, found that the wireless receiver scanning guns will write scans the data on the cursor, like USB limited scanning gun, end I move the cursor to accept the rest of the data, then receive data text box will not be able to access scan data, which is a drawback, the only way to solve is to write their code from the receiver to read data, you need to suppliers provide interfaces to just go,

CodePudding user response:

It is not malpractice, but your development train of thought is wrong,
For data that call data acquisition hardware, you don't consider how to stable data, but simply bring test way to work, there must be a problem,
You should try to how to monitor these interface returned data, rather than waiting for what the cursor, and then to read what text attributes,
If change the pure graphical interface or no interface daemon needs to you, can't use this kind of input control, estimate your device waste,
So you should change your mind,

CodePudding user response:

The solution:
1. Buy the COM wireless scanning gun
2. Buy a USB interface, but the other party have tools to provide USB to COM

CodePudding user response:

The general customer service at the front desk is not program has been opened, such as supermarket checkouts, the other is not necessarily a cursor, form also can receive keys, form a keypreview properties, estimation is set of properties for solving this problem,

CodePudding user response:

With the scanning gun, USB is Windows system has integrated the corresponding driver, by default, only will write corresponding to the cursor,
If you want to do, need to develop the corresponding driver,

CodePudding user response:

Scanning gun is an input device, which can be as a keyboard, the keyboard type to the cursor: how do you read data? Don't hook system messages? Words you buy expensive wireless scanning gun, I buy only more than one hundred yuan,

CodePudding user response:

refer to the second floor CJHLPLFX response:
solution:
1. Buy the COM wireless scanning gun
2. Buy a USB interface, but the other party have tools to provide USB to COM

Collect data serial port is more convenient, but if only the simulation of the keyboard scanning gun can also easily get, actually
Use a timer to read key code, for example, because usually scan are 39 barcode scanning gun, 39 yards will often begin with *, * end,
So only in the timer kept judge whether there is a * press ok, at the same time record the change of the model and the one character at a time,
When the first *, you can adjust the steps to receive strings and Numbers, appears in the first * decided to the length, in the number of timer
Sampling characters so that you can do is a fixed length, when encounter * again, and the data format of legal, can trigger the end of the scanning process,
If the sampling period character length illegal or too long did not meet such as * please, just reset the sampling step parameters (equivalent to abandon package),
So your key code acquisition would have stability,

CodePudding user response:

Actually a similar approach even on the serial port acquisition is necessary, if you don't do this, program may not be stable, after all, a different machine, different number of tasks can affect a serial port communication, low high configuration and configuration of computer to run this program may have different results, if your program also involves to the network, graphics, data operation, the low in the configuration of computer are more likely to be a problem, so the data collection and abandon packet processing is needed to do, do not, of course, sometimes also can be used, but recommend to do it to,

CodePudding user response:

reference 5 floor sysdzw reply:
scan gun is an input device, can be developed just the same as the keyboard, the keyboard type to the cursor: how do you read data? Don't hook system messages? Words you buy expensive wireless scanning gun, I buy only more than one hundred yuan,

Hook is not good processing
Actually is equal to the keyboard, not too good, you have partly ps2 mouth, and ps2 keyboard is an input, more not distinguish
But upstairs said is very right should be in the background of their own monitoring pretreatment is better
  • Related