LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PDA serial communication speed is slow

Greetings all,

I am using a Pocket PC(Hp2215) to communicate with a dumb RS232 device using Bluetooth Serial. Got it working now but the speed is not really practical.

I first wrote a PC program in Labview to communicate with this device. After I send a command(2 BYTES), I get a relay within 10-20 ms. However on the PDA the delay is 200-500ms.

I need to send lots of data to this device and this is all done with 2 BYTES SEND and a 2 BYTES REPLY. At this speed my PDA now takes 3-4 minutes configuring, while on the PC it takes 30 seconds.

I am using the following method for serial comms
1> Using the standard PDA serial comms Vi's
2> SEND the 2 BYTES
3> read BYTES AT PORT until I see 2
3> then READ the two BYTES

Simp
le but slow

I know the problem is not the bluetooth because I have test from my PC using bluetooth and this is also fast.

Any ideas where the problems lies(PDA, Labview PDA, etc). Any help you be appreciated.

Thank you
0 Kudos
Message 1 of 7
(3,693 Views)
I dont know if this will help you or not;

I am experiencing the same problems on HP5455 IPAQ. My IPAQ takes 3s to just perform a dumb read operation of 3000 bytes on the serial port, when the priority is kept at time-critical level. eVC does it in 1.5seconds. Here I was writing to the serial port from the desktop that was also running labView.

Next I made my hardware write 3000 bytes to the serial port. This was read by LV in 1200 ms whereas eVC did that in 500ms.

Hence I feel that LabView is slow in this regard.
0 Kudos
Message 2 of 7
(3,692 Views)
I was intrigued, so I decided to test this out for myself. I used an iPAQ 5555 and a desktop with a VI simulating an instrument which received a 2 byte command and gave a 2 byte response. I've attached the code that I used. I was able to average 33 ms for a send/receive combination. If I built the application with the 'Generate serial only' option in the Build for PDA dialog, I was able to average 15 ms. The 'Generate serial only' is documented in the LabVIEW Help, but basically it removes parallel operations and makes everything serial which improves speed and decreases the size. You have to make sure that you have some wait in your loops though, otherwise you might starve out the UI. Take a look at the attached code. I'd be interested to know what the
difference between our code is.

Regards,

JR A.
0 Kudos
Message 3 of 7
(3,692 Views)
Sorry , for the delay. Holiday was really needed.
Okay, firstly, thanks for all the effort. The code you used is basically identical to mine. I have run some tests using your code and found the following.

1> I ran it on the PDA and got an average time of 200-210ms.
2> If I GENERATE SERIAL ONLY, it makes 0 improvement on the speed
3> I modifed your program to run on a PC with serial and recorded the an average time of 70ms(Not sure why this is different to my first tests). This time is still 3 times less than on the PDA.

Did you use the BLUETOOTH VIRTUAL SERIAL PORT or the serial port on the PDA? I think the speed problem might lie in the virtual serial port. Any Ideas?

Thanks again for the help.

J
0 Kudos
Message 4 of 7
(3,692 Views)
In my last post I was using a physical serial connection. I re-ran the tests using a Bluetooth Serial port. I saw an average time of about 70 ms, and also did not see any change when building with the "Generate Serial Only" set true. So I see the same performance with my PDA as you see with your PC. This I think would point to a possible issue specific to that PDA model (I used an iPAQ 4155). I would recommend checking the HP website for the latest updates for the 2215.

The reason I believe that we do not see any improvement by setting "Generate Serial Only", is because the bottle-neck is not the speed of the LabVIEW code but the speed of the Bluetooth Serial port. It isn't suprising that there is more overhead versus using a hardwired ser
ial port since there is at least one extra software layer in the OS. You see this even on your PC. Sending larger amounts of data at time would probably reduce the impact of the overhead and make it more comparable to physical serial. However, the Bluetooth Serial port implementation on your 2215 does seem significantly slower which is why I recommend checking for updates.

Regards,

JR A.
0 Kudos
Message 5 of 7
(3,692 Views)
Interesting.

I however forgot to give you all the information. For my tests I was communicating with the dumb serial device, using your program as basis, with the following results:

1> PC - 70ms(average)
2> PDA(bluetooth) - 210ms(average)

If I understand your results correctly(Remember this is communicating with your simulation program which immediately sends the bytes back):

1> PDA(Physical serial port) - 33ms
2> PDA(Bluetooth virtual port) - 70ms

I am guessing that if you run you program(obviously modified) on a PC(i.e. PC-> PC) you would get a time of 70ms/3 = 23ms.

What I know suspect if that the time for serial communication on a PDA, with bluetooth, is +-3 slower than on a PC.

I am now going to test my PDA usi
ng your simulation program to see if I also get 70ms. If, so , I think my assumption is correct.

I would like to hear your comments on this.

Thanks again for the interest and help.

J
0 Kudos
Message 6 of 7
(3,692 Views)
I don't have two Bluetooth PC's readily available, but I don't believe that there should be much of a difference between using a PDA versus using a PC. There is a difference with using a physical port versus a Bluetooth port (33 ms vs. 70 ms) but my guess would be that the extra time there is Bluetooth overhead and not a PDA specific bottleneck. Part of my reasoning for that is when I built my PDA app. with the "Generate Serial Only" flag the time didn't improve. Also, you saw a 70 ms average from your PC. However, it does seem that your PDA does have an issue which is why I recommend checking for updates.

Regards,

JR A.
0 Kudos
Message 7 of 7
(3,692 Views)