Solved

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

Posted on 2007-04-01
3
1,435 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with distributing .NET Framework with Clickonce technology 2 36
vb.net 2 43
Close form "before" open 3 40
Get the selected ValueMember of Combobox 5 30
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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