I’m running Windows 7 and using Visual Studio 2012 RC. I have a USB device connected to my COM6 port, and the device is streaming ASCII output. I want to grab that data to use in my program, which I’m writing in C++. I’m pretty new to programming in general, so I’m sort of lost. I know I have to use a certain library, and I saw the function CreateFile being used, but I just can’t seem to get it to work. Any help would be much obliged, thank you.
Edit: I’m able to open the port and retrieve its basic data: I can print out the baud rate, bit size, parity, and stop bits values. But I need to retrieve the streaming ASCII data, which is where I’m lost. Sorry for not clarifying.
Here you go:
Serial_Port.h: http://pastebin.com/Hft1zYS3
Serial_Port.cpp: http://pastebin.com/ZzfUujNY