From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the client not receive the 1-D array sent by the server via TCP connection ?

Solved!
Go to solution

I have attached 3 VIs:

 

1. PC.vi (server)

2. xbee.vi (client)

3. CreateSetupPacket.vi (it builds an array of numerics)

 

#1 is executed first, followed by #2. 

#2 attempts to initate a TCP connection with #1.  As soon as #1 detects it a "connection ID" is created.

#1 attempts to send a "setup" packet to #2 by building an array. 

 

The problem is the xbee client VI gets 0 bytes or "" empty string back.  What am I missing?

Download All
0 Kudos
Message 1 of 4
(2,170 Views)

It seems to work for me.

 

PC is sending 112 bytes.  Xbee is receiving 104 bytes. (You may want to match those numbers up better.)  If you send all zeroes, the string looks empty because the typecasting of zeroes in double precisions is all 00 bytes, which does not show up in a string indicator.

0 Kudos
Message 2 of 4
(2,158 Views)

Hi RavensFan - 

 

I am not sending all zeros.  I purposely changed the values in the sliders so that their  values reflect non-zero numbers like "1.24", "5.67", etc. 

 

The strangest thing is there are no errors (status code = 0 on both client and server).  

 

Somebody mentinoed this could be a firewall issue.  

 

I mean, if it works for you and not for me, i can't be a problem with the code, right?

0 Kudos
Message 3 of 4
(2,120 Views)
Solution
Accepted by topic author invasion2121

Note that I was running both VI's on the same PC.  And this worked fine because the IP addresses were set to localhost.

 

I don't know if a Windows firewall would affect TCP/IP communication within the same PC.  It's possible, I just don't know.

 

Firewalls can certainly affect communication between different PC's whehter that is a firewall within network routers or within the Windows firewall.  So it is worth checking into that more.  But as you said, I don't see anything wrong with the code.

0 Kudos
Message 4 of 4
(2,116 Views)