Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller Visual Studio 2010 <-> RS232 <-> Microcontroller
Visual Studio 2010 <-> RS232 <-> Microcontroller
Go Back  Xtreme Visual Basic Talk > > > Visual Studio 2010 <-> RS232 <-> Microcontroller


Reply
 
Thread Tools Display Modes
  #1  
Old 06-02-2010, 03:21 AM
wa7ed wa7ed is offline
Newcomer
 
Join Date: Jun 2010
Posts: 1
Default Visual Studio 2010 <-> RS232 <-> Microcontroller


Hi !

I'm working in a project and want to make a graphical interface using Visual Studio 2010 .Net

I want to send and receive commands/data through the serial UART.

Let's say, if the microcontroller receives a Byte with value = (0x11), it will switch on an LED. or it will send back the temperature >> Then we need to read it in the PC screen..

Hope my question is clear..

Regards.
Reply With Quote
  #2  
Old 06-16-2010, 09:49 AM
mkaras's Avatar
mkarasVisual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller mkaras is offline
Ultimate Contributor

Retired Leader
* Expert *
 
Join Date: Mar 2004
Location: Beaverton, OR
Posts: 1,874
Default

You are doing a first level job of describing something you think you want to do. However there is a whole lot of detail that you need to figure out before much help can be gained from a forum that discusses Basic programming on a PC. You'll need to figure out what MCU hardware you intend to use. If you are going to build it you'll also have to figure out how to get some programming into that as well. How exactly is this device connected to the PC and do you have an independent way to verify if the connection interface and communications protocol are working properly. You'll need this all in place before it will be productive to talk about your VB .Net programming.

mkaras

Last edited by mkaras; 06-16-2010 at 01:26 PM.
Reply With Quote
  #3  
Old 06-17-2010, 03:13 AM
CrashPilot CrashPilot is offline
Regular
 
Join Date: Jun 2009
Location: Netherlands
Posts: 73
Default

If you want RS232 communications then: all you will need can be found in the System.IO.Ports namespace.

Code:
Dim RS232Port As New IO.Ports.SerialPort("COM1", 19700, IO.Ports.Parity.None)
RS232Port.DataBits = 8
RS232Port.StopBits = IO.Ports.StopBits.One
RS232Port.Handshake = IO.Ports.Handshake.None
From there you can open the com port and start sending or receiving bytes. You can set the transmit buffer to one byte becouse the EUSART module on the microprocessor has probably no buffer for receiving. Atleast the PIC16F didn't.

The SerialPort has events tied to it, if you declare it like so:
Code:
Public Class Main()
Private WithEvents RS232Port As New IO.Ports.SerialPort([arguments]) Private Sub DataReceived_Event(ByVal sender As Object, ByVal e As EventArgs)Handles RS232Port.DataReceived
Call HandleData( RS232Port.ReadLine )
End Sub
End Class
There are TONS of tutorials on the net on how to handle RS communications, I would suggest to read those first. Try this link for example

http://msdn.microsoft.com/en-us/libr...erialport.aspx

If you have more specific questions feel free to ask, also I am a Electrotechnical Engineer so don't be scared to go technical :P

Good luck
__________________
-- I divided by zero... and survived --
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
 
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
Visual Studio 2010 &lt;-&gt; RS232 &lt;-&gt; Microcontroller
 
-->