Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / January 2006

Tip: Looking for answers? Try searching our database.

Scanner

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent - 06 Jan 2006 01:12 GMT
Hello all,
Thank you in advance. I am trying to write an application in VB.Net
that will show the data that is in a barcode in a textbox. I can deploy
the application to the scanner (Intermec CK31) but when I scan the
barcode nothing happens. I just get a beep. I have tried running the
sample application that came with in the Intermec Resource Kit and I
get the same thing (nothing). You will find the code below. Any help
would be GREATLY appreciated.

   Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
   Friend WithEvents Label1 As System.Windows.Forms.Label
   Friend WithEvents bcr As Intermec.DataCollection.BarcodeReader

   Private Sub BarcodeRead(ByVal sender As System.Object, ByVal e As
Intermec.DataCollection.BarcodeReadEventArgs)
       TextBox1.Text = e.strDataBuffer
   End Sub

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       bcr.Dispose()
       Me.Close()
   End Sub

Again I am just trying to get my application to recognize a barcode. I
can use the ScanDemo that came on the scanner and read the barcode. I
have a 2D barcode and an UPC.
Thanks Again
chris-s@mailcity.com - 06 Jan 2006 09:49 GMT
It could be something to do with the 'symbology' settings. Have you
tried doing something like opening up a new pocket word document and
scanning a code.

Any validated code should appear in the document. If this does not
work, do a cold reset and try again.

If it still does not work, try a different barcode format, eg EAN and
check the symbology settings found under 'Settings->System->Intermec
Settings->Data Collection->Internal Scanner.

Cheers

Chris
Kent - 06 Jan 2006 15:15 GMT
> It could be something to do with the 'symbology' settings. Have you
> tried doing something like opening up a new pocket word document and
[quoted text clipped - 10 lines]
>
> Chris

Chris,
Thank you for your help. I opened up wordpad and scanned a barcode.
That works fine. Do you have any other ideas?
Thanks again,
Kent
Darren Beckley - 06 Jan 2006 15:16 GMT
If that code is really all there is in your app, then you are missing some
important steps. First of all you need to initialize an instance of the
BarcodeReader object, then you need to use either Read or ThreadedRead to
start reading. Try adding this in form constructor or Form.Load:

bcr = New BarcodeReader
bcr.ThreadedRead(True)

You also need to hook up the event handler with the event. Add " Handles
bcr.BarcodeRead" to your event handler, e.g.

Private Sub BarcodeRead(ByVal sender As System.Object, ByVal e As
Intermec.DataCollection.BarcodeReadEventArgs) Handles bcr.BarcodeRead

Hope that helps,
Darren

> Hello all,
> Thank you in advance. I am trying to write an application in VB.Net
[quoted text clipped - 24 lines]
> have a 2D barcode and an UPC.
> Thanks Again
Kent - 06 Jan 2006 16:11 GMT
Darren,
Thank you for you time. I did have that code you mentioned but I forgot
to paste it in. When I scan the barcode the scanner beeps and the light
turns green. For some reason it is not getting into the event handler.
Any other ideas?

Thanks again for you time,
Kent
Kent - 06 Jan 2006 16:23 GMT
Below you will find all of the code:

Public Class Form1
   Inherits System.Windows.Forms.Form
   Friend WithEvents Button1 As System.Windows.Forms.Button
   Friend WithEvents bcr As Intermec.DataCollection.BarcodeReader

