473,758 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serial port and C++ .NET

Hello,

Someone can help me about serial port with C++ .NET (Windows forms
application). Like setting port, opening it, transmiting, receiving,
closing, etc.

Thanks very much (for me and my students)
Nov 16 '05 #1
6 14021
> Hello,

Someone can help me about serial port with C++ .NET (Windows forms
application). Like setting port, opening it, transmiting, receiving,
closing, etc.

Thanks very much (for me and my students)


Hi,

you can open a com port with CreateFile (filename "COM1:") and operate with
normal read and write. I think
it's still the same in .NET.

Bye, Holger.
Nov 16 '05 #2

Or just download ACE (Adaptive Communications Environment)
for free and get a lot more power. :-)
-----Original Message-----
Hello,

Someone can help me about serial port with C++ .NET (Windows forms application). Like setting port, opening it, transmiting, receiving, closing, etc.

Thanks very much (for me and my students)
Hi,

you can open a com port with CreateFile

(filename "COM1:") and operate withnormal read and write. I think
it's still the same in .NET.

Bye, Holger.
.

Nov 16 '05 #3
Jeff wrote:
Someone can help me about serial port with C++ .NET (Windows forms
application). Like setting port, opening it, transmiting, receiving,
closing, etc.


For C++ you could use:

CSerialPort v1.03 - Serial Port Wrapper
http://www.codeproject.com/system/cserialport.asp

Serial library for C++
http://www.codeproject.com/system/serial.asp
--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
Nov 16 '05 #4
Has that been ported to .NET now?

Thanks,
Aaron Queenan.

"Thomas J. Clancy" <tc*****@netspo ke.com> wrote in message
news:08******** *************** *****@phx.gbl.. .

Or just download ACE (Adaptive Communications Environment)
for free and get a lot more power. :-)
-----Original Message-----
Hello,

Someone can help me about serial port with C++ .NET (Windows forms application). Like setting port, opening it, transmiting, receiving, closing, etc.

Thanks very much (for me and my students)


Hi,

you can open a com port with CreateFile

(filename "COM1:") and operate with
normal read and write. I think
it's still the same in .NET.

Bye, Holger.
.

Nov 16 '05 #5
There is a decent article here:

http://msdn.microsoft.com/msdnmag/is...m/default.aspx

The code is in C#, you can convert easily if you must. This basically
accesses the native API's; you have all the "power" you need.

Cheers,
Sarat Venugopal
Huelix Solutions
www.huelix.com

*Remove '_ng' and 'n0spam' to reply


"Jeff" <pr*******@hotm ail.com> wrote in message
news:V6******** ************@wa gner.videotron. net...
Hello,

Someone can help me about serial port with C++ .NET (Windows forms
application). Like setting port, opening it, transmiting, receiving,
closing, etc.

Thanks very much (for me and my students)

Nov 16 '05 #6
Unfortunately we do not provide any mechanism in the framework to easily
accomplish serialport communication. This is a highly requested feautre and
we are seriously considering it for the next release.

However there is some documentation that might help you. The following has
a few links under the Accessing COM ports from C#/VB.Net that might be
helpfull:
http://www.gotdotnet.com/team/csharp/code/default.aspx

This has some samples implementations that you could use:
http://www.gotdotnet.com/community/u...x?query=Serial

I have personally used the following sample and it provided all of the
functionality that I needed:

http://www.gotdotnet.com/Community/U...mpleGuid=b06e3
0f9-1301-4cc6-ac14-dfe325097c69

Thanks,

Ryan Byington [MS]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
From: "Jeff" <pr*******@hotm ail.com>
Newsgroups: microsoft.publi c.dotnet.langua ges.vc
Subject: Serial port and C++ .NET
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <V6************ ********@wagner .videotron.net>
Date: Mon, 1 Sep 2003 22:18:31 -0400
NNTP-Posting-Host: 66.131.57.98
X-Complaints-To: ab***@videotron .ca
X-Trace: wagner.videotro n.net 1062469173 66.131.57.98 (Mon, 01 Sep 2003 22:19:33 EDT)NNTP-Posting-Date: Mon, 01 Sep 2003 22:19:33 EDT
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new sfeed00.sul.t-online.de!t-onlin
e.de!newsfeed.i cl.net!newsfeed .fjserv.net!pro xad.net!proxad. net!newshosting .
com!news-xfer2.atl.newsh osting.com!diab lo.voicenet.com !wesley.videotr on.net!
wagner.videotro n.net.POSTED!no t-for-mailXref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vc:27781
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vc

Hello,

Someone can help me about serial port with C++ .NET (Windows forms
application) . Like setting port, opening it, transmiting, receiving,
closing, etc.

Thanks very much (for me and my students)


Nov 16 '05 #7

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

Similar topics

4
9094
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the same port to change the direction of the robot. The trajectory frame is managed by an applet, and the project works good when the applet is called by a html document allocated in the same local machine under W98 where the classes and the serial port...
2
13194
by: willie | last post by:
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. However, I'm unsure of how exactly I should be designing the program, I thought I could use threading to start class: class scanner(Thread): def __init__(self,port):
3
5055
by: collinm | last post by:
hi i send a command to a led display, the led display is suppose to return me some character i write a string on a serial port void ledDisplayExist() { char msg={'\0', '\0', '\0', '\0', '\0', '\1', 'Z', '0', '0',
13
4833
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have been told it is not possible to access the serial ports from asp.net. The application is used to control custom hardware. The hardware is connected to a PC through serial ports. Our customer wants to control the hardware from a remote...
4
11207
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. What I would like to do is make the serial port accessible via a web service. The web service and the legacy application would be running on the same machine. The mobile application would access the web service via a network connection. It...
4
17816
by: Frank | last post by:
Hello, how to get information about all serial ports in the PC? I use the following code, but i got only the data of the FIRST serial port. All other serial port information are not available with this code sample: ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort");
13
6209
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I am sending a short message to a group of embedded boxes daisy chained via the serial port. When I send a 'global' message, all the connected units should reply with their Id and Ack in this format '0 Ack' To be certain that I didn't miss a...
4
11788
by: rowan | last post by:
I'm writing a driver in Python for an old fashioned piece of serial equipment. Currently I'm using the USPP serial module. From what I can see all the serial modules seem to set the timeout when you open a serial port. This is not what I want to do. I need to change the timeout each time I do a "read" on the serial port, depending on which part of the protocol I've got to. Sometimes a return character is expected within half a second,...
3
11631
by: naveen.sabapathy | last post by:
Hi, I am trying to use virtual serial ports to develop/test my serial communication program. Running in to trouble... I am using com0com to create the virtual ports. The virtual ports seem to be working fine when I test it with Hyperterminal . I am using the example program that comes with pyserial, as below. --------------- import serial
6
6669
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send '%' to serial port and make sure it reached the serial port. 2. Once confirmed, send another character.
0
10076
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9908
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9740
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8744
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7287
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3832
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.