Jump to content

Read Networking state (e.g. from Windows Task manager)


H.H.

Recommended Posts

Hi

I need to get the status on a specific network attached to the computer. I have several network adapters attached to the computer. I can get the information from the Windows Task Manager manualy, but I need LV (7.1) to do it.

Perhaps its possible to get the info from the regdb, but I havent found it

Can anyone help??

BG

HH

Link to comment

One simple way is to use System Exec.vi to obtain this information using the ipconfig utility. Use the command "cmd.exe" and the input string "ipconfig /all[CRLF]" (where [CRLF] is a carriage return + line file). This will output something similar to the following:

C:\WINDOWS\system32>ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . : mycomputer

Primary Dns Suffix . . . . . . . :

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

DNS Suffix Search List. . . . . . : mydomain.com

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : mydomain.com

Description . . . . . . . . . . . : Broadcom 440x 10/100 Integrated Conroller #3

Physical Address. . . . . . . . . : 00-0F-1F-26-A7-1D

Dhcp Enabled. . . . . . . . . . . : Yes

Autoconfiguration Enabled . . . . : Yes

IP Address. . . . . . . . . . . . : 192.168.1.103

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . : 192.168.1.1

DHCP Server . . . . . . . . . . . : 192.168.1.1

DNS Servers . . . . . . . . . . . : 192.168.1.1

Lease Obtained. . . . . . . . . . : Sunday, December 11, 2005 10:21:35 PM

Lease Expires . . . . . . . . . . : Wednesday, December 14, 2005 10:21:35 PM

Ethernet adapter Wireless Network Connection:

Connection-specific DNS Suffix . : mydomain.com

Description . . . . . . . . . . . : Dell TrueMobile 1300 WLAN Mini-PCI Card #3

Physical Address. . . . . . . . . : 00-90-4B-B3-2B-38

Dhcp Enabled. . . . . . . . . . . : Yes

Autoconfiguration Enabled . . . . : Yes

IP Address. . . . . . . . . . . . : 192.168.1.104

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . : 192.168.1.1

DHCP Server . . . . . . . . . . . : 192.168.1.1

DNS Servers . . . . . . . . . . . : 192.168.1.1

Lease Obtained. . . . . . . . . . : Monday, December 12, 2005 10:50:11 PM

Lease Expires . . . . . . . . . . : Thursday, December 15, 2005 10:50:11 PM

C:\WINDOWS\system32>

You can parse this output string and to determine the status of your adaptors.

Link to comment

The more basic information of just your different IP #'s and Computer ID's can also be obtained by placing the String to IP function and then right-clicking to selecting multiple outputs. This yields a U32 array that can be converted in a for loop using the IP to String function to return names and dot-notation IP #'s.

Also if you're looking for the connection status of a specific device on your network there is code availalbe (I believe it's on NI's website somewhere) that will let you monitor the ping time natively (using raw winsock calls, as compared to performing a shell exec of the ping command)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.