Warm tip: This article is reproduced from serverfault.com, please click

Weighing Scale Barcode Reader C#

发布于 2020-12-10 09:47:26

how can I convert an EAN-13 or Code-128 barcode generated from a weighing scale machine back to a user-defined object?

Class Product
{
  string name = "Apples";
  deciaml qty = "0.5";
  double value = "5";
}

I already found libraries but all decodes barcode provided as an image. in my case, I have a barcode reader which will be reading the barcode label and input it as numbers something like (2032156478954).

what library or how can I decode those barcode numbers back to my object?

assume that I know from the user manual of the weighing scale which part is the product name, qty, and value

just like those label barcode we see in hypermarkets where you buy fruits and veggies in KG or Gram, it prints a barcode label, then the barcode label on POS is converted back to product object.

I am totally new when it comes to handling barcodes in .NET, any help, suggestion, or advice will be appreciated.

Example of Weighing Scale Barcode

Questioner
San04
Viewed
0
San04 2020-12-11 00:45:22

Currently, I have solved it by implementing my own solution.

assume the barcode is 2 53647 2 5262 9 (EAN-13)

from the left-hand side, 2 tells the POS this is a barcode from the weighing scale machine, 53647 will be the ID of the item in the database. 2 tells the POS next 5 digits are the price of the item (52.62) the last digit always discarded

the downside of this method is you will have to change either the settings of your weighing machine for every new setup you make to match your function. or you will change your code to match how the machine is printing barcodes since there is no one international standard.

I was hoping for a library that would have built-in functionality to recognize and decode those barcodes based on leading numbers and other check numbers. I might start building my own after looking at the most used formats.