10-29-2013 11:30 AM
Hi all,
I recently upgraded to CVI2013 from CVI2009. I can run and build my project with the new CVI but it does not work properly. When I try to read rs232 are loss of data or kind of misunderstanding, I don´t know if I am missing any configuration or build options. Any idea? When I execute old application (generated with CVI2009) works perfectly...
Thanks in advance
10-30-2013 08:14 AM
same issue happened also to me. As a workaround I get my RS232 bye by byete using ComRd function acquiring only one bye instead of ComRdTerm function that seems to not work properly.
10-30-2013 11:09 AM
Thanks for the reply
I was using ComRdByte() and I have replaced for ComRd() but I have the same problem...
Any other idea? As I posted, same code with CVI2009 and 8.5.1 works
10-30-2013 11:28 AM
I also add a delay to wait input que to be filled. The code is the following and it works
// variable declaration
#define BS_BUFSIZE 64 // the size of your input buffer
char received_data[BS_BUFSIZE];
int read_cnt = 0;
double waittime = 0.3;
int read_cnt = 0;
int Bs_bytes_read;
char byte;
// acquires RS23 byte by byte until BS_EOT terminator is received. Replace BS_EOT with your own terminator
do {
Bs_bytes_read = ComRd (Bs_comport, &byte, 1);
if (Bs_bytes_read == 0) {
Delay(waittime);
Bs_bytes_read = ComRd (Bs_comport, &byte, 1);
if (Bs_bytes_read == 0) break;
received_data[read_cnt] = byte;
read_cnt++;
} while ( (byte != BS_EOT) && (read_cnt < BS_BUFSIZE));