LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

viRead does not transfer data

I am trying to read a screen dump from a Teledyne scope.  The data is binary.  viRead returns 768067 in the "Return Count".  However, it only returns BMB.\013 in the buffer.  The buffer is unsigned char buffer[800000].

 

NI Max returns all of the data.  

 

Is this a termination string issue or something else?

 

Thanks,

 

Paul

0 Kudos
Message 1 of 3
(581 Views)

How do you observe what is in the buffer?

 

Do you use a strcpy? Do you view it in the debug window?

 

The strcpy() would stop at any embedded \0 character. Similarly the Debug window may do the same as it sees a datatype of char [800000] and assumes ASCII characters too. BMP data definitely can and almost certainly will contain \0 bytes. 

 

You would have to make sure to look at the bytes and not the characters.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(566 Views)

Thanks for your help.

 

I found my problem.  It was in where I was writing the file rather than in viRead.  It was the difference between how many bytes strlen reports and sizeof reports.  I was using strlen and it was reporting only up to the first null.

 

Paul

0 Kudos
Message 3 of 3
(532 Views)