LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read 5000bytes using CVI

 

I want to read more number of data bytes from com port which is sent by microcontroller in my test board. I am using CVI to read all bytes and log the data. I have set time out as 5s. Input queue = output queue = 32767, baud rate = 38400. First I send a command to micro requesting data from it, then i read the bytes sent. Below is the code. when i am sending command to micro, it is receiving and send the bytes, but CVI is not reading properly. Below is the code.

 

bytes_sent = ComWrt (comport, send_data,(No_of_CAN_FD_bytes_Ecu2+6));
bytes_read = ComRd (comport, read_data, (No_of_CAN_FD_bytes_Ecu2+6));
bytes_read = ComRd (comport, read_data,(No_of_CAN_FD_bytes_Ecu2+6));

 

Can anyone help me??

0 Kudos
Message 1 of 2
(3,634 Views)

To read the entire message in one single command, you should set 5000 in ComRd.

Otherwise you could read in a loop in small chunks and append data to a large buffer; this could be the best option to leave the user interface responsive: on each loop you could test the state of a toggle button used as an 'abort' flag.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,631 Views)