Solved

Symbol LS4278 Scanner:  Getting batch mode data to the database

Posted on 2013-12-06
11
1,136 Views
Last Modified: 2013-12-12
I'm using the barcodes and process under "Standard Batch Mode" in this document to enable, store and then send batch mode data to a memo field on a form which then gets processed and used in the database:
http://support.scansource.com/images/TKP3XXX%20Articles/TKP3551/TKP3551.pdf

This method overall works fine, but with a couple of things I want to improve:

1.  The textbox that receives the scanned data is enabled, and the user might inadvertently change the scanned data.

2.  The cursor remains in the textbox after the scanner sends the data, so the user currently has to hit the enter key or otherwise manually exit the textbox to trigger the After Update code (which I want to run automatically after receiving the data)

So a few questions about this:

1.  Is it possible to programatically *read* data from the scanner rather than having the scanner send it to the database? This would take care of both of the issues I mentioned above.  If so, can you point me in the direction of a good reference?

2.  If not, is it possible to force the cursor to leave the textbox and trigger the after update event after the batch data is sent?  

3.  Is there a better approach to this that I am not aware of -- preferably with no third party software/solutions?


Thanks!
0
Comment
Question by:mbizup
  • 5
  • 4
  • 2
11 Comments
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Miriam,

 On this:

<<2.  If not, is it possible to force the cursor to leave the textbox and trigger the after update event after the batch data is sent?  >>

 I know that on just about every gun, you can setup a prefix/suffix to be transmitted on a scan.

With the prefix, you can come up with something unique to trigger an "unlock"; enable a control and set focus to it.  

With the suffix, you can do the reverse, or transmitt a tab or return.  Depending on your Access settings, that would force you to leave the control.

I'll look at the manual for that scanner in a minute to see if #1 is an option.

Jim.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
You can use mscomm contol from vb6. The data comes from serial port, and you send it to the database programmatically. No textboxes.

For that you need scanner that connects to serial port or usb.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Looked at the scanner manual...not much support in the gun itself.   It's only capable of transmitting a suffix and batch control is controlled by the gun itself either by scanning a bar code or being setup to touching the cradle.

Symbol does have a full SDK though, so it would be possible to really get into things.   That gun can also be hooked up in a number of ways (USB, Wedge Device, Serial Port, etc).  A serial type setup would give you a lot more control and there is a Virtual Com Port driver available (you hook it up to a USB port, but it appears to the OS as a serial/com port).

Jim.
0
 
LVL 61

Author Comment

by:mbizup
Comment Utility
Jim,

Just confirming that we're reading this the same way - my understanding is that you can set up a suffix for each barcode scanned, but you can't set up a suffix to appear just once at the end of a batch transmission.

Vadim,

If memory serves me right that mscomm control was included in earlier versions of Access.  I'm using Access 2010.  Do I have to install VB to use it?

Thanks for the responses.   I'll check back into this and try to test things later today.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
<<Just confirming that we're reading this the same way - my understanding is that you can set up a suffix for each barcode scanned, but you can't set up a suffix to appear just once at the end of a batch transmission.>>

 Not sure.  I haven't worked with Symbol in a long time....so long in fact that batch operations were a "new" feature, so I'm not sure how it really handles it.  Should be fairly quick to turn on and try.  I think though that you are right; it would be a prefix/suffix on each scan.   But there may be an option to control batch transmissions as well.

I registered for Motorola's site a while ago and want to look at the SDK.  The gun should be fully controllable from the PC side, but it may be more work then it's worth.

  I also noticed that through ADF (Advanced Data Formatting) rules, you can program the gun to do prefixes/suffixes on a scan.    The suffix only setup I noticed before (which I thought was pretty lame) was just a way of doing an "easy" setup.  You can do a lot more with the gun directly.  Their 123SCAN utility allows you to do this with a GUI.

Jim.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Rather then a single memo control, what about using a popup form in continious view to accept scans?

Then it would not matter if they did a single scan, batched on loss of signal, or batched by touching the cradle.

A thought anyway.

Jim.
0
 
LVL 61

Author Comment

by:mbizup
Comment Utility
Is this the manual you were looking at?
http://www.posmicro.com/downloads/ls4278_manual.pdf

