Solved

Write to COM1 (Serial Port) .Net VB (Studio 2005) - for POLE DISPLAY

Posted on 2007-04-01
3
1,427 Views
Last Modified: 2008-02-01
Hi ! I am a rookie to .Net VB(Studio 2005); in my legacy program I use the basic below to communicate with a serial port that has a POLE display attached to it.

OPEN"COM1:9600,N,8,1" FOR OUTPUT AS #6
     PRINT #6, "Test 1234"
     CLOSE#6

How do I do this with .Net VB ; please provide code and not just a link.

Thanks
BASit
0
Comment
Question by:BASit Bulbulia
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
r1937 earned 250 total points
ID: 18831780
I have no experience with serial port communication, but try this:

In the toolbox, there is control called "SerialPort".
Add it and from the properties you can set its connection settings:
PortName:"COM1", Baud:"9600", Parity:"None", DataBits:8, StopBits:"ONE".

Default settings may be sufficient.
After that just code in:

        SerialPort1.Open()
        SerialPort1.Write("Test1234")
        SerialPort1.Close()
0
 

Author Comment

by:BASit Bulbulia
ID: 18832381
Thanks, unfortunately although I have COM1: on my PC and a Pole Dispaly connected to it; it will upon SerialPort1.Open() give and exception error (access denied).

Maybe some other expert who worked with COM ports may be able to explain how . .

BASit
0
 

Author Comment

by:BASit Bulbulia
ID: 18952123
Sorry dude;
 
I did not realise that this question was still open . . .

I tries the code with a working com port and it works :-)

Ta


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now