LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Multiple network cards

Hello guys,

 

I am new in networking communication, I am trying to send TCP Packets to a DUT module which I actually did succesfully, the problem I have is the following: 

I have a PXI chassis with 3 ethernet cards with two ports each so 6 differnet ports total, I have configured 6 differnent IP addresses for them, what I need to do is to Test 6 DUTs in parallel, so all my DUTs have the same IP Address and same port, what I am trying to do is to make sure that each DUT establish a connection with its corresponding ethernet card (IP Address) (client/server) and avoid any potential concerns due to reaching differnet IP address that do to correspond with their physical connection.

I was trying to use the TCP Listen.vi and string to IP to get the IP address of the ethernet card that I want to specify to connect with the corresponding DUT but I had no success yet using that approach.

is there any additional function I can use to solve this concern? thanks for your support in advance

 

Eder

 

 

 

0 Kudos
Message 1 of 9
(3,609 Views)

I believe you will need to configure String to IP for multiple output mode - the default is single output mode.

 

http://zone.ni.com/reference/en-XX/help/371361M-01/lvcomm/string_to_ip/

 

This should return an array of IP addresses that the controller has configured.  Now, I would imagine that you might need to set a static IP for each of these network interfaces that is unique, so LabVIEW knows on which interface to send the packets.  Don't quote me on that though!  Smiley Happy

0 Kudos
Message 2 of 9
(3,596 Views)

I don't think what you want to do is possible. The TCP open does not allow you to specify which adapter to use. That will be determined by the route table. Since all of your target devices have the same IP Address you will not be able to force the route to a specific adapter because the destination address is the same.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 9
(3,589 Views)

Thanks for your replay, mmh I see, I think I will need to request a permision to be able to set a unic IP Address for each DUT(automotive HUD), 

0 Kudos
Message 4 of 9
(3,587 Views)

I'm not a networking super-expert, however I would try to physically connect DUTs one at a time and immediately establish a TCP connection with it before connecting another. If the TCP/IP stack will not be fooled by the multiple identical IP addresses and DUTs accept a single connection, this may work.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 9
(3,544 Views)

Hello Paolo,

Thanks for your feedback, that would be a good solution, unfortuantely due to testing requirements (execution timing) it is not possible to do that, so I was exploring the TCP Listen VI since its description mention: "it specifies on which network address to Listen. Specifying an address is useful if you have more than one network card TCP" but now I know this is not the right approach to solve this issue.

I will continue to look at differents scenarios, thanks for your support guys.

Thank you
0 Kudos
Message 6 of 9
(3,520 Views)

@pincpanter wrote:

I'm not a networking super-expert, however I would try to physically connect DUTs one at a time and immediately establish a TCP connection with it before connecting another. If the TCP/IP stack will not be fooled by the multiple identical IP addresses and DUTs accept a single connection, this may work.


This will not work. You cannot have multiple devices with the same IP address on the same network. It just isn't possible. Since the TCP stack in LabVIEW does not allow you to specify which adapter to use for a given connection all of those devices with the same address will be on the same network. Communications will be random. Best case is that all the packets would be sent to a single device. Worst case would be completely random communications. MAC addresses on a network must be unique. IP address are linked to a MAC address in the routing tables. How can the routing know where to send a packet if it has multiple physical addresses for a single IP Address.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 9
(3,508 Views)

@Mark_Yedinak  ha scritto:

@pincpanter wrote:

I'm not a networking super-expert, however I would try to physically connect DUTs one at a time and immediately establish a TCP connection with it before connecting another. If the TCP/IP stack will not be fooled by the multiple identical IP addresses and DUTs accept a single connection, this may work.


This will not work. You cannot have multiple devices with the same IP address on the same network. It just isn't possible. Since the TCP stack in LabVIEW does not allow you to specify which adapter to use for a given connection all of those devices with the same address will be on the same network. Communications will be random. Best case is that all the packets would be sent to a single device. Worst case would be completely random communications. MAC addresses on a network must be unique. IP address are linked to a MAC address in the routing tables. How can the routing know where to send a packet if it has multiple physical addresses for a single IP Address.


Thank you for the explanation, as I said I don't know in detail how TCP/IP works. Just thought it was a very quick test to do, hoping that once a TCP connection is established, the actual MAC associated to the connection would be stored somewhere. But as you pointed out, no way. Probably, all devices after the first would not be reachable due to the conflicting IP addresses.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 9
(3,500 Views)

I'm not sure, but perhaps this can be done through VISA? There's an optional field in the VISA resource name for a TCP/IP socket connection called "board" which might specify which network adapter to use. The format looks like this: TCPIP[board]::host address::port::SOCKET

(If you see an emoji in the middle of that, you can thank this message board's automatic emoticon substitution, which defaults to "on" and can't be circumvented by the author of the message.) I can't find much documentation about the "board" parameter, but my impression is that by specifying e.g. "TCPIP2::" you can specify which card to use.

0 Kudos
Message 9 of 9
(3,476 Views)