#Region " Windows Form Designer generated code "

   Public Sub New()

       MyBase.New()

       'This call is required by the Windows Form Designer.
       InitializeComponent()

       'Add any initialization after the InitializeComponent() call
       Try
           bcr = New Intermec.DataCollection.BarcodeReader
       Catch ex As Intermec.DataCollection.BarcodeReaderException
           MsgBox(ex.Message)
           Me.Close()
       Catch
           MsgBox("Make sure that ITCScan.DLL is in the \Windows
directory")
           Me.Close()
       End Try

       bcr.ThreadedRead(True)
       Button1.Focus()

   End Sub

   'Form overrides dispose to clean up the component list.
   Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
       MyBase.Dispose(disposing)
   End Sub

   'NOTE: The following procedure is required by the Windows Form
Designer
   'It can be modified using the Windows Form Designer.
   'Do not modify it using the code editor.
   Private Sub InitializeComponent()
       Me.Button1 = New System.Windows.Forms.Button
       '
       'Button1
       '
       Me.Button1.Location = New System.Drawing.Point(16, 56)
       Me.Button1.Text = "Button1"
       '
       'Form1
       '
       Me.ClientSize = New System.Drawing.Size(130, 111)
       Me.ControlBox = False
       Me.Controls.Add(Me.Button1)
       Me.Text = "Barcode Sample"

   End Sub

   Public Shared Sub Main()
       Application.Run(New Form1)
   End Sub

#End Region

   Private Sub BarcodeRead(ByVal sender As System.Object, ByVal e As
Intermec.DataCollection.BarcodeReadEventArgs) Handles bcr.BarcodeRead
       MsgBox("here")
       MsgBox(e.strDataBuffer)
   End Sub

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       bcr.Dispose()
       Me.Close()
   End Sub

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
       MessageBox.Show(bcr.ScannerEnable & " " & bcr.ScannerOn)
   End Sub
End Class

Thanks again,
Kent
Kent - 06 Jan 2006 21:06 GMT
UPDATE:

If I don't use any BarCodeReader classes and just place a textbox on
the form the application works. When I try to use the BarCodeReader the
events don't fire.

Thanks again,
Kent
Martin Robins - 07 Jan 2006 11:14 GMT
Kent,

Try disabling the keyboard wedge on the device; it sounds like the two are
clashing.

If you are using PPC2003, Start -> Settings -> System -> Intermec Settings;
Select Data Collection and then Virtual Wedge, ensure that the Virtual Wedge
tickbox is not checked.

Failing this, attach your code as-is (or email me directly) and I will try
it on my device.

Martin.

> UPDATE:
>
[quoted text clipped - 4 lines]
> Thanks again,
> Kent
Kent - 08 Jan 2006 08:45 GMT
> Kent,
>
[quoted text clipped - 18 lines]
> > Thanks again,
> > Kent

Martin,
Thank you for your help. I won't be back to the office until Monday.
When I get in I will try it. How do I disable the wedge on Windows CE?

Thanks Again,
Kent
Kent - 09 Jan 2006 15:32 GMT
> > Kent,
> >
[quoted text clipped - 25 lines]
> Thanks Again,
> Kent

Martin,
I have disabled the virtual wedge and it still does not work. Could you
please email me (unwantedspam@mchsi.com is valid and I check it
everyday.)

Thanks again,
Kent
Martin Robins - 06 Jan 2006 21:40 GMT
Kent,

I have not tried the CK31, but I can confirm that the code for the example
works fine when used on the 700 series.

Can you confirm the version of the .NET CF that you are using; I have had
problems when using CF2.0 (although these are easily overcome). Can you also
confirm the version of the Intermec data collection toolkit you are using -
not just the assembly version of Intermec.DataCollection.dll as this does
not always change, what version of the library did you install?

Martin.

> Hello all,
> Thank you in advance. I am trying to write an application in VB.Net
[quoted text clipped - 24 lines]
> have a 2D barcode and an UPC.
> Thanks Again
Kent - 06 Jan 2006 22:20 GMT
Martin,
I am using Intermec v2.0 according to the readme.htm. I just downloaded
it yesterday. I am using the CF2.0 with VS 2003.

Thanks for taking time to help me,
Kent
Ginny Caughey [MVP] - 09 Jan 2006 15:28 GMT
Kent,

Perhaps you mean CF 2.0 with VS 2005?

Signature

Ginny Caughey
.NET Compact Framework MVP

> Martin,
> I am using Intermec v2.0 according to the readme.htm. I just downloaded
> it yesterday. I am using the CF2.0 with VS 2003.
>
> Thanks for taking time to help me,
> Kent
Kent - 09 Jan 2006 15:41 GMT
Ginny,
I am using VS 2003. How can I tell what version of CF I am using.

Thanks,
Kent
Ginny Caughey [MVP] - 09 Jan 2006 16:02 GMT
Kent,

As far as I know, VS 2003 only supports CF 1. You have the option to support
either version of CF with VS 2005.

Signature

Ginny Caughey
.NET Compact Framework MVP

> Ginny,
> I am using VS 2003. How can I tell what version of CF I am using.
>
> Thanks,
> Kent
Kent - 09 Jan 2006 16:25 GMT
I think I have CF 2.0. I know for sure I am using VS 2003. The reason I
think I am using CF 2.0 is I have the following folder structure:
C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0. Where can I
download CF1 at?

Thanks,
Kent
Darren Beckley - 09 Jan 2006 17:14 GMT
Kent,

I have built your code in VS2003 and tried it on a CK31 - it works fine for
me. I am using CK31 OS 3.00.00.0732. You can see this version on the default
home page in Internet Explorer, or from Start -> Programs -> Intermec
Diagnostics -> Software -> OS Version. If you are running an old OS, you
could try upgrading. You can download CK3x OSes here:

http://www.intermec.com/eprise/main/Intermec/Content/Search/Results?List=Downloa
ds&search_text=ck31


I am using Intermec.DataCollection.dll version 1.1.0.1 from the Data
Collection Resource Kit in Intermec Developers Library (IDL) 2.1. You
mentioned you had IDL 2.0, but 2.1 has been the current version for some
time now. Please double-check the version in the readme file at C:\Program
Files\Intermec\Developer Library\readme.htm. You can download the latest
version from http://www.intermec.com/idl.

If you are using VS2003, then you are targeting CF v1.0. With the version of
the OS above, you will find that CF v1.0 SP3 is already installed on the
CK31. You can run \Windows\cgacutil.exe to check the version - compare the
version it gives with this chart to see what's installed:

http://wiki.opennetcf.org/ow.asp?CompactFrameworkFAQ%2FDeterminingVersion

If for some reason you have installed CF v2.0 on the CK31, try uninstalling
it. That might fix the problem. Other than that, I don't see what else you
are doing wrong here.

If you want to raise a support call to get help from Intermec, you can do so
at http://intermec.custhelp.com.

Hope that helps,
Darren

>I think I have CF 2.0. I know for sure I am using VS 2003. The reason I
> think I am using CF 2.0 is I have the following folder structure:
[quoted text clipped - 3 lines]
> Thanks,
> Kent
Kent - 09 Jan 2006 18:57 GMT
Darren,
Thank you for the help. I am using CE Build Version 2.00.10.0505
Premium. I am in fact using "(RELEASE 2.1) README.HTM". Also, I am
using Microsoft .NET Compact Framework 1.0.3316.00 in the CK31.

Do you think it is the CE Build Version causing the issue?

Thanks again for your help,
Kent
Chris Tacke, eMVP - 09 Jan 2006 19:26 GMT
If that's right, then there's certainly the problem.  The CF is supported
only on CE 3.0 and later, and CE 3.0 only when it's a PPC.

Signature

Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF?  Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate

> Darren,
> Thank you for the help. I am using CE Build Version 2.00.10.0505
[quoted text clipped - 5 lines]
> Thanks again for your help,
> Kent
Kent - 09 Jan 2006 19:39 GMT
Chris,
If I go into the System Properties of My Computer. Is says I am using
"Microsoft Windows CE .NET Version 4.20". I think the version Darren
was talking about is the version of the Intermec Software build. Do you
have any other info that may help?

Thanks again for you help,
Kent
Darren Beckley - 10 Jan 2006 08:52 GMT
Yes, the CK31 runs WinCE.NET 4.2, so CF v1.0 is supported and indeed built
into the OS. The OS version in question is indeed an Intermec build number.
If you are just starting development on the CK31, I think it makes sense to
upgrade your development device to the latest OS now and try again. I don't
know offhand whether or not the OS you are running would have any issues
with IDL 2.1 components.

Hope that helps,
Darren

> Chris,
> If I go into the System Properties of My Computer. Is says I am using
[quoted text clipped - 4 lines]
> Thanks again for you help,
> Kent
Kent - 11 Jan 2006 02:49 GMT
> Yes, the CK31 runs WinCE.NET 4.2, so CF v1.0 is supported and indeed built
> into the OS. The OS version in question is indeed an Intermec build number.
[quoted text clipped - 14 lines]
> > Thanks again for you help,
> > Kent

I would like to thank you all for you assistance. I upgraded the build,
used the exact same code and the events fired.

Thanks again for your assistance. You were a big help,
Kent

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.