한국어 English Chinese Russian
bannerbar

Q&A



Your information is protected by SSL.
No. 262 Wait for DSR (Data Set Ready) 2006-05-25

I have a weather station software, connected to the ez200F that waits to get DSR = 1, but it never receive this signal and then send a 'Connection timeout'

Does ez200F needs to have a specific configuration to receive this signal ?

Thanks
Christopher
ps : below a part of the code

if (!GetCommState (ws, &dcb))
{
printf ("
Unable to GetCommState");
exit (0);
}

dcb.DCBlength = sizeof (DCB);
dcb.BaudRate = BAUDRATE;
dcb.fBinary = FALSE;
dcb.fParity = FALSE;
dcb.fOutxCtsFlow = FALSE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDtrControl = DTR_CONTROL_DISABLE;
dcb.fDsrSensitivity = FALSE;
dcb.fTXContinueOnXoff = TRUE;
dcb.fOutX = 0;
dcb.fInX = 0;
dcb.fErrorChar = FALSE;
dcb.fNull = FALSE;
dcb.fRtsControl = RTS_CONTROL_DISABLE;
dcb.fAbortOnError = FALSE;
dcb.XonLim = 0;
dcb.XoffLim = 0;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
dcb.fNull = false;
dcb.XonChar = NULL;
dcb.XoffChar = NULL;
dcb.ErrorChar = NULL;
dcb.EofChar = NULL;
dcb.EvtChar = NULL;

if (!SetCommState (ws, &dcb))
{
printf ("
Unable to SetCommState");
exit (0);
}

commtimeouts.ReadIntervalTimeout = 0;
commtimeouts.ReadTotalTimeoutMultiplier = 0;
commtimeouts.ReadTotalTimeoutConstant = 0;
commtimeouts.WriteTotalTimeoutConstant = 0;
commtimeouts.WriteTotalTimeoutMultiplier = 0;

if (!SetCommTimeouts (ws, &commtimeouts))
{
printf ("
Unable to SetCommTimeouts");
exit (0);
}

for (i = 0; i < 2000; i++) {
buffer[i] = 'U';
}

write_device(ws, buffer, 2000);

set_DTR(ws,0);
set_RTS(ws,0);

i = 0;
do {
sleep_short(10);
i++;
} while (i < INIT_WAIT && !get_DSR(ws));

if (i == INIT_WAIT)
{
print_log(2,"Connection timeout 1");
printf ("Connection timeout
");
exit(0);
}

Writer cpot Company