Check out the related Code Repository Files or visit the LabVIEW Wiki Internet Portal
Tags |
(This content has not been tagged yet)
|
![]() |
Nov 4 2004, 09:11 PM
Post
#1
|
|||
![]() Very Active Member Posts: 197 Joined: 12-May 04 From: Charlottesville, VA Member No.: 404 Using LabVIEW Since:1999 LV:7.1 ,8.0 ,8.20
|
Has anybody programmatically changed a computer's IP Address using LabVIEW?
I'm in a situation where I will have a LabVIEW App running on a computer having a few ethernet adapters. What I would like to do is somehow identify the adapters and programmatically set the ip addresses and subnet masks of each adapter and apply the settings without having to reboot. Sort of like how you can change the IP and implement the changes manually by viewing local area connection properties. Extra tidbit of info: we're going to be using W2k/XP machines. I'm thinking it's probably going to be a register-level implementation, which we would like to try to avoid. If anybody is able to at least point me in the general direction, I would greatly appreciate it.
|
||
|
|
|||
| Ad |
Nov 4 2004, 09:11 PM
Post
#
|
||
|
|
|
||
|
|
|||
Nov 4 2004, 10:58 PM
Post
#2
|
|||
![]() Very Active Member Posts: 72 Joined: 19-June 03 From: Virginia Member No.: 120 Using LabVIEW Since:1998 LV:8.6 ,. ,.
|
What a great question Bryan!
Unfortunately I don't know the answer - although I recently heard of a program written by someone at UVA which uses Microsoft Visio to dynamically configure network IP addresses. Here is a link to their site: http://www.cs.virginia.edu/~mngroup/projects/routeconfig/ Actually, I just took another look and this software does routing - which doesn't ussually involve configuring local IP addresses. So maybe it isn't much help after all. This post has been edited by JohnRH: Nov 4 2004, 11:01 PM --------------------
|
||
|
|
|||
Nov 5 2004, 01:31 PM
Post
#3
|
|||
![]() Very Active Member Posts: 72 Joined: 19-June 03 From: Virginia Member No.: 120 Using LabVIEW Since:1998 LV:8.6 ,. ,.
|
OK, since I have an interest in solving this problem as well I did a little research last night and this is what I found:
Method One, NETSH: use the "System Exec" function to use "netsh" as follows: CODE netsh interface ip set address <interface name> static <ip address> <mask> <default gateway> <gateway interface metric> Examples: CODE netsh interface ip set address "Local Area Connection 2" static 192.168.1.10 255.255.255.0 192.168.1.1 1 netsh interface ip set address "Local Area Connection 5" static 10.12.1.95 255.255.255.0 Method Two, Edit Registry: Use the LabVIEW registry editing functions to query and edit the following registry settings: CODE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards (query this to find ID numbers for all network cards)CODE HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\ In this key will be a sub key for every network card. By makeing sure DHCP is disabled (value 0) and setting the IP Address for each card, you should be able to do what you want. This Registry editing method probably requires you to reboot. --------------------
|
||
|
|
|||
![]() ![]() |
| Time is now: 22nd November 2008 - 06:43 AM |