LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending data between PC's questions

Hello,

 

I am going to try something I have never done before. I have a PC I want to transmit data to other PC's. It's not a lot of data, maybe 200 bytes.

 

I am using this example as a reference:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019RbuSAE&l=en-US

 

I am not very good with or trained on networks. I have two questions:

1.) How do I know what port to use? The one from the example does not work, it gives me error 63 on TCP Open. I also tried 192.168.1.255.

2.) Can I have multiple listeners at the same time or is a handshake of one broadcast to one listener? The listener will never reply.

0 Kudos
Message 1 of 5
(146 Views)

Since I cannot edit: I assume with TCP I have to open a direct connection to each listener.

Perhaps UDP Multicasting is the better option?

 

0 Kudos
Message 2 of 5
(112 Views)

"1.) How do I know what port to use? The one from the example does not work, it gives me error 63 on TCP Open."

 

Well there are general rules for ports if you're making an application you intend to distribute, but if you're making this for a tiny local network then you can disregard most of them and it comes down to two things:

 

1. Do both the client and the server use the same port?

2. Is the port firewalled or blocked in any way?

 

If you're making the software on both ends you can make the ports agree that way, so no problem there.

 

So if it fails for the port not being open but it really is open, then it's most likely a firewall of some kind.  The Windows software firewall blocks quite a lot by default.  You'll likely need to add the ports and applications you want to use onto its approved list, or disable the firewall entirely.  The second one is not recommended unless you're already on a well-managed network with an external firewall and other protections.

Message 3 of 5
(96 Views)

@DBISI wrote:

 

I am not very good with or trained on networks. I have two questions:

1.) How do I know what port to use? The one from the example does not work, it gives me error 63 on TCP Open. I also tried 192.168.1.255.

2.) Can I have multiple listeners at the same time or is a handshake of one broadcast to one listener? The listener will never reply.


  • Please don't start filenames with an exclamation mark. (see e.g. here)
  • Why do you call your program "server" if it is sending data to a listener? Conventionally, the listener is the "server" and clients connect to it to send or receive data.. Do you have another program listening on that port? Why not attach it?
  • In a typical local network, 192.168.1.255 might be the broadcast address. What was your thought process?
  • TCP is connection based and is strictly between two participants that agree on a connection with a three way handshake before any data is exchanged.
  • If you want multiple listeners, you need to use a connectionless protocol such as UDP and do multicast.
  • As has been said, you might need some firewall rules to allow incoming connections and for the program to even access the network. Most likely, LabVIEW is already configured for that.
Message 4 of 5
(85 Views)

I have been playing around with the UDP examples and I think that is going to work. I have some more experiments to do, but I think that will do just fine for my project. I have a little more work to do to sort out a few things and go from there.

 

 

0 Kudos
Message 5 of 5
(79 Views)