Pages: [1]   Go Down
Author Topic: Barcode Scanner  (Read 3633 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been trying to get the Metrologic MS3580 to work with the PS2Keyboard library. Previously I was able to get a Symbol barcode scanner to work without changing in configuration from their defaults on the Sysmbol.

They sysbol uses a Y splitter, however, the Metrologic has only a PS2 6pin DIN.

After setting up some debug statements "Serial.print" lines in the PS2Keyboard.cpp I noticed the data from the Metrologic does not seem to reflect data in the key map array?

I've tried the Metrologic on a PC and like the Symbol it works fine. Basically juse brought up notepad, scanned a few bar codes and compared to the Symbol, they were the same. So the device is obviously working ok.

Any Ideas or thoughts on how I can get this device to work?

Hope someone can help with this, thanks.

Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From reading the user's guide (yes I know it's Honeywell but metrologic.com lands at Honeywell's site), this device appears to have multiple communication formats available, and specifically two different keyboard modes. Try scanning the "Enable Stand-Alone Keyboard Emulation" barcode on a print-out of the first page of Section H of the Metroselect Configuration Guide.  This is might help because according to the documentation the non-keyboard wedge versions default to the RS232 communication protocol, not stand-alone keyboard emulation mode.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey thanks for responding...

Yes, I have tried to configure the scanner as you suggest but had no luck.
I've added code to the PS2Keyboard library to view the incomming resposes:

"In Part from: PS2Keyboard.ccp"

static char get_iso8859_code(void)
{
   static uint8_t state=0;
   uint8_t s;
   char c;

   while (1) {
      s = get_scan_code();
   
      if (!s) return 0;

      Serial << "c: " << _HEX(s) << endl;
...
Result was:
c: 16
c: F0
c: 16
c: 8A
c: E0
c: 8A
c: 15
c: C1
c: 15
c: 2B
c: 82
c: 2B
c: E6
c: 6
c: E7
c: AE
c: 8
c: AF
c: 58
c: 11
c: 5F
c: 31
c: 31
c: 3F
c: 71
c: 6B
c: 7E

The scanner works fine, as does the sysbol, when connected to a
computers PS/2 connector. Just can't make heads or tails out of the
Metrologic response...

Any Ideas, When connected to the PC I made shure to scan the
factory default configuration scan code first. Then once it worked
connected to the 328 UNO board...

Maybe the key map is different somehow???
Thx!
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any Ideas, When connected to the PC I made shure to scan the
factory default configuration scan code first. Then once it worked
connected to the 328 UNO board...

My reading of the documentation is that factory default configuration will set it to use RS232 and you don't want that.  If you haven't tried the stand-alone keyboard emulation code in the Keyboard Section, you need to try that next.  If you have and it behaves the same, then maybe I'm misinterpreting the documentation.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interesting results,

While chasing down this issue I placed several Serial.print statements within the get_iso8859() function and started getter spurious results back. Sometimes the complete barcode is returned other times no barcode or only partial.

Thinking it is a timing issue I added a delay(25) after the while(1) loop and now barcodes are returned correction 90% of the time. The other 10% returns either sporadic results or nothing at all.

I found some delay configuration commands for the scanner and tried them all except "variable delay". While they affected the value I placed in the delay(25) statement it did not improve the correction percentage.

Could this have something to do with the interrupt vector routine or am I chasing lost bytes?

Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could this have something to do with the interrupt vector routine or am I chasing lost bytes?

Not having ever used this reader, I can't be sure.  However, your results do indicate that timing is at least a major symptom, if not the cause of your issue.  If you haven't tried the variable delay setting, undo any delay you've put in your code and try that.  Other than that, I'm don't think I'll be able to offer much more meaningful suggestions.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 18
Nth. Canty - NZ
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I dont know if this is any help, but I have a heap of barcode scanners that use that y connector to ps2 and they need a keyboard plugged in to the other section of the y to work... in a couple I have just gutted keyboards to the controller board and plugged that in to get them working.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Seemingly found solution

Seems the timing was an issue

Added feature allowing a delay between calls to the serial tools and all works fine now. Thanks team for the support!
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No problem, I'm glad you found a workable solution.
Logged

Pages: [1]   Go Up
Jump to: