Shop OBEX P1 Docs P2 Docs Learn Events
Serial Port Programming Problem — Parallax Forums

Serial Port Programming Problem

ArchiverArchiver Posts: 46,084
edited 2002-06-14 22:53 in General Discussion
Hi, I am begining to learn to write a Stamps 2 application. I wand
to send a short msg from my Computer to Basic Stamp2 though a
interface made by Visual Basic. I use MSComm1 object to initialize
a COM port. The Stamp 2 does simple job to return an acknowleedge to
the sender. They communicated through a straight through cable
(RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
first on the COM 1 of the Computer, then I start run my application
on my Computer, I got a error msg " The Port is already open." If I
run the application first, then Stamp, same error. It sounds like
they both can not share the Port. I know threr is somewhere wrong in
my code. Would somebody fix the piece of code for me? I appreciate
what ever you give me a hits. (no Compile Problem)
Jenny Luo
This code is written by a book writer, Jan Axelson
Serial Port Complete, ISBN 096508192
Public Function fncInitializeComPort _
(BitRate As Long, PortNumber As Integer) As Boolean
'BitRate and PortNumber are passed to this routine.
'All other properties are set explicitly in the routine.
Dim ComSettings$
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
ComSettings = CStr(BitRate) & ",N,8,1"
MSComm1.CommPort = PortNumber
' bit rate, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = ComSettings
'Set to 0 to read entire buffer on Input
MSComm1.InputLen = 0
MSComm1.InBufferSize = 256
'Input and output data are the contents of a byte array
'stored in a variant.
MSComm1.InputMode = comInputModeBinary
'MSComm does no handshaking.
MSComm1.Handshaking = comNone
MSComm1.OutBufferSize = 256
MSComm1.EOFEnable = False
'No OnComm event on received data.
MSComm1.RThreshold = 0
'No OnComm transmit event.
MSComm1.SThreshold = 0
MSComm1.PortOpen = True
fncInitializeComPort= True
End Function

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-06-13 23:24
    Yup. VB is telling you another application on your PC already has the serial
    port open -- your Stamp editor. You can either run one or the other -- but
    not both at once, or use a couple of pins and a MAX IC to make a second
    serial port.

    Original Message

    > Hi, I am begining to learn to write a Stamps 2 application. I wand
    > to send a short msg from my Computer to Basic Stamp2 though a
    > interface made by Visual Basic. I use MSComm1 object to initialize
    > a COM port. The Stamp 2 does simple job to return an acknowleedge to
    > the sender. They communicated through a straight through cable
    > (RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
    > first on the COM 1 of the Computer, then I start run my application
    > on my Computer, I got a error msg " The Port is already open." If I
    > run the application first, then Stamp, same error. It sounds like
    > they both can not share the Port. I know threr is somewhere wrong in
    > my code. Would somebody fix the piece of code for me? I appreciate
    > what ever you give me a hits. (no Compile Problem)
    > Jenny Luo
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-14 05:29
    Does your Basic Stamp code have any 'Debug' statements in it? If so,
    this is what is preventing the VB script from running after you download to
    the the stamp. Take out any 'Debug' statements and you should have no
    problems. I run VB script all the time on the same serial port as the stamp
    programming line (pin '16' on the stamp). It works as long as there are no
    commands in the Stamp code that access the port.
    Don
    Original Message
    From: "wlycory" <wlycory@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, June 13, 2002 2:53 PM
    Subject: [noparse][[/noparse]basicstamps] Serial Port Programming Problem


    > Hi, I am begining to learn to write a Stamps 2 application. I wand
    > to send a short msg from my Computer to Basic Stamp2 though a
    > interface made by Visual Basic. I use MSComm1 object to initialize
    > a COM port. The Stamp 2 does simple job to return an acknowleedge to
    > the sender. They communicated through a straight through cable
    > (RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
    > first on the COM 1 of the Computer, then I start run my application
    > on my Computer, I got a error msg " The Port is already open." If I
    > run the application first, then Stamp, same error. It sounds like
    > they both can not share the Port. I know threr is somewhere wrong in
    > my code. Would somebody fix the piece of code for me? I appreciate
    > what ever you give me a hits. (no Compile Problem)
    > Jenny Luo
    > This code is written by a book writer, Jan Axelson
    > Serial Port Complete, ISBN 096508192
    >
    > Public Function fncInitializeComPort _
    > (BitRate As Long, PortNumber As Integer) As Boolean
    > 'BitRate and PortNumber are passed to this routine.
    > 'All other properties are set explicitly in the routine.
    > Dim ComSettings$
    > If MSComm1.PortOpen = True Then
    > MSComm1.PortOpen = False
    > End If
    > ComSettings = CStr(BitRate) & ",N,8,1"
    > MSComm1.CommPort = PortNumber
    > ' bit rate, no parity, 8 data, and 1 stop bit.
    > MSComm1.Settings = ComSettings
    > 'Set to 0 to read entire buffer on Input
    > MSComm1.InputLen = 0
    > MSComm1.InBufferSize = 256
    > 'Input and output data are the contents of a byte array
    > 'stored in a variant.
    > MSComm1.InputMode = comInputModeBinary
    > 'MSComm does no handshaking.
    > MSComm1.Handshaking = comNone
    > MSComm1.OutBufferSize = 256
    > MSComm1.EOFEnable = False
    > 'No OnComm event on received data.
    > MSComm1.RThreshold = 0
    > 'No OnComm transmit event.
    > MSComm1.SThreshold = 0
    > MSComm1.PortOpen = True
    > fncInitializeComPort= True
    > End Function
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-14 05:29
    Does your Basic Stamp code have any 'Debug' statements in it? If so,
    this is what is preventing the VB script from running after you download to
    the the stamp. Take out any 'Debug' statements and you should have no
    problems. I run VB script all the time on the same serial port as the stamp
    programming line (pin '16' on the stamp). It works as long as there are no
    commands in the Stamp code that access the port.
    Don
    Original Message
    From: "wlycory" <wlycory@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, June 13, 2002 2:53 PM
    Subject: [noparse][[/noparse]basicstamps] Serial Port Programming Problem


    > Hi, I am begining to learn to write a Stamps 2 application. I wand
    > to send a short msg from my Computer to Basic Stamp2 though a
    > interface made by Visual Basic. I use MSComm1 object to initialize
    > a COM port. The Stamp 2 does simple job to return an acknowleedge to
    > the sender. They communicated through a straight through cable
    > (RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
    > first on the COM 1 of the Computer, then I start run my application
    > on my Computer, I got a error msg " The Port is already open." If I
    > run the application first, then Stamp, same error. It sounds like
    > they both can not share the Port. I know threr is somewhere wrong in
    > my code. Would somebody fix the piece of code for me? I appreciate
    > what ever you give me a hits. (no Compile Problem)
    > Jenny Luo
    > This code is written by a book writer, Jan Axelson
    > Serial Port Complete, ISBN 096508192
    >
    > Public Function fncInitializeComPort _
    > (BitRate As Long, PortNumber As Integer) As Boolean
    > 'BitRate and PortNumber are passed to this routine.
    > 'All other properties are set explicitly in the routine.
    > Dim ComSettings$
    > If MSComm1.PortOpen = True Then
    > MSComm1.PortOpen = False
    > End If
    > ComSettings = CStr(BitRate) & ",N,8,1"
    > MSComm1.CommPort = PortNumber
    > ' bit rate, no parity, 8 data, and 1 stop bit.
    > MSComm1.Settings = ComSettings
    > 'Set to 0 to read entire buffer on Input
    > MSComm1.InputLen = 0
    > MSComm1.InBufferSize = 256
    > 'Input and output data are the contents of a byte array
    > 'stored in a variant.
    > MSComm1.InputMode = comInputModeBinary
    > 'MSComm does no handshaking.
    > MSComm1.Handshaking = comNone
    > MSComm1.OutBufferSize = 256
    > MSComm1.EOFEnable = False
    > 'No OnComm event on received data.
    > MSComm1.RThreshold = 0
    > 'No OnComm transmit event.
    > MSComm1.SThreshold = 0
    > MSComm1.PortOpen = True
    > fncInitializeComPort= True
    > End Function
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-14 05:29
    Does your Basic Stamp code have any 'Debug' statements in it? If so,
    this is what is preventing the VB script from running after you download to
    the the stamp. Take out any 'Debug' statements and you should have no
    problems. I run VB script all the time on the same serial port as the stamp
    programming line (pin '16' on the stamp). It works as long as there are no
    commands in the Stamp code that access the port.
    Don
    Original Message
    From: "wlycory" <wlycory@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, June 13, 2002 2:53 PM
    Subject: [noparse][[/noparse]basicstamps] Serial Port Programming Problem


    > Hi, I am begining to learn to write a Stamps 2 application. I wand
    > to send a short msg from my Computer to Basic Stamp2 though a
    > interface made by Visual Basic. I use MSComm1 object to initialize
    > a COM port. The Stamp 2 does simple job to return an acknowleedge to
    > the sender. They communicated through a straight through cable
    > (RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
    > first on the COM 1 of the Computer, then I start run my application
    > on my Computer, I got a error msg " The Port is already open." If I
    > run the application first, then Stamp, same error. It sounds like
    > they both can not share the Port. I know threr is somewhere wrong in
    > my code. Would somebody fix the piece of code for me? I appreciate
    > what ever you give me a hits. (no Compile Problem)
    > Jenny Luo
    > This code is written by a book writer, Jan Axelson
    > Serial Port Complete, ISBN 096508192
    >
    > Public Function fncInitializeComPort _
    > (BitRate As Long, PortNumber As Integer) As Boolean
    > 'BitRate and PortNumber are passed to this routine.
    > 'All other properties are set explicitly in the routine.
    > Dim ComSettings$
    > If MSComm1.PortOpen = True Then
    > MSComm1.PortOpen = False
    > End If
    > ComSettings = CStr(BitRate) & ",N,8,1"
    > MSComm1.CommPort = PortNumber
    > ' bit rate, no parity, 8 data, and 1 stop bit.
    > MSComm1.Settings = ComSettings
    > 'Set to 0 to read entire buffer on Input
    > MSComm1.InputLen = 0
    > MSComm1.InBufferSize = 256
    > 'Input and output data are the contents of a byte array
    > 'stored in a variant.
    > MSComm1.InputMode = comInputModeBinary
    > 'MSComm does no handshaking.
    > MSComm1.Handshaking = comNone
    > MSComm1.OutBufferSize = 256
    > MSComm1.EOFEnable = False
    > 'No OnComm event on received data.
    > MSComm1.RThreshold = 0
    > 'No OnComm transmit event.
    > MSComm1.SThreshold = 0
    > MSComm1.PortOpen = True
    > fncInitializeComPort= True
    > End Function
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-14 05:33
    Sorry if this last message comes thru multiple times. I didn't do it.
    Some glitch in comm between Outlook Express and my ISP did it.
    Don
    Original Message
    From: "Don" <renegade.engineer@v...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, June 13, 2002 9:29 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Serial Port Programming Problem


    > Does your Basic Stamp code have any 'Debug' statements in it? If so,
    > this is what is preventing the VB script from running after you download
    to
    > the the stamp. Take out any 'Debug' statements and you should have no
    > problems. I run VB script all the time on the same serial port as the
    stamp
    > programming line (pin '16' on the stamp). It works as long as there are
    no
    > commands in the Stamp code that access the port.
    > Don
    >
    Original Message
    > From: "wlycory" <wlycory@y...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, June 13, 2002 2:53 PM
    > Subject: [noparse][[/noparse]basicstamps] Serial Port Programming Problem
    >
    >
    > > Hi, I am begining to learn to write a Stamps 2 application. I wand
    > > to send a short msg from my Computer to Basic Stamp2 though a
    > > interface made by Visual Basic. I use MSComm1 object to initialize
    > > a COM port. The Stamp 2 does simple job to return an acknowleedge to
    > > the sender. They communicated through a straight through cable
    > > (RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
    > > first on the COM 1 of the Computer, then I start run my application
    > > on my Computer, I got a error msg " The Port is already open." If I
    > > run the application first, then Stamp, same error. It sounds like
    > > they both can not share the Port. I know threr is somewhere wrong in
    > > my code. Would somebody fix the piece of code for me? I appreciate
    > > what ever you give me a hits. (no Compile Problem)
    > > Jenny Luo
    > > This code is written by a book writer, Jan Axelson
    > > Serial Port Complete, ISBN 096508192
    > >
    > > Public Function fncInitializeComPort _
    > > (BitRate As Long, PortNumber As Integer) As Boolean
    > > 'BitRate and PortNumber are passed to this routine.
    > > 'All other properties are set explicitly in the routine.
    > > Dim ComSettings$
    > > If MSComm1.PortOpen = True Then
    > > MSComm1.PortOpen = False
    > > End If
    > > ComSettings = CStr(BitRate) & ",N,8,1"
    > > MSComm1.CommPort = PortNumber
    > > ' bit rate, no parity, 8 data, and 1 stop bit.
    > > MSComm1.Settings = ComSettings
    > > 'Set to 0 to read entire buffer on Input
    > > MSComm1.InputLen = 0
    > > MSComm1.InBufferSize = 256
    > > 'Input and output data are the contents of a byte array
    > > 'stored in a variant.
    > > MSComm1.InputMode = comInputModeBinary
    > > 'MSComm does no handshaking.
    > > MSComm1.Handshaking = comNone
    > > MSComm1.OutBufferSize = 256
    > > MSComm1.EOFEnable = False
    > > 'No OnComm event on received data.
    > > MSComm1.RThreshold = 0
    > > 'No OnComm transmit event.
    > > MSComm1.SThreshold = 0
    > > MSComm1.PortOpen = True
    > > fncInitializeComPort= True
    > > End Function
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject
    and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-14 21:37
    I am not familiar with vb script very well so I cannot comment on Don's
    suggestions...... But I agree with Rodent that the stamp editor is what
    has the port already open, For example:


    your code contains this

    If MSComm1.PortOpen = True Then
    MSComm1.PortOpen = False
    End If

    So there is where your prog is failing............my suggestion...make your
    stamp program function with the vb interface only...........you only need
    the stamp editor to "flash" the prog to the stamp.......from then on,
    use your own interface. If you need to change the stamp prog, open the
    stamp editor, change the code and close it before starting your vb
    application.


    hope that helps


    Dave



    Original Message
    From: "Don" <renegade.engineer@v...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, June 13, 2002 11:29 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Serial Port Programming Problem


    > Does your Basic Stamp code have any 'Debug' statements in it? If so,
    > this is what is preventing the VB script from running after you download
    to
    > the the stamp. Take out any 'Debug' statements and you should have no
    > problems. I run VB script all the time on the same serial port as the
    stamp
    > programming line (pin '16' on the stamp). It works as long as there are
    no
    > commands in the Stamp code that access the port.
    > Don
    >
    Original Message
    > From: "wlycory" <wlycory@y...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, June 13, 2002 2:53 PM
    > Subject: [noparse][[/noparse]basicstamps] Serial Port Programming Problem
    >
    >
    > > Hi, I am begining to learn to write a Stamps 2 application. I wand
    > > to send a short msg from my Computer to Basic Stamp2 though a
    > > interface made by Visual Basic. I use MSComm1 object to initialize
    > > a COM port. The Stamp 2 does simple job to return an acknowleedge to
    > > the sender. They communicated through a straight through cable
    > > (RS232 9 pin). Everytime I run the Stamps code through Stamp Editor
    > > first on the COM 1 of the Computer, then I start run my application
    > > on my Computer, I got a error msg " The Port is already open." If I
    > > run the application first, then Stamp, same error. It sounds like
    > > they both can not share the Port. I know threr is somewhere wrong in
    > > my code. Would somebody fix the piece of code for me? I appreciate
    > > what ever you give me a hits. (no Compile Problem)
    > > Jenny Luo
    > > This code is written by a book writer, Jan Axelson
    > > Serial Port Complete, ISBN 096508192
    > >
    > > Public Function fncInitializeComPort _
    > > (BitRate As Long, PortNumber As Integer) As Boolean
    > > 'BitRate and PortNumber are passed to this routine.
    > > 'All other properties are set explicitly in the routine.
    > > Dim ComSettings$
    > > If MSComm1.PortOpen = True Then
    > > MSComm1.PortOpen = False
    > > End If
    > > ComSettings = CStr(BitRate) & ",N,8,1"
    > > MSComm1.CommPort = PortNumber
    > > ' bit rate, no parity, 8 data, and 1 stop bit.
    > > MSComm1.Settings = ComSettings
    > > 'Set to 0 to read entire buffer on Input
    > > MSComm1.InputLen = 0
    > > MSComm1.InBufferSize = 256
    > > 'Input and output data are the contents of a byte array
    > > 'stored in a variant.
    > > MSComm1.InputMode = comInputModeBinary
    > > 'MSComm does no handshaking.
    > > MSComm1.Handshaking = comNone
    > > MSComm1.OutBufferSize = 256
    > > MSComm1.EOFEnable = False
    > > 'No OnComm event on received data.
    > > MSComm1.RThreshold = 0
    > > 'No OnComm transmit event.
    > > MSComm1.SThreshold = 0
    > > MSComm1.PortOpen = True
    > > fncInitializeComPort= True
    > > End Function
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject
    and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-14 22:53
    Hi, Thanks for your help. I solved the Problem and
    get another problem:
    Everytime I send a meg to the Stamp and let Stamp
    response with Acknowledge. The MSComm1.Input always
    gets what is in the MSComm1.Output. It sounds like
    they didn't talk each other. The PC actually talked
    with its own Buffer. But MSComm1.InBufferCount really
    got some number. If I disconnect the cable, PC got
    nothing from its own Buffer. Please continue support
    me while I am really need your hits. Thanks.
    Jenny

    --- Dave <samhell@s...> wrote:
    > I am not familiar with vb script very well so I
    > cannot comment on Don's
    > suggestions...... But I agree with Rodent that the
    > stamp editor is what
    > has the port already open, For example:
    >
    >
    > your code contains this
    >
    > If MSComm1.PortOpen = True Then
    > MSComm1.PortOpen = False
    > End If
    >
    > So there is where your prog is failing............my
    > suggestion...make your
    > stamp program function with the vb interface
    > only...........you only need
    > the stamp editor to "flash" the prog to the
    > stamp.......from then on,
    > use your own interface. If you need to change
    > the stamp prog, open the
    > stamp editor, change the code and close it
    > before starting your vb
    > application.
    >
    >
    > hope that helps
    >
    >
    > Dave
    >
    >
    >
    >
    Original Message
    > From: "Don" <renegade.engineer@v...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, June 13, 2002 11:29 PM
    > Subject: Re: [noparse][[/noparse]basicstamps] Serial Port Programming
    > Problem
    >
    >
    > > Does your Basic Stamp code have any 'Debug'
    > statements in it? If so,
    > > this is what is preventing the VB script from
    > running after you download
    > to
    > > the the stamp. Take out any 'Debug' statements
    > and you should have no
    > > problems. I run VB script all the time on the
    > same serial port as the
    > stamp
    > > programming line (pin '16' on the stamp). It
    > works as long as there are
    > no
    > > commands in the Stamp code that access the port.
    > > Don
    > >
    Original Message
    > > From: "wlycory" <wlycory@y...>
    > > To: <basicstamps@yahoogroups.com>
    > > Sent: Thursday, June 13, 2002 2:53 PM
    > > Subject: [noparse][[/noparse]basicstamps] Serial Port Programming
    > Problem
    > >
    > >
    > > > Hi, I am begining to learn to write a Stamps 2
    > application. I wand
    > > > to send a short msg from my Computer to Basic
    > Stamp2 though a
    > > > interface made by Visual Basic. I use MSComm1
    > object to initialize
    > > > a COM port. The Stamp 2 does simple job to
    > return an acknowleedge to
    > > > the sender. They communicated through a straight
    > through cable
    > > > (RS232 9 pin). Everytime I run the Stamps code
    > through Stamp Editor
    > > > first on the COM 1 of the Computer, then I start
    > run my application
    > > > on my Computer, I got a error msg " The Port is
    > already open." If I
    > > > run the application first, then Stamp, same
    > error. It sounds like
    > > > they both can not share the Port. I know threr
    > is somewhere wrong in
    > > > my code. Would somebody fix the piece of code
    > for me? I appreciate
    > > > what ever you give me a hits. (no Compile
    > Problem)
    > > > Jenny Luo
    > > > This code is written by a book writer, Jan
    > Axelson
    > > > Serial Port Complete, ISBN 096508192
    > > >
    > > > Public Function fncInitializeComPort _
    > > > (BitRate As Long, PortNumber As Integer) As
    > Boolean
    > > > 'BitRate and PortNumber are passed to this
    > routine.
    > > > 'All other properties are set explicitly in the
    > routine.
    > > > Dim ComSettings$
    > > > If MSComm1.PortOpen = True Then
    > > > MSComm1.PortOpen = False
    > > > End If
    > > > ComSettings = CStr(BitRate) & ",N,8,1"
    > > > MSComm1.CommPort = PortNumber
    > > > ' bit rate, no parity, 8 data, and 1 stop
    > bit.
    > > > MSComm1.Settings = ComSettings
    > > > 'Set to 0 to read entire buffer on Input
    > > > MSComm1.InputLen = 0
    > > > MSComm1.InBufferSize = 256
    > > > 'Input and output data are the contents of a
    > byte array
    > > > 'stored in a variant.
    > > > MSComm1.InputMode = comInputModeBinary
    > > > 'MSComm does no handshaking.
    > > > MSComm1.Handshaking = comNone
    > > > MSComm1.OutBufferSize = 256
    > > > MSComm1.EOFEnable = False
    > > > 'No OnComm event on received data.
    > > > MSComm1.RThreshold = 0
    > > > 'No OnComm transmit event.
    > > > MSComm1.SThreshold = 0
    > > > MSComm1.PortOpen = True
    > > > fncInitializeComPort= True
    > > > End Function
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed.
    > Text in the Subject
    > and
    > > Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > > >
    > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed.
    > Text in the Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Yahoo! - Official partner of 2002 FIFA World Cup
    http://fifaworldcup.yahoo.com
Sign In or Register to comment.