11-10-2006 02:20 AM
11-10-2006 02:29 AM
Hello wolf,
you should use the SetBreakOnLibraryErrors function to make sure that LabWindows doesn't interrupt your program when a timeout occurs:
// Get all available bytes from the serial port.
SetBreakOnLibraryErrors (0);
buffer_size = GetInQLen (port_nr); // Get the number of bytes in the serial input buffer.
num_bytes = ComRd (port_nr, buffer, buffer_size); // Read the bytes from the buffer.
SetBreakOnLibraryErrors (1);
// Check if an error occurred.
if (num_bytes < 0)
MessagePopup ("Error", GetRS232ErrorString (num_bytes));
11-10-2006 06:02 AM
11-10-2006 09:21 AM
11-13-2006 02:47 AM