| | |
Write from CPP program to serial port
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 1
Reputation:
Solved Threads: 0
Hi all,
im doing a uni project and ive run into a little trouble
im writing a program in cpp (has to be cpp because of other constraints)
this program will get values from a file and depending on the values, send a high or low signal to the corresponding output pin on a serial port
i have done some research, but i cant get a solid answer on how to write from a program to a specific pin on a serial port
all i know is that i have to specify the com port (com1 or com2 etc) and the pin
any help on this would be MUCH appreciated
thanks
EDIT: im using windows xp pro, if that helps.
im doing a uni project and ive run into a little trouble
im writing a program in cpp (has to be cpp because of other constraints)
this program will get values from a file and depending on the values, send a high or low signal to the corresponding output pin on a serial port
i have done some research, but i cant get a solid answer on how to write from a program to a specific pin on a serial port
all i know is that i have to specify the com port (com1 or com2 etc) and the pin
any help on this would be MUCH appreciated
thanks
EDIT: im using windows xp pro, if that helps.
Last edited by hugoboss911; Oct 22nd, 2008 at 7:26 am.
you need to use the win32 api communications functions
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
> EDIT: im using windows xp pro, if that helps.
But which compiler?
Not some fossil like TurboC by any chance?
> send a high or low signal to the corresponding output pin on a serial port
Er, you do know what a serial port looks like right?
Or even how a serial port works?
http://www.lammertbies.nl/comm/cable/RS-232.html
The only output pins which have a level associated with them are CTS and RTS.
But which compiler?
Not some fossil like TurboC by any chance?
> send a high or low signal to the corresponding output pin on a serial port
Er, you do know what a serial port looks like right?
Or even how a serial port works?
http://www.lammertbies.nl/comm/cable/RS-232.html
The only output pins which have a level associated with them are CTS and RTS.
•
•
•
•
> EDIT: im using windows xp pro, if that helps.
But which compiler?
Not some fossil like TurboC by any chance?
> send a high or low signal to the corresponding output pin on a serial port
Er, you do know what a serial port looks like right?
Or even how a serial port works?
http://www.lammertbies.nl/comm/cable/RS-232.html
The only output pins which have a level associated with them are CTS and RTS.
Thats about as bad as if i was to set out writing a driver program in assembly for a microcontroller to interact with a keyboard. And then not looking at how the keyboard transmitts and recievers data.
That was a fun project btw, i also did it using shift registers aswell as assembly. I'm a bit of an electornics geek too

Chris
Knowledge is power -- But experience is everything
![]() |
Similar Threads
- Serial port communication using C++ (C++)
- Error (in program for serial comm in DevCpp) (C++)
- need help convert c++ to vb6 serial port (Visual Basic 4 / 5 / 6)
- The COM Ports are not communicating properly.. (C++)
Other Threads in the C++ Forum
- Previous Thread: How many terms to find p of Pi?
- Next Thread: Reading in new line character from a file.
Views: 1491 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






