You know your sample rate and your baudrate and therefore how many frames you can write at a time. So the best would be to time your write correctly.
The shared memory queue for your channel write is 10 samples. Normaly the driver handles the transfer from your Host queue to this shared queue and buffers your samples to write. But it could happen, if you have Read operations running as well that the board becomes very busy in handling the read interrupts and thus your write queue is overflowing.
You could try to increase the write queue to 50 for example, to give some more room for the board to handle other tasks.
Therefore you have to open the nicanopt.ini file and to modify the following section: CO_WQL =50 if you use a sample rate and NI_WQL =50 if your sample rate is zero.
[INTERNAL_CHANNEL_QUEUES]NI_RQL=80NI_WQL=50CO_RQL=0CO_WQL=50
You can find the file within the \National Instruments\NI-CAN\bin folder if you have the NI-CAN 2.5.2 driver installed.
DirkW