LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

migrating from CVI2009 to CVI2013, rs232

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

 

 

0 Kudos
Message 1 of 4
(3,538 Views)

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. 

Message 2 of 4
(3,519 Views)

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

0 Kudos
Message 3 of 4
(3,503 Views)

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));

0 Kudos
Message 4 of 4
(3,500 Views)