LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to avoid losing data when communicate with high speed motor?

I connect with high speed servo motor via RS232. To avoid losing data. i thought to set receive buffer, only read the buffer if it collected all bytes. Is this possible?
0 Kudos
Message 1 of 2
(2,254 Views)
Hi,
 
If you know the number of bytes you are trying to read, you can set a viRead call to return information once the particular number of bytes have been read.  For more information on this, take a look at the KnowledgeBase article on a Serial VISA Read to read a requested number of bytes
 
Even if you read before all bytes have been collected, you should not lose data.  When the specified number of bytes are stored in the buffer, the viRead call will send the information to the program, and new data coming in will be stored in the buffer until the byte count is reached again.
 
I hope this helps,
 
Lauren L.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(2,215 Views)