Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > serial port reading

Thread Tools

serial port reading

faran faran is offline
Junior Member
Join Date: Nov 2006
Posts: 1

I have a serial mouse just to provide data being sent to the port, and I just want to read the data from it. Here is the code I have so far,

System::IO:orts::SerialPort^ port = gcnew System::IO:orts::SerialPort();

array<String^>^ names = port->GetPortNames();
port->Handshake::set(System::IO:orts::Handshake::None );
port->StopBits::set(System::IO:orts::StopBits::One) ;

//port->Write("Some Text");
array<unsigned char,1>^ buf = gcnew array<unsigned char,1>(10);

//String^ line = port->ReadLine();
int read = port->Read(buf,0,10);

I opened up COM1 in hyperterminal, and it seems to get data ok. This piece of code however, hangs on the port->Read.

I'm not sure what i'm missing, and i'm hoping someone here has a bit more experience than me.

Reply With Quote

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
emulate a serial port in windows (create a virtual 'com' port) Pom Python 2 01-31-2007 07:49 PM
Serial Port programming - Reading DSR from port msalerno Perl Misc 3 07-14-2005 12:58 PM
Can I connect router Serial interface directly to a PC serial port? Faustino Dina Cisco 2 08-18-2004 02:30 AM
Re: Serial port and PS/2 port schematics OR Assistive Tech. suggestion Computer Support 1 07-10-2003 11:46 AM
Re: Serial port and PS/2 port schematics °Mike° Computer Support 1 07-09-2003 10:30 PM