Just thinking aloud... starting on page 8 - 12 is a listing of ASCII characters and keystrokes.  Perhaps if I had the users scan "$M" (ctrl-M/Enter) as the last item in a batch scan it would force the cursor out of the textbox when the data gets transferred.  I'll try that when I'm back at my computer.

<<but it may be more work then it's worth>>

That is actually a very important trade-off here in determining what to do... the client wants this as soon as possible, so I can't spend an enormous amount of time on it.
0
 
LVL 61

Author Comment

by:mbizup
Comment Utility
<<
Rather then a single memo control, what about using a popup form in continious view to accept scans?
>>

I actually started out with a similar approach, but they are not going to be carrying a tablet or laptop with them.

Although, if I add suffixes to each scan - perhaps it would automatically cursor to the next control and populate them sequentially.  Is that what you had in mind?
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 250 total points
Comment Utility
If memory serves me right that mscomm control was included in earlier versions of Access.  I'm using Access 2010.  Do I have to install VB to use it?

I'm pretty sure you have to. Check if you have MSCOMM32.OCX, and then you have to be able to use it in design mode. The easiest is to try it.

Here's real code from our shipping application. MsComm is the object put on the form from toolbox by using "more controls..."

Private Sub MSComm_OnComm()
    On Error GoTo er
    Const comEvReceive = 2
    WriteDebug "oncomm entered"
    If MSComm.CommEvent <> comEvReceive then exit sub


    Painting = False
    

    lblError.Visible = False
    WriteDebug "reading data"
    Dim Data As String, d0 As Variant
    d0 = Now()
    Do
        Data = Data & MSComm.Object.input
        DoEvents
    Loop Until InStr(Data, vbCr) > 0 Or DateDiff("s", d0, Now()) > 1
    WriteDebug "received |" & Replace(Replace(Data, vbCr, "<cr>"), vbLf, "<lf>") & "|"
    
    MSComm.rtsenable = False   ' tell the gun to hold further readings. That this is accomplished by RTS was the result of separate research
    
    If InStr(Data, vbCr) = 0 Then Err.Raise 555, , "Scanner failure; try again. If the problem persists, close and reopen the application. Make sure the bargun is configured to insert <CR> after the data; port parameters: 9600,n,8,1,no handshaking."

    WriteDebug "received data:" & Data
    WriteDebug "removing crlf"
    Do While Right(Data, 1) = vbCr Or Right(Data, 1) = vbLf
        Data = Left(Data, Len(Data) - 1)
    Loop
    Data = Replace(Data, vbLf, "")
    WriteDebug "removed crlf"
    Dim Numbers() As String, ii As Integer
    Numbers = Split(Data, vbCr)
    WriteDebug "found " & UBound(Numbers) + 1 & " inside"
    For ii = LBound(Numbers) To UBound(Numbers)
        WriteDebug "processing nunber " & ii
        Data = Numbers(ii)
        'Debug.Print "processing " & ii & " : " & Data
        If Left(Data, 1) = "#" Then Data = Mid(Data, 2)
        ProcessData (Data)
    Next ii
er:
    DoEvents
    Requery
    InProcess = False
    Painting = True
End Sub

Open in new window


The above code runs whenever the control fires event oncomm.
0
 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 250 total points
Comment Utility
All right, might have your answer.   Take a look at the OPOS driver, which is an OLE/ActiveX solution for talking to the gun.

Basically it allows you to use an OLE complaint application and work with the scans one at a time.

It takes care of the queuing up scans.   So you don't control batch mode directly, but just handle the scans one at a time (fill your memo control).   You don't need a control in Access to accept input.   Gun can be configured as a USB or RS232 interface.

Do a search on the Motorola support site for:

OPOS Driver.

and look at the Motorola Scanned OPOS driver developers guide. Read the first page (overview) of chapter 3, OPOS properties, methods, events.

Jim.
0
 
LVL 61

Author Closing Comment

by:mbizup
Comment Utility
Thanks for the replies, and sorry for the slow feedback.

Both of these look like they should work, and I've seen a working sample using the OPOS Driver.

I'm not 100% there in my own application though - it may have had to do with registering the controls (the properties were read-only).

The client in the meantime described a need to collect data on different computers/different locations not on their network, so we went with the approach of collecting the data in a text file at the remote location, having the users copy the file to a network location, and then reading that textfile into the database.

I want to try these approaches again at a later time, but don't want to leave the question hanging open.  If needed, I'll post new questions with specific issues at a later date,
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now