open serial port with mscomm 
Author Message
 open serial port with mscomm

I am trying to open a com port using the mscomm object. I
keep getting "Object Variable not set error 91."
I have gathered that I need to define the mscomm as an
object. and I also gathered that I need to set mscomm to
something in order to use that object. But what do I set
the object to. I don't seem to have mscomm.vbx in my
windows/system directory, so I downloaded it and put it
there. But this makes no difference.
Can anyone shed some light on this problem.
Thanks,
Gert


Tue, 06 Dec 2005 02:29:30 GMT  
 open serial port with mscomm
mscomm.vbx? Are you using VB3? If VB5/6, load the mscomm control from the components
dialog, drop one on a form, set its properties and go.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups..



Quote:
> I am trying to open a com port using the mscomm object. I
> keep getting "Object Variable not set error 91."
> I have gathered that I need to define the mscomm as an
> object. and I also gathered that I need to set mscomm to
> something in order to use that object. But what do I set
> the object to. I don't seem to have mscomm.vbx in my
> windows/system directory, so I downloaded it and put it
> there. But this makes no difference.
> Can anyone shed some light on this problem.
> Thanks,
> Gert



Tue, 06 Dec 2005 02:58:50 GMT  
 open serial port with mscomm
Thanks for replying so fast Ken. I am using VB6.0
I did what you suggested but I still get the error. I'm
not sure I am doing everything correctly. I put the MScomm
on the form and set the properties I need. But I still get
the error.
Let me explain my app.
I am writing this to extract data from a serial EEPROM. So
I need to control RTS seperately for the Chip Select line
on the EEPROM. OF course I'll be using Rx and TX for the
DataIn and DataOut of the EEPROM. And I'm using the
DTEReady for my clock.
The only trouble I am running into so far is getting
control of opening the port.

Here's an example I got from the help files:

This is a default port setup
MSComm1.Commport = 1    
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True

This alone generates the error 91. So I fugured out that I
was not defining MScomm1 as an object and I was not
setting that object. So does the MScomm component do this
for me?

Quote:
>-----Original Message-----
>mscomm.vbx? Are you using VB3? If VB5/6, load the mscomm

control from the components
Quote:
>dialog, drop one on a form, set its properties and go.

>--
>Ken Halter - MS-MVP-VB - http://www.vbsight.com
>Please keep it in the groups..



>> I am trying to open a com port using the mscomm object.
I
>> keep getting "Object Variable not set error 91."
>> I have gathered that I need to define the mscomm as an
>> object. and I also gathered that I need to set mscomm to
>> something in order to use that object. But what do I set
>> the object to. I don't seem to have mscomm.vbx in my
>> windows/system directory, so I downloaded it and put it
>> there. But this makes no difference.
>> Can anyone shed some light on this problem.
>> Thanks,
>> Gert

>.



Tue, 06 Dec 2005 03:57:27 GMT  
 open serial port with mscomm
Hi,

You should use MSComm in the normal way.  Add it to the ToolBox, drop it on
a form, and add code to use it.

You can download mComm from my homepage, for an alternate method, but I
really don't recommend it.  BTW, I have lots of examples in my book (see
below) that might help.

Once you open the port, you control RTS by using the RTSEnable property.

Dick

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Tue, 06 Dec 2005 06:22:11 GMT  
 open serial port with mscomm
You need to select... the Project-->Components menu. When the dialog opens, scroll down to
'Microsoft Comm Control 6.0' and place a check in the box. After closing the dialog, a
little "phone" should show in the toolbox. Open the form's designer window and double
click that control to get one on the form (or select it and draw it on the form). The
default name for that control is the same as the code you provided so you should be able
to get going from there.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups.


