Shop OBEX P1 Docs P2 Docs Learn Events
Somewhat OT: Accessing the serialport in VB6? — Parallax Forums

Somewhat OT: Accessing the serialport in VB6?

ArchiverArchiver Posts: 46,084
edited 2000-08-14 02:37 in General Discussion
Hello all,
I realize this is not strictly stamp-related, but it has come
up before. I've just started fooling around with Visual Basic and I'm
wondering if anyone would share routines for sending and receiving via the
serial port?

Thanks, Duncan

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-07-04 16:36
    There are several Stamp examples that do this including
    http://www.al-williams.com/stampcom.zip -- which is a frequency counter.

    Regards,

    Al Williams
    AWC
    *Floating point math for the Stamp, PIC, SX, or any microcontroller:
    http://www.al-williams.com/awce/pak1.htm


    >
    Original Message
    > From: orthner@s... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=uFkODWBRbgxTCfA2Yu2GneqfhA1Q5WvlynD_3FZ57w9LdyEyJIK-WvD6MmssPxxbP27UNJppIAhYfDunIA]orthner@s...[/url
    > Sent: Tuesday, July 04, 2000 10:26 AM
    > To: basicstamps@egroups.com
    > Subject: [noparse][[/noparse]basicstamps] Somewhat OT: Accessing the serialport in VB6?
    >
    >
    >
    > Hello all,
    > I realize this is not strictly stamp-related, but it has come
    > up before. I've just started fooling around with Visual Basic and I'm
    > wondering if anyone would share routines for sending and receiving via the
    > serial port?
    >
    > Thanks, Duncan
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-07-04 16:46
    Duncan,

    We have several VB projects for communicating with the
    Stamp at: http://www.rentron.com/BasicStamp.htm

    Also, look around at Al Williams web site at:
    http://www.al-williams.com/awce/index.htm

    If you're looking for an excellent book that has plenty of
    sample code, I highly recommend the book by Jan Axelson
    "Serial Port Complete".

    Regards,

    Bruce
    http://www.rentron.com
    webmaster@r...


    Original Message
    From: <orthner@s...>
    To: <basicstamps@egroups.com>
    Sent: Tuesday, July 04, 2000 9:25 AM
    Subject: [noparse][[/noparse]basicstamps] Somewhat OT: Accessing the serialport in VB6?


    |
    | Hello all,
    | I realize this is not strictly stamp-related, but it has come
    | up before. I've just started fooling around with Visual Basic and I'm
    | wondering if anyone would share routines for sending and receiving via the
    | serial port?
    |
    | Thanks, Duncan
    |
    |
    |
    |
    |
  • ArchiverArchiver Posts: 46,084
    edited 2000-07-04 17:21
    In a message dated 7/4/00 10:27:21 AM Central Daylight Time,
    orthner@s... writes:

    > I realize this is not strictly stamp-related, but it has come
    > up before. I've just started fooling around with Visual Basic and I'm
    > wondering if anyone would share routines for sending and receiving via the
    > serial port?

    My "Stamp Applications" article in the July issue of Nuts & Volts magazine
    shows how to get data from the Stamp through Visual Basic. The August issue
    goes into even more detail.

    In the mean time, get Jan Axelson's "Serial Port Complete" (covers VB and
    micros, including the Stamp) and Richard Grier's "Visual Basic Programmer's
    Guide to Serial Communications." With those two books and a bit of time to
    experiment, you'll be set.

    -- Jon Williams
    -- Dallas, TX
  • ArchiverArchiver Posts: 46,084
    edited 2000-07-05 08:01
    At 09:46 AM 7/4/00 -0600, Bruce wrote:

    [noparse][[/noparse]snip]

    >If you're looking for an excellent book that has plenty of
    >sample code, I highly recommend the book by Jan Axelson
    >"Serial Port Complete".

    I looked at this book and noticed that the routines all use the mscomm
    module. This appears to be included only in the VB Pro and Enterprise
    editions, not in my Learning Edition (6.0). Am I snookered, or is it just
    hiding where I can't find it?

    Duncan
  • ArchiverArchiver Posts: 46,084
    edited 2000-07-05 10:25
    In a message dated 7/5/00 2:37:42 AM Central Daylight Time,
    orthner@s... writes:

    > I looked at this book and noticed that the routines all use the mscomm
    > module. This appears to be included only in the VB Pro and Enterprise
    > editions, not in my Learning Edition (6.0). Am I snookered, or is it just
    > hiding where I can't find it?

    You can get the XMComm control from Richard Grier. It's free and was built
    using the MSComm control, so you have all of MSComm's capabilities.

    http://ourworld.compuserve.com/homepages/richard_grier
  • ArchiverArchiver Posts: 46,084
    edited 2000-07-05 17:27
    At 05:25 AM 7/5/00 -0400, Jon wrote:

    >
    >You can get the XMComm control from Richard Grier. It's free and was built
    >using the MSComm control, so you have all of MSComm's capabilities.
    >
    >http://ourworld.compuserve.com/homepages/richard_grier

    This is really great! Thanks so much Jon and Bruce. This was becoming a
    major stumbling block and if I'd known the Learning Edition was so limited
    I wouldn't have gotten it (But Visual Basic *is* really neat). I won't
    burden the list with this any further...

    Thanks again, Duncan
  • ArchiverArchiver Posts: 46,084
    edited 2000-08-14 02:37
    --- In basicstamps@egroups.com, orthner@s... wrote:
    >
    > Hello all,
    > I realize this is not strictly stamp-related, but it
    has come
    > up before. I've just started fooling around with Visual Basic and
    I'm
    > wondering if anyone would share routines for sending and receiving
    via the
    > serial port?
    >
    > Thanks, Duncan

    I have just found your message by accident as I am searching about
    the
    subject of serial communiation. Here is an example where I send
    command to PIC microcontroller using VB5 on COM1

    Private Sub Command2_Click()
    MSComm1.Output = "setPA0" + Chr(13)
    End Sub

    Private Sub Command4_Click()
    MSComm1.Output = "RESPA0" + Chr(13)
    End Sub

    Private Sub Command5_Click()
    MSComm2.Output = "C00" + Chr(13) + Chr(10)
    End Sub

    Private Sub Command6_Click()
    MSComm2.Output = "C02" + Chr(13) + Chr(10)

    End Sub

    Private Sub Option1_Click(Index As Integer)
    'enable port
    MSComm2.PortOpen = True
    End Sub

    Private Sub Option2_Click()
    MSComm1.PortOpen = False

    End Sub

    Private Sub Option3_Click()
    MSComm2.PortOpen = True

    End Sub

    Private Sub Option4_Click()
    MSComm2.PortOpen = False

    End Sub
Sign In or Register to comment.