Solved

Symbol LS4278 Scanner:  Getting batch mode data to the database

Posted on 2013-12-06
11
1,190 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
[X]
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
11 Comments
 
LVL 57
ID: 39700625
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
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.
0
 
LVL 57
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).

Jim.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 61

Author Comment

by:mbizup
ID: 39700792
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
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.

Jim.
0
 
LVL 57
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.

Jim.
0
 
LVL 61

Author Comment

by:mbizup
ID: 39700871
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
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?
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 250 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()
    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
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.

Jim.
0
 
LVL 61

Author Closing Comment

by:mbizup
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,
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

696 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