LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I make Labview act like a Router and assign an I.P. address to a device?

Good morning all,
 
I have a PC with two NIC cards.  One is set up for DHCP and connected to the company network. 
 
The second has a fixed I.P. address. 
 
I want to connect an instrument that is set up for DHCP to that second network card, and have Labview assign that device an I.P. address, just like a router would do.
 
Any ideas on how I'd get Labview to do that?
 
Thanks,
Mike 
0 Kudos
Message 1 of 6
(5,259 Views)
I don't think you could do that with Labview.  I think they would be networking functions you'd have to implement in Windows such as creating a DHCP service in Windows to assign IP addresses through that 2nd NIC.  That's beyond my expertise.
0 Kudos
Message 2 of 6
(5,256 Views)
DHCP is an application layer protocol, so I guess it could technically be implemented in LabVIEW. The specifications are listed in IETF RFC 2131 . I am not aware of a LabVIEW version of DHCP.

There are various freeware/shareware DHCP servers such as this one, and if you use Linux you should be able to download or install a package to install this as a service.

The question is why do you want to use DHCP to assign the instrument it's IP address? Do you want to access the greater network or internet from the instrument's interface?  Do you want to access the instrument from the greater network or internet directly? This could be solved by just attaching the instrument to to greater network.
0 Kudos
Message 3 of 6
(5,247 Views)

Phil,

Thanks for the reply.

The instrument is actually a board that we manufacture. It's default configuration is DHCP, and that's they way it has to go out to our customer.

The IT gods don't want it on their network, or us testing it over their network. So they only way to talk to it would be to have something like a router (Netgear, etc) assign it an I.P. address and connect the router to the fixed I.P. NIC, and route the commands through the router (jump table) to the target board.

I guess what I was trying to do was eliminate the router, and just have Labview assign the address.

Also, I wish I was using Linux.

Mike

0 Kudos
Message 4 of 6
(5,238 Views)

Routers are a lot cheaper than your time and trouble digging through all the internals of Windows to figure out how to make that happen.  Though if you do, I think it would still be easier to do it as a Windows service than trying to figure out how Labview could do it programmatically.

For that matter, Linux would be an even bigger hassle to make it work.  Have you read the threads on Linux for people to just try to get Labview to run on it and all of the various flavors?  Getting Labview to install and run on Windows is very easy compared to the problems those people are having just trying to get the software and drivers to work on Linux.

0 Kudos
Message 5 of 6
(5,229 Views)

I'm guessing you would like to connect multiple DUTs to a private (test) LAN, have each DUT retrieve a distinct IP address from the DHCP server, then test the DUTs from LabVIEW.

The shareware/freeware I mentioned should allow you to serve IP addresses to each of the DUTs, but the problem is identifying DUTs that are present and active. You might be able to use a short lease time and ping each DHCP address and build a list of IP addresses that responded. There are various 'ping' solutions on the forums (just search on 'ping')

Otherwise you might need a commercial DHCP server implementation that has an API to query and manage the IP address leases. If IT won't let you load a DHCP server on the LabVIEW computer, you could use an old PC with Linux on it as the DHCP server on your private LAN. You would use the same technique of a short lease time and using ping to find the DUTs.

0 Kudos
Message 6 of 6
(5,218 Views)