06-14-2019 12:04 PM - edited 06-14-2019 12:07 PM
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.
Solved! Go to Solution.
06-14-2019 07:49 PM
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
06-15-2019 05:18 AM - edited 06-15-2019 05:19 AM
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
06-15-2019 12:29 PM
@deceased -- thanks for your response. I'm always willing to learn ...
Bob Schor
06-16-2019 03:34 PM
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.
06-17-2019 05:41 AM
@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.
06-17-2019 05:47 AM
@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)?
06-17-2019 06:01 AM - edited 06-17-2019 06:02 AM
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.
06-24-2019 05:52 AM
@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.