Thank you Arjun for the reply.
Its works good when I increase the buffer size.
But it doesn't work good when I try to get the data in chunks.
The code is given below:
'Data download in one shot
-----------------------------------
Dim data as string * 20000
"Data writting to temp.csv file in progress..."
'read from E5052A
Call Receive(giBoardID, 2, data, DABend)
If (ibsta And EERR) Then GoTo READERR
Open "temp.csv" For Output As #1 'Store the data in a file
Print #1, data 'Write data
Close #1 'Close the file
"Done writting data to the temp.csv file ."
----------------o0o------------------------------
'Data download in chunks
---------------------------------
Dim data as string * 1024
"Data writting to temp.csv file in progress..."
Do
'read from E5052A
Call Receive(giBoardID, 2, data, DABend)
If (ibsta And EERR) Then GoTo READERR
If Not bOnlyOnce Then
bOnlyOnce = True
Open "temp.csv" For Output As #1 'Store the data in a file
Print #1, data 'Write data
Close #1 'Close the file
Else
Open "temp.csv" For Append As #1 'Store the data in a file
Print #1, data 'Write data
Close #1 'Close the file
End If
data = Replace(data, vbLf, "\n")
Loop Until InStr(1, data, "\n")
"Done writting data to the temp.csv file ."
------------------o0o---------------------------------------
Please let me know if their is better way to handle data in chunks.
Handling data in chunks would be better b'cos in future the data file (it is comma seperated one) might increase in size or
number of data points might increase. Having said that vb string can only goto up to say about 60000 bytes max.
By the way I am using visual basic 6.
Thank you