Click to See Complete Forum and Search --> : how do i communicate through COM/Serial port using win32 api?


eviltoylet
April 16th, 2003, 12:55 PM
Just started with win32 api, and have been trying to communicate through a com/serial (no idea what the difference is) port but have no idea where to start. I searched for it on codeguru and forums, couldn't make any sense of any of it... found one remotely related article but that was in vb.

Anyway, I'm using codewarrior and am trying to send commands ie "I1M4300" to a motor stepping device. The thing i currently have is a list of these commands(laid out one per line) but I have no idea how to send them.

So, it would be very helpful if someone could point me to reference or explain to me how to send a command to a said port, and wait for a response from the device( in this case '^') to signal that it is ready for the next command, and send that next command.

Thank you.

eviltoylet
April 16th, 2003, 04:15 PM
Can anyone afford to provide some help? Right now I think i have done the correct thing with writing the buffer, after lengthy inspection of the MSDN win32 documentation.

What I'm stuck on is perhaps the logical processes behind the readfile() function. I want to keep reading from COM1 until I recieve a ^ symbol and then return a true.

Can someone pleaes help? Any would be much appreaciated. Thanks.

RockNix
April 17th, 2003, 02:55 AM
see signature