12-05-2005 11:45 AM
12-06-2005 12:42 PM
12-06-2005 03:26 PM
Thank you for the response! I mis-spoke (mis-typed?). The working code doesn't use CVI at all, it uses CreateFile, WriteFile, and Readfile, which are Win32 API calls I believe. Below is the code that opens the com port to the device. I suspect that there's something different in the semantics of this code compared to OpenComConfig. The DCB used to configure the com port appears to have more detail in it than what's provided by OpenComConfig and one of these settings is making a difference.
bool SerialInterface::Open(void) {
bool rtn=false;
int errCode=0;
DCB commDCB;
ResetEvent(TerminateEvent);
if ((hComm =CreateFile(Port, GENERIC_READ | GENERIC_WRITE, 0,0, OPEN_EXISTING, 0,0))!=INVALID_HANDLE_VALUE) {
if ( GetCommState(hComm, &commDCB)!=0){
if (BuildCommDCB(Settings, &commDCB)!=0){
if (SetCommState(hComm, &commDCB)!=0 ){
if (SetCommTimeouts(hComm, &timeouts)==TRUE){
if (InitializeComm()==true){ rtn=true;
if (rtn!=true){.......
return(rtn);
}
12-07-2005 11:15 AM