CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: Date Entered: 1/14/2005 7:02:26 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 6 Views: 75 Favorited: 0 Favorite
7 Items, 1 Pages 1 |< << Go >> >|
"sridhar1" <>
NewsGroup User
Library code for rs232 communication with com port1/14/2005 7:02:26 AM

-1

There are no example I can find on the serial port programming so far so can any one help :
I am trying to convert / test if the following code works in dot net 2.0
http://www.codeworks.it/net/VBNetRS232.htm
http://brian.vallelunga.com/code/x10/
While there are library to work with serial communication in Delphi and other development platform, there is very limited resource on this area. Can any one guide on this.

My intention is to program x10 firecracker so that it can turn on and off lights.
and also for barcode scanner drivers and webcam video conferencing.

Is usb 2.0 communication more difficult to program then through serial port.

thanks
"Fredrik N" <>
NewsGroup User
Re: Library code for rs232 communication with com port1/14/2005 7:47:20 AM

0

It was long time ago since I use communication over the serial bus.

Here is a simple example that will open a communication with the COM1 bus:

SerialPort port = new SerialPort("COM1");
port.Open();

Console.WriteLine(port.IsOpen);

port.Close();

You can use the Write method, WriteLine etc to send data to the serial bus.

SerialPort is a new class shipped with .Net 2.0 and is located within the System.IO.Ports namespace.

/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
"davebac" <>
NewsGroup User
Re: Library code for rs232 communication with com port1/18/2005 11:01:13 PM

0

You can also use P/Invoke and the native API's, if you're running from trusted code (anything on the local PC). Go to msdn.microsoft.com and download the platform SDK, and there should be some examples in that of RS232 if you need more than the basics (like if you need access to CTS, RTS, etc.). Any good book on Windows communications will explain those API's, but you'll need to write the P/Invoke wrappers yourself.
"StuartRothrock
NewsGroup User
Re: Library code for rs232 communication with com port4/16/2005 2:24:59 AM

0

I am using the SerialPort class in VB 2005 Express and it all looks very straight forward. I have a problem with SerialPort.Open though. It says access is denied to COM1. Any help is appreciated.

 

EDIT:

Fixed: Once I added a statement to close COM1: in the application prior to termination, the symptom disappeared. Looks like automatic object cleanup takes a long time when in the IDE.

"leonghz" <>
NewsGroup User
Re: Library code for rs232 communication with com port5/15/2005 4:53:29 PM

0

I'm a fresh Graduate. I just got a job. My first task is to create a software which communicates with a PLC from my COM1.

B4 i can start on it, i really need to get more Info regarding RS232. I read some article and i'm waiting to see some codes.

I understand that u did a VB.NET 2005 codes. What if i need to do it using VB.NET 2003? Any idea what other extra kits i need to do? do i need to install any extra DLL? Pls help, i hv only one month to complete it. :) Thanks vr much. Bye!


All The Best :)
"MrDave" <>
NewsGroup User
Re: Library code for rs232 communication with com port5/16/2005 3:37:09 AM

0

There are also a few commerical components that work w/ 2003 for example http://www.sax.net and http://www.componentscience.net/ 

We are acutally lookikng at libraries now for a client that needs to do modem file transfer to a bank...

Apparently this bank hasn't heard of moden technology yet :)

 

"imagemaker" <>
NewsGroup User
Re: Library code for rs232 communication with com port5/26/2005 1:18:14 PM

0

Although it does not include much .NET coding, *** Grier's book "Visual Basic Programmer's Guide to Serial Communications" (Mabry Publishing) is one of the best (few) sources for information on RS232 with many samples of techniques to interface various devices. His website at http://www.hardandsoftware.com also has some excelent links and code samples.  A couple of years ago I used an early release of Microsoft's (?) SerialPort.cs (which is now included in the Beta 2 of the .NET 2.0 framework) to interface a Leightronix event controller and Knox video switcher with good results.  I haven't looked recently, but SerialPort.cs is probably still available for download somewhere on the net.
Bill, WESNet Designs
7 Items, 1 Pages 1 |< << Go >> >|




   
  Privacy | Contact Us
All Times Are GMT