not receiving all data transmitted

I have connected up my socket and can send and receive RS232 data over. My problem is that if my RS232 string is 26 characters I dont always receive 26 characters. Sometimes I do but most of the time I only receive 16 characters. What can cause this?

To send data I do the following
If CanSend == false
return FALSE
If DataLen == 0
return FALSE

ed_SendDataExt(Data, DataLen, FALSE, ED_ID_TCPSOCKET_1)

When I receive the data I do the following
if dataLen == 0
return

OutputString = adl_memGet(dataLen+1)
wm_strcpy(OutputString, data, dataLen)
adl_fcmSendData(UartHandle, OutputString, dataLen)
adl_memRelease(OutputString)

any suggestions???

Hi delene,

Instead of using wm_strcpy () API (as in 2nd line above), try using wm_memcpy () API (i.e. wm_memcpy(OutputString,data,dataLen);). This is because the problem might be related to a NULL being present in the received data and wm_strcpy () function might not be copying the data after that.

Regards,
Open AT Fan.

I tried as you suggested but unfortunately it didnt work. dataLen shows that the length of the data received is 16 characters and not 26. Every now and then it comes through right.