- Posts: 52
- Thank you received: 0
Reading Barcode data
- aluplastvz
- Topic Author
- Offline
- Senior Member
-
Less
More
1 year 8 months ago #322403
by aluplastvz
Reading Barcode data was created by aluplastvz
Hello everyone
I have an idea to use Linuxcnc to process the outer edges of the board with the X and Y position, but I want to read the barcode that contains the X and Y values and automatically start the processing, does anyone have an idea how to do it
I have an idea to use Linuxcnc to process the outer edges of the board with the X and Y position, but I want to read the barcode that contains the X and Y values and automatically start the processing, does anyone have an idea how to do it
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22008
- Thank you received: 3
1 year 8 months ago #322414
by tommylight
Replied by tommylight on topic Reading Barcode data
Probably using OpenCV (not related to LinuxCNC, github project, open source), as there are already some examples of using it with LinuxCNC, see QtPlasmaC and how it uses it to skew the whole gcode to material.
Please Log in to join the conversation.
1 year 8 months ago #322477
by rodw
Replied by rodw on topic Reading Barcode data
Yes, you would need to digitize the barcode and opencv sounds as good as any. It may have a barcode parser.
To do it yourself you would first need to determine the barcode symbology
There is a phone app called Barcode Data Decoder which will do this.
assuming a 2D symbology, barcodes usually have a start and a stop sequence. Barcode characters are made up of bars and spaces. These are defined as being multiples of the narrow bar width. If you are generating barcodes on a Zebra ZPL printer like I do, the narrow bar is defined as being 1,2 or 3 pixels wide (@203 dpi). Wider barcodes are easier to read. 1 pixel wide narrow bar is nearly impossible to read.
So then you can study up on your symbology and understand its structure.
If you are choosing the symbology, CODE39 is probably the easiest to parse at a low level but its not very compact. Code 128 is more compact but harder to parse. ref: en.wikipedia.org/wiki/Code_39
To do it yourself you would first need to determine the barcode symbology
There is a phone app called Barcode Data Decoder which will do this.
assuming a 2D symbology, barcodes usually have a start and a stop sequence. Barcode characters are made up of bars and spaces. These are defined as being multiples of the narrow bar width. If you are generating barcodes on a Zebra ZPL printer like I do, the narrow bar is defined as being 1,2 or 3 pixels wide (@203 dpi). Wider barcodes are easier to read. 1 pixel wide narrow bar is nearly impossible to read.
So then you can study up on your symbology and understand its structure.
If you are choosing the symbology, CODE39 is probably the easiest to parse at a low level but its not very compact. Code 128 is more compact but harder to parse. ref: en.wikipedia.org/wiki/Code_39
Please Log in to join the conversation.
1 year 8 months ago #322478
by rodw
Replied by rodw on topic Reading Barcode data
An alternative could be to use a barcode scanner. These will plug into your computer as a HID keyboard device. There are some small barcode modules that are RS232 devices.
www.aliexpress.com/item/1005007002453623...OfpGuWBoClGYQAvD_BwE
Please Log in to join the conversation.
1 year 8 months ago #322487
by Hastrh2o
Replied by Hastrh2o on topic Reading Barcode data
Forgot OpenCV, and use a barcode scanner.
I do this way to scan the worksheet and load the G-Code according to the type of part which I need to machine. The bar code scanner act as a keyboard, and I use a few python in the handler.py file to get what I need.
I do this way to scan the worksheet and load the G-Code according to the type of part which I need to machine. The bar code scanner act as a keyboard, and I use a few python in the handler.py file to get what I need.
Please Log in to join the conversation.
- aluplastvz
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 52
- Thank you received: 0
1 year 7 months ago #323368
by aluplastvz
Replied by aluplastvz on topic Reading Barcode data
I was a bit busy with other work, so I didn't respond to your answers earlier.
The barcode has 2 series of numbers with 5 characters x+y, I can do that in the plc controller, but only the positioning is the hardest part for me, that's why I thought that maybe there is a solution, for example in linuxcnc, which is much better for positioning.
The barcode has 2 series of numbers with 5 characters x+y, I can do that in the plc controller, but only the positioning is the hardest part for me, that's why I thought that maybe there is a solution, for example in linuxcnc, which is much better for positioning.
Please Log in to join the conversation.
1 year 7 months ago #323522
by Hastrh2o
Replied by Hastrh2o on topic Reading Barcode data
@noqui
In the ui, I add a lineEdit wich I named "ofedit" (and some more) and then in qtaxis_handler.py I add (the except part is just here to allow me to try without the thrue work order barcode) :
def ofedit_changed(self):
if len(self.w.lineEdit.text()) == 16:
try:
codesData = pd.read_csv('codes_articles.csv', index_col=0)
self.w.lineEdit_3.setText(self.w.lineEdit.text()[0:16])
self.w.lineEdit_2.setText(codesData.loc[self.w.lineEdit_3.text(), "Variante"])
except :
self.w.lineEdit.setText("EJEVAP17050---M")
self.w.lineEdit_2.setText("")
self.w.lineEdit_3.setText("")
pass
This allow to look into a csv file for the work order code if I read something which is 16 caracters long with the barcode reader
In the ui, I add a lineEdit wich I named "ofedit" (and some more) and then in qtaxis_handler.py I add (the except part is just here to allow me to try without the thrue work order barcode) :
def ofedit_changed(self):
if len(self.w.lineEdit.text()) == 16:
try:
codesData = pd.read_csv('codes_articles.csv', index_col=0)
self.w.lineEdit_3.setText(self.w.lineEdit.text()[0:16])
self.w.lineEdit_2.setText(codesData.loc[self.w.lineEdit_3.text(), "Variante"])
except :
self.w.lineEdit.setText("EJEVAP17050---M")
self.w.lineEdit_2.setText("")
self.w.lineEdit_3.setText("")
pass
This allow to look into a csv file for the work order code if I read something which is 16 caracters long with the barcode reader
Please Log in to join the conversation.
Time to create page: 0.090 seconds
