By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 913 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Get data from RS232 serial port with C/C++

P: 3
I have developed a hardware that will give data in terms of angle of rotation. The hardware is connected to PC via serial port. I can show the value through Hyperterminal. Now i'm on the way to develope a software for it. So, I would like to know how to get the data into my user interface with C/C++ programming language? Furthermore, i would like to store it in DAT file. Anyone has done it before? Or any suggestions/ websites of tutorials that enable me to learn bout this/ any sample source codes on related works.... thanks for the help...
Feb 26 '07 #1
Share this Question
Share on Google+
7 Replies


Motoma
Expert 2.5K+
P: 3,235
I have developed a hardware that will give data in terms of angle of rotation. The hardware is connected to PC via serial port. I can show the value through Hyperterminal. Now i'm on the way to develope a software for it. So, I would like to know how to get the data into my user interface with C/C++ programming language? Furthermore, i would like to store it in DAT file. Anyone has done it before? Or any suggestions/ websites of tutorials that enable me to learn bout this/ any sample source codes on related works.... thanks for the help...
I think the commands you are looking for are either inb() and outb() or inp() and outp().
Feb 26 '07 #2

P: 3
I think the commands you are looking for are either inb() and outb() or inp() and outp().
Can sir please explain further on it? As I'm a beginner in programming... Thanks for your kindness...
Feb 26 '07 #3

Motoma
Expert 2.5K+
P: 3,235
Can sir please explain further on it? As I'm a beginner in programming... Thanks for your kindness...
The inb() and outb() functions are used for communicating with the serial port.
Feb 26 '07 #4

Expert 100+
P: 1,510
I have developed a hardware that will give data in terms of angle of rotation. The hardware is connected to PC via serial port. I can show the value through Hyperterminal. Now i'm on the way to develope a software for it. So, I would like to know how to get the data into my user interface with C/C++ programming language? Furthermore, i would like to store it in DAT file. Anyone has done it before? Or any suggestions/ websites of tutorials that enable me to learn bout this/ any sample source codes on related works.... thanks for the help...
the following code works with Visual C, Borland C and DEV-C++ (using gcc)
http://www.geocities.com/horacespider/Serial_IO/DEV-C/terminal.c

also have a look at
http://www.thescripts.com/forum/threadedpost2251579.html#post2251579
Feb 26 '07 #5

P: 3
the following code works with Visual C, Borland C and DEV-C++ (using gcc)
http://www.geocities.com/horacespider/Serial_IO/DEV-C/terminal.c

also have a look at
http://www.thescripts.com/forum/threadedpost2251579.html#post2251579
Thanks for all the comments n guides!! I'm in the process of studying and trying the program...
Feb 28 '07 #6

Expert 100+
P: 1,510
Thanks for all the comments n guides!! I'm in the process of studying and trying the program...
also worth looking at is
http://www.codeproject.com/system/serial.asp
Feb 28 '07 #7

P: 4
Code removed per Posting Guidelines
Jan 22 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.