02-04-2009 11:20 AM
Hi
I have a network card with 4 Ethernet
ports with IP1, IP2, IP3 and IP4. On each port I connect products which
have a fixed and unchanged IP, this IP is the same for each product. So
I have 4 different networks (IP1 <-> IP, IP2 <-> IP, IP3
<-> IP, IP4 <-> IP) and I must open a TCP communication
with each product and the PC. I have used the VI TCP Open Connection
but I can put anly the client IP and I don't put the host IP (IP, IP2,
IP3 or IP4), so I don't know which product is. Which is code I can use
to put the IP client and the IP host to create a TCP connection ?
Sorry for my poor english, thank for you answer,
02-04-2009 11:42 AM
I'm not sure it is possible to do what you propose without additional hardware or software. Generally, IP addresses are supposed to be unique within a network (and addresses outside the 'private' IP address ranges are supposed to be globally unique).
One simple solution may be to install a router between the computer and each device under test. Depending on the level of reliability you require, a home broadband router may be sufficient. You would then configure each router to have a unique IP address on the WAN side (connected to the computer) and forward all connections to the IP address of your device under test (on the LAN side).
You may also be able to use a software firewall to accomplish the same thing, although I've never tried it on a Windows machine.
Mark Moss
Electrical Validation Engineer
GHSP
02-04-2009 11:42 AM - edited 02-04-2009 11:46 AM
Specifying the NIC to use for TCP communication is only necessary when listening for new connections. If you have four separate networks with different subnets then the network stack will be able to figure out which NIC to go through to get to a particular address. That you described your four networks with all the same IP address, I would consider a misconfigured network.
Nathan
02-04-2009 11:54 AM
Yes I have four separate networks so I can have the four same adresses for my devices, what it is the NIC, I have used the TCP Open connection and after Modbus Read/Write and TCP Close Connection, I haven't use TCP Listen and I haven't found NIC in VI TCP/IP.
Thank for your answer,
JB
02-06-2009 02:33 AM
Hi,
Unfortunately it's not possible at this moment to send TCP/IP over multiple ethernet devices. Windows have a stack ip limitation, when you send data, it's select the first device available.
I advise you to use a hub or switch to communicate with your device.
Regards,
Aurélien J.
National Instruments France