LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn Ethernet off using LabVIEW or DOS prompt

Does anyone know of a method to disable an Ethernet port using LabVIEW or a DOS prompt?  In an automated test, I need to be able to turn off one port of a dual port Ethernet PCI device, then turn it back on and do the same to the other port.  Any ideas?
 
Thanks for any help.
Message 1 of 7
(5,380 Views)
One tehnique is using the System Exec.VI issue an IPCONFIG comand (with correct parameter): -
(see the very bottom)

USAGE:
    ipconfig [/? | /all | /renew [adapter] | /release [adapter] |
              /flushdns | /displaydns | /registerdns |
              /showclassid adapter |
              /setclassid adapter [classid] ]

where
    adapter         Connection name
                   (wildcard characters * and ? allowed, see examples)

    Options:
       /?           Display this help message
       /all         Display full configuration information.
       /release     Release the IP address for the specified adapter.
       /renew       Renew the IP address for the specified adapter.
       /flushdns    Purges the DNS Resolver cache.
       /registerdns Refreshes all DHCP leases and re-registers DNS names
       /displaydns  Display the contents of the DNS Resolver Cache.
       /showclassid Displays all the dhcp class IDs allowed for adapter.
       /setclassid  Modifies the dhcp class id.

The default is to display only the IP address, subnet mask and default gateway for each adapter bound to TCP/IP.

For Release and Renew, if no adapter name is specified, then the IP address leases for all adapters bound to TCP/IP will be released or renewed.

For Setclassid, if no ClassId is specified, then the ClassId is removed.

Examples:
    > ipconfig                   ... Show information.
    > ipconfig /all              ... Show detailed information
    > ipconfig /renew            ... renew all adapters
    > ipconfig /renew EL*        ... renew any connection that has its
                                     name starting with EL
    > ipconfig /release *Con*    ... release all matching connections,
                                     eg. "Local Area Connection 1" or
                                         "Local Area Connection 2"

Message Edité par Conseils le 01-13-2006 10:18 PM

Message Edité par Conseils le 01-13-2006 10:19 PM

Message 2 of 7
(5,380 Views)
I have used this method, but I need a little more control such as getting access to the Enable and Disable command that you find when you go into the Settings, Network Connections from the Windows Start Menu.  I need to stop the signal pulses from going out on the Tx line of the Ethernet connections.  IPCONFIG/Release does not do this.
0 Kudos
Message 3 of 7
(5,369 Views)
If you actually want to turn off a device then perhaps the DEVCON feature is what you need

" The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices. DevCon also provides information that is relevant to the driver developer and is not available in Device Manager.

You can use DevCon with Microsoft Windows 2000, Windows XP, and Windows Server 2003. You cannot use DevCon with Windows 95, Windows 98, or Windows Millennium Edition.
"

see here for the utility
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

It's quite a powerfull tool so it will take a bit of reading to get to grips with it.
Message 4 of 7
(5,358 Views)

The DevCon seems to work, but I can not get it to recognize the hardware address beyond the "&" sign.  Only the address up to it is used (see sample below).  The reason this is important is that my two Ethernet ports are on the same PCI card, therefore the first part of the address is the same (see below).  If I include everything in the command I get error messages for DEV_7646, SUBSYS_7646, etc.  Do you know of any tricks to get the whole address to be used?  If this does not work I will just add another card and it should come up with a different address that I can control.

Sample address:

PCI\VEN_10B7&DEV_7646&SUBSYS_764610B7&REV_30\4&3B1CAF2B&0&70F0

0 Kudos
Message 5 of 7
(5,343 Views)
Try placing the command in quotation marks

Here is an example from the Microsoft web site (see link below)
devcon status "@PCI\VEN_8086&DEV_1130&SUBSYS_00000000&REV_02\3&29E81982&0&00"


http://technet2.microsoft.com/WindowsServer/en/Library/0b077318-2bac-4399-8230-461d5d2a055f1033.mspx
Message 6 of 7
(5,330 Views)
Thanks for your help.  That seems to have worked.
0 Kudos
Message 7 of 7
(5,313 Views)