Symbol LS4278 Scanner:  Getting batch mode data to the database

Posted on 2013-12-06
Medium Priority
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:

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?

Question by:mbizup
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
LVL 58
ID: 39700625

 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.

LVL 40

Expert Comment

by:Vadim Rapp
ID: 39700631
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.
LVL 58
ID: 39700677
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).

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

LVL 61

Author Comment

ID: 39700792

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.


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.
LVL 58
ID: 39700843
<<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.

LVL 58
ID: 39700866
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.

LVL 61

Author Comment

ID: 39700871
Is this the manual you were looking at?

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.
LVL 61

Author Comment

ID: 39700880
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?
LVL 40

Accepted Solution

Vadim Rapp earned 1000 total points
ID: 39700900
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()
        Data = Data & MSComm.Object.input
    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)
    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
    InProcess = False
    Painting = True
End Sub

Open in new window

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

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 1000 total points
ID: 39700904
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.

LVL 61

Author Closing Comment

ID: 39713854
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,

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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 …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

771 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