LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP read function reads only strings with even numbered characters, that is, it reads 11, 1111, 111111, aa, aaaa but not 1, 111, a, aaa ...

I am connecting my PC (DELL PRECISION T1600 which has Intel Xeon and Labview 2014 with SP1 (32 bit) installed on it) to a test device via UDP 64 protocol. The code for that is in the attachment or the screenshot image of VI.

UDP read issue.png

When I run this code on the PC, it doen't send the data string with odd number of characters, but it does send the ones with even numbers., that is, it reads 11, 1111, 111111, aa, aaaa but not 1, 111, a, aaa ...

 

The same program runs fine on my laptop where I have intalled 64 bit labVIEW.

 

Could it be the 64 and 32 bit be reason for this problem ?

 

Thanks,

Gunn

0 Kudos
Message 1 of 7
(4,640 Views)

You should check out the UDP examples that ship with Labview.  These examples show the proper way to do this.

aputman
0 Kudos
Message 2 of 7
(4,603 Views)

While it's probably not the source of your problem, the use of Decimal String to Number is incorrect for the Net Address input to UDP Open. Use "String to IP" instead. Also, when you say it doesn't send the string when it has an odd number of characters, what happens? Do you get an error, and if so, which one? Do you get a truncated string?

0 Kudos
Message 3 of 7
(4,567 Views)

@nathand wrote:

While it's probably not the source of your problem, the use of Decimal String to Number is incorrect for the Net Address input to UDP Open.


Well, it depends if the string contains a valid port number in decimal representation (U16 range). Stiill, one should wire the correct default representation so there is no coercion dot. (I have no idea why the string is called "device secondary address" when you wire it (with some detours) to the local port input. very confusing). Just wire a zero diagram constant to the local port so the program can select a free ephemeral port, since it is only used for return traffic, the source port does not matter.


@khatri wrote:

 

When I run this code on the PC, it doen't send the data string with odd number of characters, but it does send the ones with even numbers., that is, it reads 11, 1111, 111111, aa, aaaa but not 1, 111, a, aaa ...


 

So you have enabled the echo server on port 7 on the test device. Are you testing the same device with both PCs? Are the NICs the same, drivers updated?

 

Can you use wireshark to inspect the outgoing and incoming packets down to the last bit to determine if the outgoing or incoming packets are to blame for the difference in payload? So far we don't know!

 

0 Kudos
Message 4 of 7
(4,552 Views)

hi Gunn,

 

Could you please tell us if you receive any errors? Could you as well create a report Wireshark?

 

Thanks a lot

Julien De Freitas

Applications Engineering Group Leader / Certified LabVIEW Developer (CLD)
National Instruments Switzerland
0 Kudos
Message 5 of 7
(4,516 Views)
Sorry I was away. Yes I do get error 56,the code keep running for a while (look like hangs) and the the error appears. I think this is connected with the default 25000 ms timeout of Read UDP.
0 Kudos
Message 6 of 7
(4,424 Views)