I am trying to create an application which reads IDs of blood samples via a barcode reader. How do I read a barcode from a barcode reader into a Java Application for further processing (e.g pulling patient details from database)? Example code and explanations much appreciated.
P.S same applies to fingerprint reader, also need to be able to pull data from database based on usb fingerprint reader. how do I get fingerprint reader data into the java application for further processing?
Thanks in advance,
Tumaini
It really depends on the hardware you are using (i.e. The Barcode scanner) most scanners simulate keyboard input and will for example write a string of numbers + a termination character.
e.g. 1 2 9 7 6 5 [ENTER]
If your hardware does simmilar you will be able to trap this as text input in Java - no specialist coding needed.
A simple way to test what your hardware does is open up a text editor, scan a barcode - then view the output on the screen (with special characters included)
Related
I am a trying to print Shipping labels from a website to my TSC DA310 thermal printer. I have installed QZ tray locally, but my printer is printer Raw commands instead of the shipping label along with the barcode etc. Anyone else faced a similar issue?
Quoting the DA310 user's manual, this printer has a special "TSPL-EZD" firmware which emulates
"out of the box" the following label formats:
Eltron® EPL command emulation
Zebra® ZPL command emulation
Datamax® DPL command emulation
To quote the original symptom:
my printer is printer Raw commands instead of the shipping label along with the barcode etc.
Since all shipping providers provide commands in one of the above formats, this suggests that the vendor-provided driver may be interfering with the printing.
One way to bypass the driver is to change it from TSC DA310 to Generic / Text Only using Printer Properties, Advanced, New Driver.
Since this printer driver is provided by a 3rd party (at time of writing, a company called "Seagull Scientific") you may consider reaching out to Seagull Scientific with this particular problem. At time of writing this, te default driver does not seem to offer any configurable options regarding specifically to language emulation.
If all else fails, reach out to TSC technical support to see how to send raw label commands to their hardware.
TSC technical support will want to know which label format you are sending. To find out, see the following reference:
ZPL usually looks like this: ^XA ^FO ...
EPL usually looks like this: N q812 Q1218 B5 ... A310 ..
DPL usually looks like this: <STX>L D11
Lastly, for help using the TSC-series printers with QZ Tray (per qz-tray tag), you may reach out directly to support or ask a new question and link it here in the comments.
I'm trying to read data from the Yost Labs 3-Space Sensor Nano into LabVIEW via an NI MyRIO (1900). I was able to set up a sequence that communicates with the sensor through SPI. However, every time I run the program, it just spits out a single value of 255.
I think understand that I need to include something that allows all the bytes to be read. I just don't know how to go about it.
As an example, I'm trying to read the gyros (0x26) which have a return length of 12 and is a vector (float x3).
Here is my labview code
and here is the manual for the sensor. The commands I'm using are on pages 29-33. In the image, 0x2B is 'read temperature'.
Any help would be greatly appreciated! Thanks :)
Edit: i had messed up the wiring so now the output jumps between ~35 to 255. I'm still having trouble getting all 3 gyro values from the SPI read.
Quoting from Joe Friedrichsen in his comment:
The express block that resets the sensor is not guaranteed to precede the loop because there is no data flow between them. The LabVIEW runtime can see two independent and parallel groups and may choose to execute them simultaneously (which on the wire might mean reset comes between loop commands) or in "reverse" order. Add a wire from reset block to create a terminal on the loop.
Here's a picture of the fix.
You may wish to consider stringing the error wire through your program and wiring it to the stop terminal of the While Loop. Currently, your loop will keep running even if there's a fault in your hardware. Using the error wire would eliminate the need for the flat sequence structure.
I know that this is an old topic for vfp programmers. Still, I want to ask for advices that can improve the printing time for my particular case.
I recently asked to change a report written in vfp. It use commands such as fputs, etc. The user prints this report in a dot matrix printer and of course : no problem. But the user asked for column addition and some complex calculation in the report. We tried to avoid paper size changes. So my initial solution was to rework the report using report designer, and set the page orientation to landscape. The result is so slow when printed.When I open the print queue, it even shows error - printing status!
I've tried to instal the printer driver in my local PC ( the machine where I compiled the exe) and selected this printer, both with 'save printer environment' checked and unchecked. Still the same result.
Any suggestions? Other tricks for my case are welcomed. Thanks in advance.
Sometimes, and not sure if its your case, when creating a report in VFP, it saves the printer environment based on the computer used to develop it (ie: your machine). To check, and since all reports are nothing but .DBF tables renamed, try the following. Open the report as a table
USE YourReport.frx (you have to explicitly include the .frx extension)
BROWSE
The first line in the report is your environment information that includes paper size info, orientation and even printer information. Double click in the column "Expr". The only things you probably need in this column are
ORIENTATION=1 (or 0)
it may have other stuff and look something like
DRIVER=winspool
DEVICE=\some\printershare
OUTPUT=IP_192.168.1.22
ORIENTATION=1
PAPERSIZE=1
SCALE=100
ASCII=0
COPIES=1
DEFAULTSOURCE=15
PRINTQUALITY=600
COLOR=2
DUPLEX=2
YRESOLUTION=600
TTOPTION=3
COLLATE=0
You can remove the rest of it. Next, close this column and tab over about 10 more columns to "Tag" and "Tag2". They are also MEMO type fields. Open them up. Remove ALL data out of these two columns... BUT ONLY FOR THE FIRST ROW!!!! If you open them, you would see more embedded stuff about the printer, just remove it completely. Do NOT do a global replace to blank for all rows as that will kill the report content... ONLY the first row.
All this being said, I can't guarantee, but it may be the culprit... but then again, doing direct output on old dot-matrix printers might actually be faster than all the fancy rendering the printer drivers are doing.
Trying to print a report from the report designer through the windows driver to a dotmatrix printer will never be acceptably quick.
That's why they originally did the report using commands.
Your choices are either change the printer to a laser printer (probably not possible I'm guessing) or change the report back to the old style.
It's hardly difficult to print fast on a dot matrix printer with VFP reports, you should do it on a raw mode, but not on ?? or ??? way, I mean on API calls like this:
--- RawPrint VCX ---
http://www.universalthread.com/ViewPageNewDownload.aspx?ID=9556
You can use a wrapper, with kind-of "Formats" support it's a commercial software but it's worthy if you need to do a lot of reports with this kind of printer:
--- DosPrint 4 ---
http://www.victorespina.com.ve/hs/es/index.php/DOSPrint4_%28VFP%29
(disclaimer: the developer of DosPrint 4 it's a friend of mine, and I worked with him testing and supporting on the previous version DosPrint 3 on the spanish MS-VFP newsgroups and http://Portalfox.com)
Try using the Microsoft Generic Text only print driver
I have to set up a system for an online-pass generator using barcodes.
The module i developed lets the admins set which codes are available, and when a user requests a pass, the php script generates a jpeg of the pass with a small barcode print at the bottom.
The barcode is generated using:
http://www.dafont.com/3of9-barcode.font
Q: Are those barcodes universal? I need to know if the barcode scanner will work on those printed passes.
There are actually quite a few different sets of barcode characters out there. You need to find out which standard the scanners that will be reading the codes will use and find a font or generator that supports that standard.
See http://en.wikipedia.org/wiki/Barcode#Symbologies for a list of them.
mikeschuld has provided good information about barcode printing and scanning. My experience has been that Code 39 is one of the most pervasive barcode formats and every scanner that I have run into has been configured to read Code 39 barcodes by default.
I am working on reading the barcode using a scanner and I have the following questions:
Is there a way to distinguish between the input from the keyboard and input from the scanner ? This is required for me because the barcode reader will include a preamble, terminator and a prefix to the barcode value. For ex, if the value is 12345 the barcode will have \pre12345\ where \ and \ indicate the start and end and pre identifies the type of data.
If I know that the data is being typed from keyboard and not from a scanner then I would show whatever the user types.
If I know that the data is from a scanner then I will strip of the \pre and \ and show only the data.
Thanks,
My answer assumes that you are using a barcode scanner in "keyboard wedge" mode where it simply emulates a keyboard and does not have some special connection. These devices are often USB and work this way out of the box without any further configuration.
Would the user ever have occasion to actually type your \pre text? Often the prefix is chosen specifically to be a set of characters that the user will never enter or will at least very rarely want to enter. Thus, the mere presence of the prefix indicates a scanned barcode.
Another option would be to time the input. For example, the input from the barcode scanner will probably all be complete within a very short time (e.g. 50ms). If a user were typing the value via the keyboard, it would be impossible for him/her to type the prefix, the data and the postfix all within 50ms. (Of course, assumption here is that input will be made by an actual human and not by automated tools)
well yes! input from the barcode scanner should have first initialized itself through a COM port or serial connection. I know that many apps restrict input to certain field through specific ports, but beyond that I'm not sure.
One solution that I came up with was to start all of our barcodes with a unique sequence of characters not known to the user. I check for this sequence on the input to tell me how the data was entered.