Home All Groups Group Topic Archive Search About

How to use Serial Port Component

Author
29 May 2010 8:23 PM
bpsdgnews
Hi,

In my old VB6 program I am controlling the shutter of a Digital camera
through the serial port.

I only needed this line to open the shutter:

Open "COM1:9600,n,8,1,cd0,cs0,op0" For Random As #1

I am rewriting the program in vb.net (2010) and want to use the Serial
Port Component.

But I can't get it to work.

All the hardware is okay, since from the VB6 program it still works.

Any suggestions?

Bas.

Author
31 May 2010 6:57 PM
bpsdgnews
On 29 mei, 22:23, bpsdgnews <dippi***@gmail.com> wrote:
Show quoteHide quote
> Hi,
>
> In my old VB6 program I am controlling the shutter of a Digital camera
> through the serial port.
>
> I only needed this line to open the shutter:
>
> Open "COM1:9600,n,8,1,cd0,cs0,op0" For Random As #1
>
> I am rewriting the program in vb.net (2010) and want to use the Serial
> Port Component.
>
> But I can't get it to work.
>
> All the hardware is okay, since from the VB6 program it still works.
>
> Any suggestions?
>
> Bas.


This was so easy in VB6.

I am searching for days already to do it in VB.net. So frustrating.
Author
31 May 2010 7:27 PM
Armin Zingler
Am 31.05.2010 20:57, schrieb bpsdgnews:
Show quoteHide quote
> On 29 mei, 22:23, bpsdgnews <dippi***@gmail.com> wrote:
>> Hi,
>>
>> In my old VB6 program I am controlling the shutter of a Digital camera
>> through the serial port.
>>
>> I only needed this line to open the shutter:
>>
>> Open "COM1:9600,n,8,1,cd0,cs0,op0" For Random As #1
>>
>> I am rewriting the program in vb.net (2010) and want to use the Serial
>> Port Component.
>>
>> But I can't get it to work.

Why can't you get it to work? Not compilable? Exception? Unexpected
behavior? What do the values in "COM1:9600,n,8,1,cd0,cs0,op0" mean?


Show quoteHide quote
>> All the hardware is okay, since from the VB6 program it still works.
>>
>> Any suggestions?
>>
>> Bas.
>
>
> This was so easy in VB6.
>
> I am searching for days already to do it in VB.net. So frustrating.


--
Armin
Author
1 Jun 2010 4:16 PM
DickGrier
I have examples on my homepage (Software Downloads).  Even under VB6, your
method is not really supported, though it would work in some situations
(internal serial ports) --  not with USB serial adapters, for example.

You should use the SerialPort object, which is in the Toolbox
(System.IO.Ports.SerialPort).

Dick

--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.