Barcode scanning to run gcode
- beltramidave
- Offline
- Elite Member
-
Less
More
- Posts: 174
- Thank you received: 4
03 Apr 2016 11:20 - 03 Apr 2016 11:27 #72614
by beltramidave
Replied by beltramidave on topic Barcode scanning to open gcode
Sorry for the short reply. I thought it was someone here that helped me figure this out before.
In Linuxcnc, the keyboard shortcut to open a file is the lowercase o. If you include o in your gcode filename (otest.ngc)
and then create a barcode from that filename, scanning it will open the file.
I used an free online program to create the barcode. I was using a Honeywell scanner 3800G. There is also a way to run the program too. Will try and find that doc from Honeywell. I decided not to use that as I wanted the operator to make sure they were ready first.
Was really quite simple. Hope this helps.
In Linuxcnc, the keyboard shortcut to open a file is the lowercase o. If you include o in your gcode filename (otest.ngc)
and then create a barcode from that filename, scanning it will open the file.
I used an free online program to create the barcode. I was using a Honeywell scanner 3800G. There is also a way to run the program too. Will try and find that doc from Honeywell. I decided not to use that as I wanted the operator to make sure they were ready first.
Was really quite simple. Hope this helps.
Last edit: 03 Apr 2016 11:27 by beltramidave.
The following user(s) said Thank You: eFalegname
Please Log in or Create an account to join the conversation.
04 Apr 2016 12:03 #72703
by andypugh
I assume, then, that your barcode scanner acts as a keyboard emulator and sends keystrokes?
I am sure there must be more resilient ways to do it
Replied by andypugh on topic Barcode scanning to open gcode
In Linuxcnc, the keyboard shortcut to open a file is the lowercase o. If you include o in your gcode filename (otest.ngc)
I assume, then, that your barcode scanner acts as a keyboard emulator and sends keystrokes?
I am sure there must be more resilient ways to do it
![:-) :-)](/media/kunena/emoticons/smile.png)
Please Log in or Create an account to join the conversation.
- beltramidave
- Offline
- Elite Member
-
Less
More
- Posts: 174
- Thank you received: 4
04 Apr 2016 12:23 #72705
by beltramidave
Replied by beltramidave on topic Barcode scanning to open gcode
I am sure there are other and possibly better ways, but this is what I came up with...with my very limited knowledge of Linux and scanners.
Please Log in or Create an account to join the conversation.
- eFalegname
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 253
- Thank you received: 30
04 Apr 2016 17:15 - 04 Apr 2016 17:19 #72728
by eFalegname
Replied by eFalegname on topic Barcode scanning to open gcode
Sorry for not answering before I was looking for a convenient and reliable barcode scanner and found this which is completely linux compatible
Inateck BCST-20 WiFi
I was able to add to the axis-remote script the -R (--run) command to start the opened Gcode in Axis (following ArcEye axis-remote for version 2.6 of linuxcnc), then I modified the bash that JT suggested:When the Barcode scanner arrives I will be able to continue looking for a solution because now I don't get how you can run a python script and a Gcode from a barcode label...I'm a bit confused.
I was able to add to the axis-remote script the -R (--run) command to start the opened Gcode in Axis (following ArcEye axis-remote for version 2.6 of linuxcnc), then I modified the bash that JT suggested:
if axis-remote -p
then
axis-remote /home/efalegname/linuxcnc/nc_files/matrix_1.ngc
axis-remote -R
fi
Last edit: 04 Apr 2016 17:19 by eFalegname.
Please Log in or Create an account to join the conversation.
04 Apr 2016 18:06 - 04 Apr 2016 18:55 #72731
by BigJohnT
Replied by BigJohnT on topic Barcode scanning to open gcode
I wrote a little python script this morning that when ran will scan one bar code with a USB webcam then send the parsed results to axis-remote to load the file. I don't have the code in front of me right now or I'd share.
JT
JT
Last edit: 04 Apr 2016 18:55 by BigJohnT.
Please Log in or Create an account to join the conversation.
- eFalegname
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 253
- Thank you received: 30
04 Apr 2016 20:20 #72736
by eFalegname
Replied by eFalegname on topic Barcode scanning to open gcode
well I'm almost desperate I want to see the script so I can go to sleep tonight please Big John share it
Please Log in or Create an account to join the conversation.
04 Apr 2016 21:00 - 04 Apr 2016 21:11 #72739
by TurBoss
Replied by TurBoss on topic Barcode scanning to open gcode
Hi
Can you set the scanner to send data via rs232
I was able to do it with a honeywell voyager just by change the wiring (specified in manual)
so you dont have to focus the app to get the data
edit: sry nothing in the manual indicates that this is posible
Can you set the scanner to send data via rs232
I was able to do it with a honeywell voyager just by change the wiring (specified in manual)
so you dont have to focus the app to get the data
edit: sry nothing in the manual indicates that this is posible
![:( :(](/media/kunena/emoticons/sad.png)
Last edit: 04 Apr 2016 21:11 by TurBoss.
Please Log in or Create an account to join the conversation.
06 Apr 2016 22:54 #72876
by BigJohnT
Sorry got side tracked this morning trying to get someone up and going... I'll dig it up in the am and post it.
JT
Replied by BigJohnT on topic Barcode scanning to open gcode
well I'm almost desperate I want to see the script so I can go to sleep tonight please Big John share it
Sorry got side tracked this morning trying to get someone up and going... I'll dig it up in the am and post it.
JT
Please Log in or Create an account to join the conversation.
- eFalegname
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 253
- Thank you received: 30
07 Apr 2016 07:50 #72896
by eFalegname
ok I'm still waiting for you without shutting down the computer.
Replied by eFalegname on topic Barcode scanning to open gcode
![:laugh: :laugh:](/media/kunena/emoticons/laughing.png)
Please Log in or Create an account to join the conversation.
07 Apr 2016 11:20 #72900
by BigJohnT
Replied by BigJohnT on topic Barcode scanning to open gcode
Ok, here you go... it's rather short and lacking in the error checking department but functions.
#!/usr/bin/python
import os
import subprocess
from sys import argv
import zbar
# Create a Processor
proc = zbar.Processor()
# Configure the Processor
proc.parse_config('enable')
# Initialize the Processor
# more checking is needed here as it might be video1
device = '/dev/video0'
if len (argv)> 1:
device = argv [1]
proc.init (device)
# Enable the preview window
proc.visible = True
# Read at least one barcode (or until window closed)
proc.process_one()
# Hide the preview window
proc.visible = False
# Extract results
for symbol in proc.results:
# Do something useful with results
print 'decoded', symbol.type, 'symbol', '"% s"'% symbol.data
file = os.path.expanduser('~') + '/linuxcnc/nc_files/' + symbol.data
print file
if subprocess.call(['axis-remote', '--ping']) == 0:
print 'Axis is running'
subprocess.call(['axis-remote', file])
else:
print 'Axis not found'
Please Log in or Create an account to join the conversation.
Time to create page: 0.113 seconds