Denvi / Candle

GRBL controller application with G-Code visualizer written in Qt.
GNU General Public License v3.0
1.35k stars 548 forks source link

Load program using barcode scanner #570

Open gozeen opened 1 year ago

gozeen commented 1 year ago

I am machining multiple different pieces which need different code every time so if there was a way to load them using a qr code or barcode scanning

ondras12345 commented 1 year ago

Why does this need to use QR codes? That would require a scanner / camera to be connected to the computer. The programs will still need to be stored as files on the computer, right? Or is it just short commands that would fit inside the code? Is this because you want to print the codes on labels and stick them on your workpieces? I'm just interested in understanding the use-case for such a feature.

gozeen commented 1 year ago

The exact requirement is, a barcode is labeled on the workpiece, which when scanned it loads the specific file for that workpiece out of many files created and saved.

Ok, here's the problem i have to machine about 500-600 pieces per day which almost look the same, meaning about 500 different g-code files that has to be selected before machining, this increase the chance of errors by selecting wrong code, and also to save time, this system would streamline my production and make sure anyone can machine it error free

ondras12345 commented 1 year ago

Alright, how about this:

gozeen commented 1 year ago

OMG that sounds amazing let me try that, well first i would have to buy a barcode scanner then try it, also a barcode generator, also a printer,

Then the files have to be properly named and barcodes to be printed accordingly.

I was thinking of adding a switch to the scanner holder, so when i lift the scanner to scan it triggers and presses Ctrl+O, then i scan it. How dose that sound.

ondras12345 commented 1 year ago

You could write a script that takes your file, automatically generates a name for it and moves it to the correct directory. There are many command line programs for generating barcodes, so there should be no problems in making your script automatically print out a label on a (thermal) label printer. Some thermal printers even support creating barcodes from text in their markup language. I'm not sure about Windows, but on Linux it should be a matter of creating a short (say 20-30 lines) shell script.

You don't need to buy a printer for a proof-of-concept, you should be able to scan barcodes shown on an LCD (although it's a bit finicky / unreliable and it won't help you with tracking the actual workpieces).

I was thinking of adding a switch to the scanner holder

I'm not sure if I would do that. You would need to make sure that you don't use your scanner for other things, because otherwise the Candle window might not be in focus every time you pick up the scanner. Sending ctrl+o to other programs could be annoying. In my experience, once you have a barcode scanner, you find that you can use it for almost everything. However, I don't know what your setup looks like. If you think it would be useful for you, I'm sure you could use an Arduino-like board to simulate keyboard presses when our switch activates. Or maybe you could generate a barcode that contains Ctrl+O that you'd scan first. I'm not sure if it's possible with common scanners though.

also a printer

Asking just to make sure: are there already barcodes on your worpieces? If yes, I'm sure you could find a way to use those instead of printing new ones. I assumed there were none and you needed to print them anyway.

gozeen commented 1 year ago

Well, i am not a programmer, i am mechanical engineer, but into mechatronics and automation,

So writing a script would be something new but i know how to, kinda.

No there are no barcodes on the workpiece, we run a panel processing unit/ modular furniture manufacturing plant, and i am trying to fix the labor issue, by automating part of the production.

I could just invest on a 6 axis drilling cnc, but thats not gonna be possible due to resent losses we faced.

Anyway thanks for showing interest, in my little endeavor, its been fun.