Portbase User Guide
displayed on the edit box at 3 second Intervals.
4) Source Code
BOOL CExample1Dlg::OnInitDialog()
{
// Opens the COM3 port.
hComm = CreateFile(“\\\\.\\COM3”, GENERIC_READ |
GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
If(hComm == INVALID_HANDLE_VALUE) { // In case the port is not valid
AfxMessageBox(" Failed Open !");
return;
}
// Sets the input time.
COMMTIMEOUTS cto;
cto.ReadIntervalTimeout = 0;
SetCommTimeouts(hComm, &cto);
// Obtains the existing communication specifications.
GetCommState(hComm, &dcb);
// Decides the communication Spec of the port.
dcb.BaudRate = 9600;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
103
Содержание Portbase-3010
Страница 1: ......
Страница 61: ...Portbase User Guide 4 Click Next 5 Choose destination location and click Next 61 ...
Страница 90: ...Portbase User Guide Log Window 90 ...