| View previous topic :: View next topic |
| Author |
Message |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sun Dec 11, 2005 3:41 am Post subject: Bar code reader? |
|
|
I'm wondering if anyone has tried reading bar codes with VDS.
I know a while back Tommy wrote VDSBAR an extention that can create bar codes. I'd like to be able to read them also.
I'm sure this would require communicating with a COM port that would have the physical reader attached.
Thanks,
Aslan |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Dec 11, 2005 4:09 am Post subject: |
|
|
If you're looking for an inexpensive barcode reader (ex. US $5), then look
on eBay for something called the "CueCat". _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sun Dec 11, 2005 4:44 am Post subject: |
|
|
| Thanks, I already have access to a scan device. I want to capture the data in VDS if possible. |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Mon Dec 12, 2005 2:38 am Post subject: |
|
|
Hey thanks Hooligan
I knew someone had a dll for COM ports.
Your right interpeting the data is going to be the fun part  |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Fri Dec 16, 2005 8:35 am Post subject: |
|
|
I was able to configure the barcode reader I used in my project to export the data like it was typed at the keyboard - it was just a matter of hooking the barcode reader between the PC and the keyboard, and the reader would simply fake the keypresses. I believe most of DataLogic's barcode readers can add "header" keystrokes before the actual barcode, and that's how I made VDS response to it. What it basically does is that it hits F11, waits for a while (by sending 3x the ctrl keypress, which doesn't do anything), sends the actual barcode and finally it "hits" the enter key.
The script itself has a hotkey event hooked up to the F11 key, which creates a simple dialog with a single input field an a (default) button, moved outside of the user's screen. It's not the best solution I could think of, but it saves you the hassle of working out how to communicate with it through the COM port and all the error checking that comes with it. The barcode reader I used didn't supported communication through COM anyway, although I must admit that I thought about returning it to the store and getting one which did supported COM communication; hidden dialog screens and all are not what I would call "professional programming".
One thing you will have to keep in mind either way is that your barcodes will need some sort of validation (at least, if your application will generate them as well). I used the following function which basically adds a check digit to the end of each barcode you pass along with it, maybe it's of any use to you:
| Code: | :gen_barcode
%i = 1
%%Barcode_CheckSum = 0
while @unequal(@succ(%i), @len(%1))
%%Barcode_CheckSum = @sum(%%Barcode_CheckSum, @prod(@asc(@substr(%1, %i, %i)), 2))
%i = @succ(%i)
if @equal(@len(%1), 1)
%i = 0
end
wend
%%Barcode_CheckDigit = @format(@fdiv(%%Barcode_CheckSum, 100), .0)
if @greater(%%Barcode_CheckDigit, 9)
%%Barcode_CheckDigit = 0
end
exit %1%%Barcode_CheckDigit |
Good luck with your project
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sat Dec 17, 2005 4:12 pm Post subject: |
|
|
Thank you very much Vic. This at least gives me a starting point and some options as to which way to go with it.
Thanks again! |
|
| Back to top |
|
 |
|