LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet disconnection event using WMI

Hi,

     The below mentioned Vbscript detects whenever the Ethernet cable plugged out from the machine and displays to the user. I want to implement the same code in LabVIEW, but I don't have idea how to do the same. Do you have any idea?
 

 

*********VbScript for Ethernet disconnection detection********************

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\wmi")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
    ("Select * from MSNdis_StatusMediaDisconnect")

Do While True
    Set strLatestEvent = colMonitoredEvents.NextEvent
    Wscript.Echo "A network connection has been lost:"
    WScript.Echo strLatestEvent.InstanceName, Now
    Wscript.Echo

Loop

 

**********************************************

 

Thanks

 

Sathiya

0 Kudos
Message 1 of 2
(2,598 Views)

Parse the output string from running the ipconfig /all command with system exec. Look for media state "disconnected".

 

Also see this thread.

http://forums.ni.com/ni/board/message?board.id=170&message.id=341523&requireLogin=False

Message Edited by unclebump on 03-03-2010 12:05 AM
0 Kudos
Message 2 of 2
(2,539 Views)