Code 39 barcode scans a different value when using a USB scanner and a phone camera scanner - barcode

Really hope that somebody will be able to help with this as I'm near losing my mind trying to understand why this happens.
I'm getting different results when scanning the same value in a Code 39 barcode using a regular USB barcode scanner and using my phone camera.
When scanning the value of 482168 using the barcode scanner, I get a value of 142673096 pasted into notepad;
When scanning the value of 482172 using the barcode scanner, I get a value of 142673122 pasted into notepad;
Values 482169 and 482171 are pasted correctly.
I thought initially that the problem was with the app that generates these barcodes, however, the same is happening when these are generated here https://barcode.tec-it.com/en/Code39FullASCII?data=482168
I thought that the length and width of the barcode may have been the problem, but adjusting them did not have any effect.
Has anyone ever stumbled upon anything similar and could suggest why these would be read and encoded differently?

I found this problem to be really interesting, so I compared the various barcode types to see what could be causing the scanner to mis-identify the barcodes. It turns out that Italian Pharmacode (also known as Code 32) is an exact match. Code32 is actually code39 using a compression scheme.
Here is 482168 in code39:
And 142673096 in code32:
It looks like your scanner is prioritizing code32 over code39. So you just need to disable code32 in your scanner.

Related

What kind of Barcode hash/encryption is this

I am scanning from a barcode reader but it shows every thing like this the string like this when it scans
L008EtZmqQ41daYYVhz000007IU7I#
L00A3RZmqRKOMmp13hy000007IU7I#
But when I use their software the output will be like this which is the actual value which I need it
07117340277500r
Bottom is the barcode image which I scans, Can anyone tell me what kind of the barcode type is this or any other way to decrypt the above mentioned codes into the actual value it would be great help
Looks like its a Code 39 barcode, look if there's some library or something to decode it.
Source: https://barcode-labels.com/getting-started/barcodes/types/

Is there a way to generate working Code128 barcodes in TD 6.3?

I am currently working on a project that requires the output of a Code128 barcode to a QRP.
It's an older project ported from TD 4.1, it previously used a barcode.dll that doesn't work properly with 6.3.
Since I couldn't find a DLL that would work, I decided to try and use the Code128bWin project from the Sample Vault (https://samples.tdcommunity.net/index.php?dir=&file=Code128bWin.zip).
Now, the problem is, the function used there generates barcodes just fine, but they're not scannable and I can't figure out why.
I'm still fairly new to Team Developer, so maybe the problem is totally obvious and I'm just not seeing it, or maybe there is a simpler way to generate the barcode, but I've been stumped on this for days now, and getting nowhere.
I would be appreciative of any help.
Starting with the obvious - have you tried a UNICODE version of your 'barcode.dll' , as TD6.3 is UNICODE based, or maybe your existing one is UNICODE compliant, but 'not working properly' as you haven't changed your TD string parameters and buffer sizes to UNICODE in your api calls.
e.g. String: LPSTR becomes String: LPWSTR and also bear in mind SalSetBufferLength(20) before an api call will allocate 20 bytes of storage, but be aware that 2 of these bytes will be used as a null terminator. Therefore, to send /receive the barcode string '*4>HR\fpzg' you would need to give the buffer 22 bytes of storage. Could be why your existing dll is not working properly.

Debug printed barcode (code 128)

We have a software which generate a document with barcodes (code 128) included. It's an old close software so for us is a blackbox and we can't modify the output (document template, font, etc.). Usually the generated barcode work without problems, but sometimes is not possible read it. With this problematic codes we tried several barcode scanners and mobile apps without success.
The encoded string has the format:
productID/personID/category
and sometimes changing a single character broke the code. Just right now I have 2 codes just with different categories, and one of them is not working:
OK: (149339/20/G_MA_Loet)
WRONG: (149339/110/R_MA_DIV)
I tried visually compare both codes and I believe the 'start char.' and 'stop char.' look the same. I guess the checksum value can be wrong(?)
I'm trying to debug the problem and I was looking for a way get a 'raw' output from the bars in binary and compare it with the Code128 encode values 128, but I didn't find any tool for it.
I don't have previous experience with barcodes. Now I'm stuck and I don't have idea how debug the problem: it's a software bug? a font bug? Do you have some idea what more to try?

Zxing sometimes picks up the wrong data from barcode

I know this might be rather a simple issue to ask for and we can also set the barcode format to be scanned by Zxing, like this:
(1)intent.putExtra("SCAN_MODE", "QR_CODE_MODE"); //or any other format
if we do this:
(2)intent.putExtra("SCAN_MODE", "SCAN_MODE"); //for all modes`
While doing the #2 mentioned right above this line, the scanner sometimes seems to scan part of the barcode and picks up wrong information. For example if I try to simply scan a UPC barcode, 98% of the times it works beautifully, but sometimes it just returns me a wrong barcode. I think I know whats happening here, I have an idea up in my head, but what is the exact technical explanation for this? (Anyone familiar with barcodes can help) Thanks in advance guys.
SCAN_MODE is not a valid value. It is ignored and you are scanning for all formats.
It is not reading the wrong information from a barcode; it is finding a 'phantom' barcode among all those white and black lines, of another format. The usual culprit is UPC-E, which is the easiest to accidentally see.
This is why it is far better to restrict the scan to the format you are interested in with a correct value of SCAN_MODE.

Way to compare two barcodes

I have two barcodes that I am working with. They are clearly different, but both scan as code 128. One is weird and one is normal. I have tried to reprint the data for the barcode in every way I can think of to I can see what subset (A, B or C) is being used.
For the normal one I know it is A for the first 10 chars then it changes the encoding to B.
I cannot seem to find out how to see what the encoding is on the other (weird) one.
I am using a symbol scanner. (I turned on the prefix char but that only told me D (Code 128)
Is there any tool to allow me to dig into the barcode symbologies?
I know very little about barcodes and zero about non-european ones, but for weird implementations of Code 128, there is also GS1-128.
This online barcode generator looks quite nice and can generate a lot of formats you might want to check against.
Chiming in late here, but the ZXing library (I'm a developer) reads Code 128. You could have it scan the barcode while you attach a debugger to the code. It would show you exactly what's happening, step by step, in the decoding, including subset changes.
I know the problem is fixed. But here's some more resource in case someone's in need :)
Like Pekka mentioned, a Code 128 have subsets like Code 128A, Code 128B, Code 128C and GS1-128(UCC/EAN-128). Here is more information on Code 128 barcode, with encoding pattern illustration.
Thanks for those that answered and commented.
Turns out the company that made our barcodes had a printing error. That caused the barcode to look different.
How it ever successfully decoded I do not know. Anyway. I am going to award the question to Pekka because he gave me a workable solution.

Resources