Quote:
> Thanks for replying so fast Ken. I am using VB6.0
> I did what you suggested but I still get the error. I'm
> not sure I am doing everything correctly. I put the MScomm
> on the form and set the properties I need. But I still get
> the error.
> Let me explain my app.
> I am writing this to extract data from a serial EEPROM. So
> I need to control RTS seperately for the Chip Select line
> on the EEPROM. OF course I'll be using Rx and TX for the
> DataIn and DataOut of the EEPROM. And I'm using the
> DTEReady for my clock.
> The only trouble I am running into so far is getting
> control of opening the port.

> Here's an example I got from the help files:

> This is a default port setup
> MSComm1.Commport = 1
> MSComm1.Settings = "9600,N,8,1"
> MSComm1.PortOpen = True

> This alone generates the error 91. So I fugured out that I
> was not defining MScomm1 as an object and I was not
> setting that object. So does the MScomm component do this
> for me?

> >-----Original Message-----
> >mscomm.vbx? Are you using VB3? If VB5/6, load the mscomm
> control from the components
> >dialog, drop one on a form, set its properties and go.

> >--
> >Ken Halter - MS-MVP-VB - http://www.vbsight.com
> >Please keep it in the groups..



> >> I am trying to open a com port using the mscomm object.
> I
> >> keep getting "Object Variable not set error 91."
> >> I have gathered that I need to define the mscomm as an
> >> object. and I also gathered that I need to set mscomm to
> >> something in order to use that object. But what do I set
> >> the object to. I don't seem to have mscomm.vbx in my
> >> windows/system directory, so I downloaded it and put it
> >> there. But this makes no difference.
> >> Can anyone shed some light on this problem.
> >> Thanks,
> >> Gert

> >.



Tue, 06 Dec 2005 11:41:14 GMT  
 open serial port with mscomm
Thanks for the suggestions Ken and{*filter*}. Obviously they
work as long as I use them correctly. What I was doing was
using a Configure  Comport button and trying to use the
MScomm1 object in that sub. I took all that I needed out
of the button and put in the Oncomm sub where it belongs.
This seems to pull it off. Thanks again.
Gert

PS
I'll keep your book in mind.

Quote:
>-----Original Message-----
>I am trying to open a com port using the mscomm object. I
>keep getting "Object Variable not set error 91."
>I have gathered that I need to define the mscomm as an
>object. and I also gathered that I need to set mscomm to
>something in order to use that object. But what do I set
>the object to. I don't seem to have mscomm.vbx in my
>windows/system directory, so I downloaded it and put it
>there. But this makes no difference.
>Can anyone shed some light on this problem.
>Thanks,
>Gert
>.



Tue, 06 Dec 2005 20:41:50 GMT  
 open serial port with mscomm
Can you please stop trying to sell your book? It's getting on everybody's
nerves here...



Quote:
> Hi,

> You should use MSComm in the normal way.  Add it to the ToolBox, drop it
on
> a form, and add code to use it.

> You can download mComm from my homepage, for an alternate method, but I
> really don't recommend it.  BTW, I have lots of examples in my book (see
> below) that might help.

> Once you open the port, you control RTS by using the RTSEnable property.

>{*filter*}

> --
> Richard Grier  (Microsoft Visual Basic MVP)

> See www.hardandsoftware.net for contact information.

> Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
> Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Sat, 10 Dec 2005 00:00:44 GMT  
 open serial port with mscomm
When it seems appropriate, I mention it.  It saves time, and (I hope, often)
it is helpful.  So, the answer is, "No."

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Sat, 10 Dec 2005 00:37:19 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Problems with opening the serial port using MsComm

2. mscomm - send/receive from serial port

3. ?MSCOMM - Read Signals From Serial Ports

4. Mscomm, serial port question

5. Using serial port without using MSCOMM

6. Mscomm doesn't hear my serial port

7. MSComm problem with multi-port serial card

8. VB Communications, MSComm, Serial Ports and Modems...

9. Modems, Serial Ports, MSComm and VB

10. Modem, serial port, MSComm and VB Communications

11. Serial port, MSComm, Modem and VB communication

12. VB3 Serial Port Control without MSCOMM.VBX

 

 
Powered by phpBB® Forum Software