LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the properties of the local area connection

Try to make change in the properties of the local area connection, i.e.  click Start --> Control panel --> Network Connection --> Local Area Connection --> properties. Then select Internet Protocal(TCP/IP), click on the Properties. Normally, the PC is set at Obtain an IP address automatically. Now need to change to Use the following IP address, then enter the IP address, Default gateway address. after that, click OK.
 
I am wondering, is Labview could do the setup as described? Once all done, is it possible to change the TCP/IP setting back to "Obtain an IP address automatically"?
 
Thanks,
 
Test
0 Kudos
Message 1 of 6
(6,040 Views)
You need to use netsh.exe to do this, which you call using System Exec. See the example here.
0 Kudos
Message 2 of 6
(6,030 Views)
Thanks smercurio_fc.
 
I tried but not working. The way I try to do is connnecting two PCs directly through Ethernet cable. Then change the IP addresses as mentioned, after that ping another PC. If done manully, working. 
 
After run the program you mentioned in your email, I check the "ipconfig /all" in the DOS window, it is still the old IP address. If changed manually, check ipconfig in the DOS window, it is changed.
 
Any thoughts?
 
Thanks,
 
0 Kudos
Message 3 of 6
(6,013 Views)

Thanks smercurio_fc, it's working now. Need to modify the program a little bit after google "the netsh interface ip set address".

 

0 Kudos
Message 4 of 6
(6,007 Views)
OK. Smiley Wink
0 Kudos
Message 5 of 6
(6,004 Views)

Hi Guys,

 

I wanted to add this little snippet here for future LV guys in case it comes in handy.

Now, this is essentially the beginnings of a trojan horse, so remember to always stay on the light side of the force.

 

Thanks to this guy: https://forums.ni.com/t5/user/viewprofilepage/user-id/260910?profile.language=en

For submitting the snippet to index adapters: https://forums.ni.com/t5/user/viewprofilepage/user-id/260910?profile.language=en

 

Here was the problem that I needed to automate:

I'm using ethernet connected devices such as air cylinders, DAQs and Stepper motors. I manually set the devices to connect on a specific subdomain - in this case "33"

So IP Stepper: 192.168.33.4, IP Aircylinder Controller: 192.168.33.7  and so on.

 

I needed to complete two operations - set the adapter IP within that subdomain, and disable TCPIPv6.

The first was fairly easy - "netsh interface ip set"

 

The second one, changing the IPV6 setting, was difficult.

First off, you cant do this on a per adapter basis from CMD - you must use powershell.

Secondly, you have to pass cmd commands to powershell.

Third, you actually have to pass CMD commands to an escalated powershell launched from within the first powershell [Weird eh?]

 

Anyhow, got it to work. Happy Coding my friends!

 

Background: [Writing a "Simple Motion Control" program that allows the quick creation of sequences using multiple devices/motion profiles]

Download All
0 Kudos
Message 6 of 6
(3,759 Views)