barcode scanner in USB port 
Author Message
 barcode scanner in USB port

I am somewhat new to VB.Net, and am searching for a way to communicate with
the USB port that has a simple barcode scanner attached.  The company
(Symbol) has a demo version software that works well (written in C++) but it
doesnt save the data, so I was hoping to write a routine in VB that I could
use in an inventory program.  However, I can't even get the program to
recognize the port(s) on the pc.  I would be eternally grateful for any
pointers on how to solve this problem.  Here is the routine in C - and my
routine in VB:
C++:
{
ret=csp2Init(port);
if (ret==STATUS_OK) {
    ComStarted=true;
    //write to screen
Quote:
}

else {
    ComStarted=false;
//another msg to screen
    }
Quote:
}

VB:
 Declare Function csp2Init Lib "csp2.DLL" (ByVal nComPort As Long) As Long

Public Sub cmdOpen1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdOpen1.Click
        Dim port As Byte = 1
        Dim ComStarted As Boolean
        Dim ret As Long
        ret = csp2Init(port)
        If ret = STATUS_OK Then
            ComStarted = True
            txtScannerPolling1.Text = portsel & " Opened"
        Else
            ComStarted = False
            txtScannerPolling1.Text = txtScannerPolling1.Text & portsel & "
Failed"
        End If

    End Sub

I always get a value of "9222812402616107008" in the ret variable.
I guess my big question is:  How can I test that the dll is working?



Fri, 29 Jul 2005 03:26:01 GMT  
 barcode scanner in USB port
Hello Damon,

Quote:
>  Declare Function csp2Init Lib "csp2.DLL" (ByVal nComPort As Long) As Long

check the types in your declaration Long ? or Integer ?!

Regards Holger



Sat, 30 Jul 2005 02:14:00 GMT  
 barcode scanner in USB port
In VB .NET Longs have become integers, try altering your declaration
accordingly.

--
==============================================
Happy To Help,
Tom Spink

http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code

One day

Quote:
> I am somewhat new to VB.Net, and am searching for a way to communicate
with
> the USB port that has a simple barcode scanner attached.  The company
> (Symbol) has a demo version software that works well (written in C++) but
it
> doesnt save the data, so I was hoping to write a routine in VB that I
could
> use in an inventory program.  However, I can't even get the program to
> recognize the port(s) on the pc.  I would be eternally grateful for any
> pointers on how to solve this problem.  Here is the routine in C - and my
> routine in VB:
> C++:
> {
> ret=csp2Init(port);
> if (ret==STATUS_OK) {
>     ComStarted=true;
>     //write to screen
> }
> else {
>     ComStarted=false;
> //another msg to screen
>     }
> }
> VB:
>  Declare Function csp2Init Lib "csp2.DLL" (ByVal nComPort As Long) As Long

> Public Sub cmdOpen1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles cmdOpen1.Click
>         Dim port As Byte = 1
>         Dim ComStarted As Boolean
>         Dim ret As Long
>         ret = csp2Init(port)
>         If ret = STATUS_OK Then
>             ComStarted = True
>             txtScannerPolling1.Text = portsel & " Opened"
>         Else
>             ComStarted = False
>             txtScannerPolling1.Text = txtScannerPolling1.Text & portsel &
"
> Failed"
>         End If

>     End Sub

> I always get a value of "9222812402616107008" in the ret variable.
> I guess my big question is:  How can I test that the dll is working?



Sat, 30 Jul 2005 05:03:40 GMT  
 barcode scanner in USB port

Did you get the Symbol CS1504 working?  I am interested in trying to
make one I have Work in VB.  Would you be willing to share your code
with me?

Thanks,
Erik

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 19 Sep 2005 01:17:33 GMT  
 barcode scanner in USB port
A keyboard-wedge scanner (also available from symbol, intermec etc...) is the easiest implementation.
Quote:

> Did you get the Symbol CS1504 working?  I am interested in trying to
> make one I have Work in VB.  Would you be willing to share your code
> with me?

> Thanks,
> Erik

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Mon, 19 Sep 2005 01:21:59 GMT  
 barcode scanner in USB port
I have a staff of 15 people who Wander our campus fixing equipment.  The
CS1504 is a moble Keychain device that can be easily carried and the
equipment can be scanned for location and serial number to update my
inventory file (currently in Access).  The scanner comes with sample
code in C++ to view the info in a text box, but I need a way to get VB
to download it so I can put the scanned data in the correct fields in
Access.  A "Wired" solution will not work.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 19 Sep 2005 03:40:38 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. USB Barcode Scanners

2. Future of Serial Ports vs USB Ports

3. gestione scanner usb

4. Using barcode scanner with Access

5. How to read Barcode Scanner??

6. vb.net and barcode scanners

7. Barcode Scanner and VB .NET

8. RF Barcode Scanner /w Visual Studio?

9. ASP with barcode scanner

10. Barcode scanners

11. Norand Barcode scanners???

12. Newbie Q: Using a barcode scanner with VB

 

 
Powered by phpBB® Forum Software