LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending TCP command to PC via specific ethernet port

Solved!
Go to solution

Hi all, 

 

I apologize if this is a silly question. 

 

Essentially I have a PC with two ethernet ports (one built into the motherboard and a PCI ethernet card) both of which I can see in NI max just fine. I use one of the ethernet cards to connect to a network so as I can remote desktop into the PC and the other is connected to a computer that controls the motion of some crystals in an OPO/OPA. 

 

If I connect the host PC to the laser PC via the ethernet port from the motherboard I can send commands just fine using the TCP.IP method but if I connect to the ethernet card then I cannot send the command and I get the following error "(Hex 0x38) The network operation exceeded the user-specified or system time limit. If there a resource for this sort of thing". I assume there is a protocol or some method for choosing a card to use to send the command? 

 

I have attached the program I am using. 

 

Thanks for any help. 

0 Kudos
Message 1 of 5
(4,041 Views)

The correct port will be used based on the destination IP address and the routing tables. That's up to the OS, assuming everything is configured correctly.

 

What are the two subnets of the two adapters? What is the local IP address of the adapters? Are the netmasks configured correctly to avoid address overlap? Are all local device connected to the local subnet or is there more routing involved?

0 Kudos
Message 2 of 5
(4,019 Views)

Hi, 

 

Thanks for the reply! 

 

The two subnets for the adaptors are shown here: 

Hypersoar_0-1607675831003.png

How does one ensure that the netmasks are configured correctly? 

 

The local devices are connected to the subnet.

 

Hypersoar

 

0 Kudos
Message 3 of 5
(3,994 Views)
Solution
Accepted by topic author Hypersoar

According to this setup, if you send data to a device with the IP address 129.67.104.x - 129.67.107.x it will be routed through eth0 (first Ethernet connection). If the device address is however 169.254.x.x it will be routed through the Gigabit Ethernet Adapter.

If it will be anything else it will be routed through the default network adapter, most likely your first.

 

Are your camera and other local devices all Link Local assigned addresses? (169.254.x.x)

Most likely not! If so you need to make sure to assign the right IP address to that interface that matches the IP addresses you assigned to the other devices.

 

Link Local is a method where devices set for DHCP address assignment will configure themselves to a Link Local address if they can not find a DHCP server to send them an IP address assignment. This is not ideal as the address assignment is pretty random, but at least allows to find and communicate with those devices with low level protocols in order to set them up with a more useful address as part of a bootstrap method.

 

In your case you either want to have a properly configured DHCP server on such local networks or do a full static network setup of all devices!

 

You could also have all devices use Link Local addresses, which will end up being in the 169.256.x.x range but not every device supports that mode and it will make finding devices hard as the assigned Link Local address after powering up a device can be pretty random.

Rolf Kalbermatter
My Blog
Message 4 of 5
(3,984 Views)

Hi,

 

This was in fact the issue! I have set up the control PC and all else on with a static network and I am now able to send commands successfully. 

 

Thank you so much for this solution! 

 

Hypersoar

0 Kudos
Message 5 of 5
(3,976 Views)