Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

serial comms 1

Status
Not open for further replies.

rmageddon

Programmer
Jun 4, 2001
3
GB
Hi there!
Could someone please point me in the right direction for programming a serial port to activate a motor.
Is there a particular API for serial communication in VC++ 6? I have briefly looked through the MSDN stuff but couldn't find anything particularly informative. Any help will be much appreciated. I am not too worried about the hardware side of this problem, I just need to know how to get started from the software side.
Thanks in advance.
 
Man, the same thing I'm trying to find out for a few weeks...

Please, if you find something, send me a message, please!

(Try CreateFile() function, it'll all I have found by now)

Can you give me some details on how did you created the electronical interface between your computer and that motor?
 
I would advise use to use MSComm Control I have used it for to interface Energy meter with PC. It is pretty simple will save lot of your efforts. Plenty of material is available on MSComm Control
 
The MSComm control will work. There is also a CSerialPort class available for free on the web - I believe it was written by PJ Naughter. If you want to use the Win32 API for serial communication, you need to look into SetCommState(), GetCommState() the DCB structure, CreateFile(), and SetCommTimeouts(). If I've forgotten any important functions, they'll probably be cross-referenced from one of the above topics in the documentation.
 
To Robertus,
The problem I have is that the hardware will not work without the software, so anything I give you will be useless.
However, as soon as I have a working piece of kit, I will let you know.
Thanks for your reply, and also to the others who have replied. I am currently checking out these new paths.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top