The context is the fundamental of programming principle by MS Visual C++ 6 connecting through Serial Port of the computer in sending and getting alphabet. For the form of how to programming that will not have ready-made control that will be used like Visual Basic. In this section, you have to use programming principle as reading and writing data file. Anyhow, the data that will be got and sent out to port is like reading and writing data on file. I prepare the step for understanding in programming like this,
4 steps for connecting Serial Port
1. Set variable for keeping file names, data read (Buffer),file handles, value of getting and sending data.
HANDLE hComm; // handle for COM port
DCB dcb; // data structure that keep value for connecting serial port
char * chCommPort = “COM1″; // we use com port 1
int valReturn; // keep returning value back in some function.
char chBuffer; // keep alphabet in getting and sending data.
unsigned long nReadPort; //keep returning value back in function, ReadFile
unsigned long nWrittenPort; // keep returning value back in function, WriteFile Read the rest of this entry »
Share This