1. Krishna Mohan Gullap
  2. PowerBuilder
  3. Monday, 16 March 2020 09:34 AM UTC

Hello All -

One of my clients has a 'symbol scanner' plugged into his USB port

He places the cursor in a field (say Stock number) in a PB window object, and when he scans a barcode from a paper or another application on-screen, he wants the value read by the scanner to populate in the field which has the cursor

I believe the scanner has a port number and the data could be read from this port? How do I read data from this port? Or is there a way to do it without listening at the port in PowerBuilder code? Like a Windows DLL that I need to add a local/global external function for, in PB?

Any help is sincerely appreciated, thank you!

 

- Krishna

 

René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 7 May 2020 05:32 AM UTC
  2. PowerBuilder
  3. # 1

Maybe GetRawInputDeviceList and GetRawInputDeviceInfo API helps you.

But I have not used it yet.

René

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 20:47 PM UTC
  2. PowerBuilder
  3. # 2

I would create a SETUP screen where the user can enter the port and anything you need to connect.

Comment
  1. Krishna Mohan Gullap
  2. Wednesday, 6 May 2020 21:20 PM UTC
Problem is user wouldn't know that, and that's exactly what I am trying to avoid, unless there isn't another option
  1. Helpful
There are no comments made yet.
Krishna Mohan Gullap Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 20:41 PM UTC
  2. PowerBuilder
  3. # 3

The scanner the client uses is a "Symbol LS2208-SR20007R-NA", plugged in to the USB port

I have checked that the client is able to scan to a notepad but the same doesn't work with PowerBuilder, and the scanned data is not on the clipboard either

 

I read in another thread that the below command can be used to read from an USB port

FileOpen ( "COM1:", LineMode!, Write!, LockWrite!, Replace!)

replacing the "COM1" by "Device name/port"

 

But to do that first, I need to know the port number the device uses. How can I do this programmatically without having to ask the client and use a hardcoded value? Also, since it's a plug and play, the device might use the next available port on the computer instead of a standard port number, if I am not wrong

 

Any help is greatly appreciated, thanks!

Thanks,

Krishna

Comment
  1. Sivaprakash BKR
  2. Friday, 8 May 2020 05:04 AM UTC
If you could scan to a notepad and not in powerbuilder application, then something to be checked in the app's itemchanged event or itemfocuschanged event whether anything clears the content.



Else Check it in a new datawindow with no codes in either itemchanged or itemfocuschanged events and see whether you get the contents in those fields. You could also check whether you could get the contents in a word or excel files.

  1. Helpful
There are no comments made yet.
Krishna Mohan Gullap Accepted Answer Pending Moderation
  1. Monday, 4 May 2020 20:54 PM UTC
  2. PowerBuilder
  3. # 4

Hello All - Sorry about the delay in getting back to your responses

The scanning using an open notepad file doesn't seem to work for this specific device

I would have to read from a port, which is fairly easy. This code has to be replicated to other people in case it works on the client machine

I believe all the scanners on individual terminals (if they are from the same manufacturer) use the same port on all machines, and hopefully that port isn't occupied by another process

How do I determine the port number of the device at runtime? Any thoughts?

 

Thanks,

Krishna

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 16 March 2020 13:10 PM UTC
  2. PowerBuilder
  3. # 5

what you are looking for is a keyboard wedge scanner, also know as PS2 Barcode Scanners

If you use that setup, then the scanner acts like a keyboard.  typically you can add a value such as tab or CR to the end of the scanned value (to allow you to skip to the next field) if the scanner allows it.

 

If you don't use a keyboard wedge style scanner, then you need to read a port

Comment
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Monday, 16 March 2020 11:21 AM UTC
  2. PowerBuilder
  3. # 6

1. Open a notepad and place the cursor in that notepad
2. Scan the barcode
3. Check whether you get the scanned value in the barcode.

If that works, you don't have to do any thing.  Just place the cursor in the required field and scan the barcode.

That's all.

 

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Monday, 16 March 2020 09:46 AM UTC
  2. PowerBuilder
  3. # 7
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.