LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Emulating Multiple TCP/IP Devices

Solved!
Go to solution

Hello, I'm hoping to use LabVIEW as an emulator for multiple physical hardware devices that communicate over a TCP/IP network.

In the full system, 1 PC (lets call it the Master PC) will talk to numerous other devices (approximately 20). All of the devices and the Master PC are on the same subnet. However, for testing purposes the entire system may not be available and we'd like to emulate the missing devices using a single second PC.

It's my understanding that you can assign multiple IP addresses to a single NIC, however is it possible to send out data using those multiple addresses? We essentially need to fool that Master PC into thinking all of the devices are present. This will not work if all of the slave device's responses come from the same IP.

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

I'm reasonably sure that an "ordinary" NIC cannot use two IPs at the same time.  You can go into Network Properties and re-configure the NIC to use another IP (though the ability to communicate may depend on your network -- best bets are when you are on an isolated network and connected more-or-less directly with the other machine(s) you want to talk with ...

 

Bob Schor

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

I believe what you are looking for is called IP Aliasing. It allows several active IPs on the same NIC (settings are OS dependant, so you will have to google it).

 

Another option would be to use the same IP but different ports, or just bounce them all off localhost on the main PC and don't use a network or second PC at all.

 

0xDEAD

 

 

Message 3 of 9
(3,217 Views)

@deceased -- thanks for your response.  I'm always willing to learn ...

 

Bob Schor

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

While you can of course create aliasing for multiple IP addresses I'm not sure why that would be needed. In a well designed application you should be anyhow able to configure all the addresses for your devices somewhere as you do not want to bake that fully static in your application.

So when you want to talk with your simulation devices, rather than making them all appear to work under their eventual real address it is much easier to reconfigure the address your program will talk to the devices.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 9
(3,193 Views)

@rolfk wrote:

While you can of course create aliasing for multiple IP addresses I'm not sure why that would be needed. In a well designed application you should be anyhow able to configure all the addresses for your devices somewhere as you do not want to bake that fully static in your application.

So when you want to talk with your simulation devices, rather than making them all appear to work under their eventual real address it is much easier to reconfigure the address your program will talk to the devices.


Yes, the IPs and/or port numbers could be changed in an xml file on the "Master PC" but that introduces uncertainty as there is a lot more in that configuration file than just IP/Port numbers. Any changes made to make the software work (outside of the IP/Port) would then have to get copied over to the "real" configuration file. Was everything copied over? Were any typos made? Better to use the same build if possible, removes all that uncertainty, especially when access to the full system is limited or impossible until release.

0 Kudos
Message 6 of 9
(3,179 Views)

@deceased wrote:

I believe what you are looking for is called IP Aliasing. It allows several active IPs on the same NIC (settings are OS dependant, so you will have to google it).

 

0xDEAD

 

Yes. I'm using Windows 10. I know I can setup the PC to respond to multiple IP addresses, but my question is can you make those responses come from multiple IP addresses?

 

As an example, say the emulator PC running labview has 192.168.0.10 and 192.168.0.11 assigned to it with 192.168.0.11 being the alias. The master PC sends a message to 192.168.0.11 giving it a command, the emulator then sends a response to that command. Will the emulator (IE LabVIEW) send that response from 192.168.0.10 (which I do not want) or will it be 192.168.0.11 (what I want)?

0 Kudos
Message 7 of 9
(3,177 Views)
Solution
Accepted by topic author Geomancer

You don't specify what protocol you are using. Both UDP Open and TCP Listen feature a net address input where you specify on which address to listen. It's likely that when a packet or connection is received from a given interface, the response will be also sent to that interface. The only way to verify this is trying to do it. It should be a fairly quick test.

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

@pincpanter wrote:

You don't specify what protocol you are using. Both UDP Open and TCP Listen feature a net address input where you specify on which address to listen. It's likely that when a packet or connection is received from a given interface, the response will be also sent to that interface. The only way to verify this is trying to do it. It should be a fairly quick test.


I did say in the original post that it's TCP. I gave it a try, and it does appear to work. It was awfully slow though, but I have a jumping off point now to continue with this project. Thank you for your help, I completely missed that net address input, I swore I had looked for something like that and didn't find it.

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