LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data transfer limit on Windows Mobile

Solved!
Go to solution

I am using LV 2011 and Mobile 2011 to transfer data wirelessly from a handheld to a PC. The receiver program on PC errors out when a large chunk of data need to be transferred from the handheld. Here is the detail. 

 

There is an inventory file in the handheld, 20880 bytes long, that needs to be transferred to the PC. When clicked the transfer button, the receiver program on PC gives an time out error, only received 16380 bytes. This error repeats itself, no matter how long I feed into the 'timeout ms'. I even tried 'wait indefinitely', but it still only receive 16380 bytes of data out of the 20880. 

 

I moved the transfer program from the handheld to a PC, then there is no problem whatsoever. This makes me think whether there is a size limit of data you can transfer using LV Mobile 2011? But 20880 bytes is really that much data, is it? What's wrong here? Help PLZ.

 

Windows Mobile Wireless Transfer Data Limit.jpg

0 Kudos
Message 1 of 8
(3,518 Views)

By the way, the error message said

 

" error 537650, STM Read Message (TCP).vi<ERR>Header information was received but the complete message was not received before the specifiedtimeout period.  This generally indicates a poor or broken connection."

0 Kudos
Message 2 of 8
(3,505 Views)

Here is a little progress.

 

The handheld that caused the error runs Windows Mobile 6.5. But when I used another handheld which runs Windows Mobile 5.0, it does not cause any error, transferred 80000bytes of data without problem. So now the problem narrows down to the Windows Mobile system? 

 

I am just throwing the facts out here in case somebody else encounters the same issue. 

0 Kudos
Message 3 of 8
(3,503 Views)
Solution
Accepted by topic author MengHuiHanTang

MengHuiHanTang,

 

Because were erroring out regardless of timeout, its possible that the TCP buffer isnt large enough. I did some research on this, and it could be that we are trying to send it a packet larger than the size of the TCP buffer for the windows mobile 5 device.  I dont think it is a coincidence that youre stopping just short of 16384 bytes (2^14 with just enough room left for a header). I believe that the TCP window size setting is actually set in the registry key HKLM\Comm\Tcpip\Parms\TcpWindowSize, according to this article here. You may have luck modifying that to fit the device. I think later OSs have window scaling to somewhat take care of this for us.

 

The easier way to possibly fix this would be to break up the writes into smaller packets. Simply writing twice with half the information each time should also take care of the issue. 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 8
(3,495 Views)

Kyle,

 

I tried to change the TcpWindowSize, making it like 10 times bigger, but it does not solve the issue, does not even make any difference. Don't know why?

 

Even that worked, there is still a limit there, sooner or later I still need to break up the file into smaller packets. So why not just do it from the beginning. That's what I did, cut each packet down to no more than 16000 bytes.

 

Thanks for the help very much.

0 Kudos
Message 5 of 8
(3,482 Views)

MengHuiHanTang,

 

It could be that the TCP window size is capped at that value for the device, but Im not sure. Hard to say. Glad to hear you were able to get things working though. Best of luck in future development!

 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 8
(3,475 Views)

Kyle, 

 

I just had a conversation with a technical staff of Opticon, and he told me he was pretty sure it was not a limit of the Windows Mobile system. They had tested to transfer really large amount of data, like 100MB, without issues. He was asking about how LabVIEW handles the TCP transfer. Is it possible that LabVIEW Mobile sets certain size limit?

0 Kudos
Message 7 of 8
(3,464 Views)

MengHuiHanTang,

 

The LabVIEW mobile is ultimately simply transmitting TCP packets, and because it wortks with 6.1 in a larger packet size, I doubt the issue is from the mobile module, and is instead a difference in the operating systems from the mobile devices. TCP spec has a maximum window size of 65,535 bytes (4x what you were successful in sending in windows mobile 5) without the TCP window scale option (which mobile 5 may not have). Also: Did Opticon send 100MB packets, or 100MB of data broken into many packets? a 100MB packet is really, really large, even with window scaling. 

 

My guess would be that the WM 5 device has a size limitation on TCP packet size, likely for performance reasons, and no TCP window scaling option, causing this issue, while the newer WM 6.1 device has these issues corrected.

 

Again, this is largely speculation because I have very little experience with the windows mobile operating system and hardware, but thats where the symptoms would point me. 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 8 of 8
(3,458 Views)