Reading serial port

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    Reading serial port

    Using qbasic, the following accepts input from com1, and prints its output :


    OPEN "com1:9600,n,8, 1,CD0,CS0,DS0,R S" FOR INPUT AS #1
    WHILE INKEY$ <> " "
    INPUT #1, a$
    PRINT a$
    WEND

    What would the same set of commands look like in VB. I am reading the
    output from Welch Allyn barcode scanner.

    I am a newbie to VB,

    regards
    Simon





  • the Wiz

    #2
    Re: Reading serial port

    Look up the MSCOMM control in VB help. In 32 bit Windows, you either use the
    APIs or a control like MSCOMM to talk to the hardware.


    "Simon" <simon.gregson@ blahblahbtinter net.com> wrote:
    [color=blue]
    >Using qbasic, the following accepts input from com1, and prints its output :
    >
    >
    >OPEN "com1:9600,n,8, 1,CD0,CS0,DS0,R S" FOR INPUT AS #1
    >WHILE INKEY$ <> " "
    > INPUT #1, a$
    > PRINT a$
    >WEND
    >
    >What would the same set of commands look like in VB. I am reading the
    >output from Welch Allyn barcode scanner.
    >
    >I am a newbie to VB,
    >
    >regards
    >Simon
    >
    >
    >
    >[/color]

    More about me: http://thelabwiz.home.mindspring.com/
    VB3 source code: http://thelabwiz.home.mindspring.com/vbsource.html
    VB6 source code: http://thelabwiz.home.mindspring.com/vb6source.html
    VB6 - MySQL how to: http://thelabwiz.home.mindspring.com/mysql.html
    My newest language - NSBasic for the Palm PDA: http://thelabwiz.home.mindspring.com/nsbsource.html
    Drivers for Pablo graphics tablet and JamCam cameras: http://home.earthlink.net/~mwbt/
    johnecarter atat mindspring dotdot com. Fix the obvious to reply by email.

    Comment

    • Thomas Lutz

      #3
      Re: Reading serial port

      There is no OPEN COM statement in VB and instead you need to use the
      MSComm ActiveX control to do serial I/O (or write more complex code
      using the Windows API)
      A quick and easy solution would be to use a third party tool like
      BC-Wedge or WinWedge from TAL Technologies. Both programs run in the
      background and feed serial data to other programs by stuffing the data
      through the keyboard buffer so that the bar code data would appear as
      keyboard input. The WinWedge program also supports DDE so you can feed
      data directly to a textbox ia VB program (or any other DDE client)
      without having to go through the keyboard buffer. With WinWedge, you
      simply set a few properties for a standard textbox and whenever you
      scan a bar code, the data goes directly to the textbox automatically
      and you also get a change event in the textbox each time you scan a
      bar code.
      For more info visit: http://www.taltech.com


      On Thu, 24 Jul 2003 20:36:59 +0000 (UTC), "Simon"
      <simon.gregson@ blahblahbtinter net.com> wrote:
      [color=blue]
      >Using qbasic, the following accepts input from com1, and prints its output :
      >
      >
      >OPEN "com1:9600,n,8, 1,CD0,CS0,DS0,R S" FOR INPUT AS #1
      >WHILE INKEY$ <> " "
      > INPUT #1, a$
      > PRINT a$
      >WEND
      >
      >What would the same set of commands look like in VB. I am reading the
      >output from Welch Allyn barcode scanner.
      >
      >I am a newbie to VB,
      >
      >regards
      >Simon
      >
      >
      >
      >[/color]

      Comment

      • Simon

        #4
        Re: Reading serial port

        Thanks Thomas

        "Thomas Lutz" <tom@taltech.co m> wrote in message
        news:3f258742.2 7493958@news.be llatlantic.net. ..[color=blue]
        > There is no OPEN COM statement in VB and instead you need to use the
        > MSComm ActiveX control to do serial I/O (or write more complex code
        > using the Windows API)
        > A quick and easy solution would be to use a third party tool like
        > BC-Wedge or WinWedge from TAL Technologies. Both programs run in the
        > background and feed serial data to other programs by stuffing the data
        > through the keyboard buffer so that the bar code data would appear as
        > keyboard input. The WinWedge program also supports DDE so you can feed
        > data directly to a textbox ia VB program (or any other DDE client)
        > without having to go through the keyboard buffer. With WinWedge, you
        > simply set a few properties for a standard textbox and whenever you
        > scan a bar code, the data goes directly to the textbox automatically
        > and you also get a change event in the textbox each time you scan a
        > bar code.
        > For more info visit: http://www.taltech.com
        >
        >
        > On Thu, 24 Jul 2003 20:36:59 +0000 (UTC), "Simon"
        > <simon.gregson@ blahblahbtinter net.com> wrote:
        >[color=green]
        > >Using qbasic, the following accepts input from com1, and prints its[/color][/color]
        output :[color=blue][color=green]
        > >
        > >
        > >OPEN "com1:9600,n,8, 1,CD0,CS0,DS0,R S" FOR INPUT AS #1
        > >WHILE INKEY$ <> " "
        > > INPUT #1, a$
        > > PRINT a$
        > >WEND
        > >
        > >What would the same set of commands look like in VB. I am reading the
        > >output from Welch Allyn barcode scanner.
        > >
        > >I am a newbie to VB,
        > >
        > >regards
        > >Simon
        > >
        > >
        > >
        > >[/color]
        >[/color]


        Comment

        Working...