473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access RS232

Hi,

how can I access the RS-232 hardware interface using C# and .NET2.0 to send
and receive messages to a hardware component?

Christian
Nov 14 '07 #1
5 3010
Hello Christian,

There is SerialPort class in .NET 2.0 and some 3rd part libs for this http://www.activexperts.com/activcomport/howto/vcnet/

you can find some samples there http://msmvps.com/blogs/coad/archive...300_-.NET.aspx

or on www.codeproject.com

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
CHHi,
CH>
CHhow can I access the RS-232 hardware interface using C# and .NET2.0
CHto send and receive messages to a hardware component?
CH>
CHChristian
CH>
Nov 14 '07 #2
Hi Michael,

thank you.
Can I use this class, when I connect the hardware to a notebook (USB) using
an RS232 to USB - adapter?

Christian

"Michael Nemtsev [MVP]" wrote:
Hello Christian,

There is SerialPort class in .NET 2.0 and some 3rd part libs for this http://www.activexperts.com/activcomport/howto/vcnet/

you can find some samples there http://msmvps.com/blogs/coad/archive...300_-.NET.aspx

or on www.codeproject.com

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
CHHi,
CH>
CHhow can I access the RS-232 hardware interface using C# and .NET2.0
CHto send and receive messages to a hardware component?
CH>
CHChristian
CH>
Nov 14 '07 #3

"Christian Havel" <Ch************@discussions.microsoft.comwrote in
message news:98**********************************@microsof t.com...
Hi Michael,

thank you.
Can I use this class, when I connect the hardware to a notebook (USB)
using
an RS232 to USB - adapter?
As long as it provides a virtual comm port (VCP) driver... but I found the
SerialPort class rather inadequate. For one thing, it doesn't accept all
valid device names, it requires that the name begin with "COM". Since I get
device names from the Plug-n-Play layer that was no good.
>
Christian

"Michael Nemtsev [MVP]" wrote:
>Hello Christian,

There is SerialPort class in .NET 2.0 and some 3rd part libs for this
http://www.activexperts.com/activcomport/howto/vcnet/

you can find some samples there
http://msmvps.com/blogs/coad/archive...300_-.NET.aspx

or on www.codeproject.com

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and
we
miss it, but that it is too low and we reach it" (c) Michelangelo
CHHi,
CH>
CHhow can I access the RS-232 hardware interface using C# and .NET2.0
CHto send and receive messages to a hardware component?
CH>
CHChristian
CH>

Nov 14 '07 #4
Hi Ben,

thank you. Can you tell me another way to communicate with the RS232 using C#?
Christian

"Ben Voigt [C++ MVP]" wrote:
>
"Christian Havel" <Ch************@discussions.microsoft.comwrote in
message news:98**********************************@microsof t.com...
Hi Michael,

thank you.
Can I use this class, when I connect the hardware to a notebook (USB)
using
an RS232 to USB - adapter?

As long as it provides a virtual comm port (VCP) driver... but I found the
SerialPort class rather inadequate. For one thing, it doesn't accept all
valid device names, it requires that the name begin with "COM". Since I get
device names from the Plug-n-Play layer that was no good.

Christian

"Michael Nemtsev [MVP]" wrote:
Hello Christian,

There is SerialPort class in .NET 2.0 and some 3rd part libs for this
http://www.activexperts.com/activcomport/howto/vcnet/

you can find some samples there
http://msmvps.com/blogs/coad/archive...300_-.NET.aspx

or on www.codeproject.com

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and
we
miss it, but that it is too low and we reach it" (c) Michelangelo
CHHi,
CH>
CHhow can I access the RS-232 hardware interface using C# and .NET2.0
CHto send and receive messages to a hardware component?
CH>
CHChristian
CH>


Nov 15 '07 #5

"Christian Havel" <Ch************@discussions.microsoft.comwrote in
message news:E7**********************************@microsof t.com...
Hi Ben,

thank you. Can you tell me another way to communicate with the RS232 using
C#?
Christian
I used C++/CLI to make my own .NET serial port class based on WinAPI
functions such as CreateFile, SetCommState, WaitCommEvent, ReadFileEx,
WriteFileEx. Using those directly from C# would be rather ugly and quite
error prone.
If the MS SerialPort class is sufficient for your needs then use it, I just
happened to want non-blocking event-driven I/O and to use the full device
name for my USB/serial converters, for example one of my ports is named
"\\?\ftdibus#vid_0403+pid_6010+ftq4s2a9b#0000#{86e 0d1e0-8089-11d0-9ce4-08003e301f73}".
Having my own class also will be advantageous someday when I write a mock
serial object for unit testing.

>
"Ben Voigt [C++ MVP]" wrote:
>>
"Christian Havel" <Ch************@discussions.microsoft.comwrote in
message news:98**********************************@microsof t.com...
Hi Michael,

thank you.
Can I use this class, when I connect the hardware to a notebook (USB)
using
an RS232 to USB - adapter?

As long as it provides a virtual comm port (VCP) driver... but I found
the
SerialPort class rather inadequate. For one thing, it doesn't accept all
valid device names, it requires that the name begin with "COM". Since I
get
device names from the Plug-n-Play layer that was no good.
>
Christian

"Michael Nemtsev [MVP]" wrote:

Hello Christian,

There is SerialPort class in .NET 2.0 and some 3rd part libs for this
http://www.activexperts.com/activcomport/howto/vcnet/

you can find some samples there
http://msmvps.com/blogs/coad/archive...300_-.NET.aspx

or on www.codeproject.com

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high
and
we
miss it, but that it is too low and we reach it" (c) Michelangelo
CHHi,
CH>
CHhow can I access the RS-232 hardware interface using C# and
.NET2.0
CHto send and receive messages to a hardware component?
CH>
CHChristian
CH>



Nov 15 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Chris | last post by:
Here's the situation: I work at a scientific institution and I have a portable electronic device which is used to take measurements. The device produces a very small amount of numerical data,...
1
by: Dan | last post by:
I wnat to see in browser an status from an device connected on rs232 port The java class for read from serial port is: //Serial.java import java.io.*; import java.util.*; import...
6
by: Przemo | last post by:
Hi, Do you know some good RS232C class? There is one in VB.NET 101 Examples, but I think it is poor. 1. I can't for e.g. read into my application all data received. I must tell how many...
4
by: leovg | last post by:
Can I access the serial port (RS232) out of an ASP.NET 2.0 client form? We are planning a barcode application where a barcode scanner delivers input to an ASP.NET form via RS232.
8
by: Terry Olsen | last post by:
I'm trying to use the RS232 class that was in the Platform SDK (i think). Has anyone else used this with events successfully? Here's what i've got: ====================== Public WithEvents...
13
by: jay.dow | last post by:
I want to write to the pins of an RS232 without using the serial protocol. The use would be every pin could act to complete a circuit in customized hardware. I could use python to communicate...
4
by: Dave Harry | last post by:
I found the RS232 class from MS's 101 VB samples. Writing to the port works fine. (I've got hyperterminal on the other comm port and a crossover cable between COM1 and COM2) The port is opened...
6
by: Henning M | last post by:
Hi all, Im trying to send a command to my uprocessor project, but when i try to read the answer for the uPU I get the same commed I just send to it??? It is as if the command isn't send before I...
5
by: Canuno | last post by:
Hi, I'm trying to send a small string to a serial port rs232 located in com 4. the string is: "ST GA#ˇ" The Baud Rate is: 38400 Parity: None Data Bits: 8 Stops Bits: 1 Flow Control: None...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.