LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using 2 or more Network Cards

Say I have 2 Network cards in my computer, both with different IP address's and both connected to the same hub.

I would like using LV to setup a connection from one NIC to the other going through the hub.

The problem I’m having is with the "TCP OPEN CONNECTION" command, it doesn’t require a local address and therefore seems to have free reign to choose the IP address it would like to use.

So having setup a LISTENER on one address, the TCP Link is opened from that same address and therefore cuts out the hub.


Can this type of link be achieved with LV?
Message 1 of 10
(3,744 Views)
Try using the 'TCP Create Listener' instead. This will allow you to specify an IP address for the listener.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 10
(3,725 Views)


@Ed Dickens wrote:
Try using the 'TCP Create Listener' instead. This will allow you to specify an IP address for the listener.

Ed






That's the thing, i can setup a listener on a particuler address but I cannot find a way of saying "now you (meaning the other NIC with a diffrent IP) go and connect to the listener I've just made.
0 Kudos
Message 3 of 10
(3,712 Views)
The interface used for the outgoing connections (TCP open) is determined based on the destination IP and the routing tables. Fortunately, I don't think you have much control over this. 🙂

Have you tried some serious editing of the routing tables? If it is even possible, it won't be pretty.
0 Kudos
Message 4 of 10
(3,711 Views)


@altenbach wrote:
The interface used for the outgoing connections (TCP open) is determined based on the destination IP and the routing tables. Fortunately, I don't think you have much control over this. 🙂

Have you tried some serious editing of the routing tables? If it is even possible, it won't be pretty.





Cheers mate, routing tables sounds like the strongest lead i have so far. Do you have any idea of how i would go about messing with them? I don't even know where to find them.
0 Kudos
Message 5 of 10
(3,702 Views)
hi

i think the routing-thing is worth a try. under win\system32 theres a "route.exe" which allows you to edit the table. execute it on a cmd-line and read the info. you should be able to execute within your vi with SysExec.vi or create a batch and call that with SysExec.vi (maybe there's even a dll, but i don't know).

good luck and let us know
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 6 of 10
(3,690 Views)
It has been more than 15 years since I looked into the details so things may have changed.

My concern is that the TCP/IP stack will recognize that the source and destination addresses are on this machine and by-pass the network completely.

I would recomend the following.

1) Isolate your hub such that your machine is the only machine on the hub. This way you can watch the activity lights to ensure that the packets are really making it to the wire.
2) Concider unique sub-nets for each NIC.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(3,683 Views)
Since routing tables are based on "subnets", the two NICs need to be on seperate subnets, this also means that you need to replace your hub with a router.

I agree with Ben that the OS is probably smart enough not to send anything on the wire if the destination is local.

Somehow, this seems like an useless task. What are you trying to achieve exactly? Sniff the traffic on the hub?
A better idea would probably be to use a second machine as an external loopback proxy, maybe this can be coded in LabVIEW?
Message 8 of 10
(3,677 Views)
Thanks for the advice guys, I'll try a few of the thing's you've suggested and let you know how I get on.

What I am trying to achieve is to make LV send a file through a hub using just the one computer. So in short I just want it to exercise a hub.
0 Kudos
Message 9 of 10
(3,646 Views)
hi

how about DataSocket or OPC-Demo Server with the IPs in the URL?

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 10 of 10
(3,644 Views)