I use a serial port to control a device called a nano controller. For communication I used CreateFile, writeFileand readFile.
this syntax writeFile,
if (!WriteFile(hComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
if (GetLastError() != ERROR_IO_PENDING) {
fRes = FALSE;
}
}
Here the data should be included internally lpBuf. This is a buffer.
I want to assign "MINC, moveL". Here MINCis the text. however, it moveLis a variable whose type must be double. Values must be passed on moveLwith time. moveLvaries from 0 ~ 10,000.
So, how do I fill the buffer?
source
share