Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

NIMC_returnDataBufferNotEmptyError

NI PXI Windows NT 4.0, PXI-7344, MS VC++

The error returns out of flex_read_pos_rtn occassionally during continuous motion control application that requires position reading with 25 ms timer.

The error description is "The Return Data Buffer is not empty. Commands that expect data returned from the controller cannot be sent until the return data buffer is cleared".

My problem is the error comes up once for a quite long operation that keeps controlling motion axes continously.

I would like to know why such error breaks up and how to avoid such condition or how to fix it.
0 Kudos
Message 1 of 2
(3,098 Views)
Sometimes the communication between the motion board and the computer gets corrupted and does not make it across. For instance if you read the encoder position and choose 0xFF (return to host), the position is placed in the return data buffer. The board then notifies the computer that it has data to be read. Sometimes this notification does not make it. In these cases, you will get the "Return Data Buffer is not Empty" error. What you need to do is just handle that error with in your code. When the error occurs, call the flex_flush_rdb to flush the buffer.
Message 2 of 2
(3,098 Views)