LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List of Network Adapters to Choose

Solved!
Go to solution

I'm wanting to find a way to populate a list of the network adapters on the PC > and in turn, allow the user to select the proper one. On WinXP/Win7, the below VI did what it's supposed to and LabVIEW grabbed the "Primary" ethernet interface.

 

Capture1.PNG

On Win10, LabVIEW is now grabbing virtual adapters on many of our test PCs. I expected to find a straithforward way to do this, but have not come up with anything.

 

I found this, https://forums.ni.com/t5/Example-Programs/Get-Network-Card-Information-Using-LabVIEW/ta-p/3495745?pr..., but have not been able to get it to run...and it's a lot more than what I need. I'm really just looking to display the IP for the user (if there's more than one) and allow them to select it.

 

I've got a good understanding of how to display the IPs, and allow them to select it and such...I'm looking for how to populate the list. I've thought to use "system exec" and "ipconfig /all", then parse that, but i figure there's a better way?

 

Thanks!

Jeff

0 Kudos
Message 1 of 10
(4,921 Views)

Is this what you had in mind?

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 10
(4,900 Views)

Very close. I apologize, I'm not at all familiar with .NET or using the Property Nodes like they are in these VIs...and since it's all done with Ref wires I'm not able to tell how it's getting what it is.

 

Is there any Property Name that I can add for it to also give the IP Address of each adapter?

 

Thank you,

Jeff

0 Kudos
Message 3 of 10
(4,890 Views)
Solution
Accepted by jeff-m

In one sentence, you say that you want a list of network adapters.  And in the next sentence, you say that you want a list of IP addresses.  This should provide a list of IP addresses.  Have not used the multiple output of the Str to IP function before, so let me know if this doesn't work as I expect. 

ipaddresses.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 10
(4,883 Views)

Yes aputman, I think this is what I am looking for!

 

I didn't know you could make String to IP (or anything else) have multiple outputs. Thank you!

0 Kudos
Message 5 of 10
(4,872 Views)

Just curious - shouldn't the operating system just "know" which network adapter to use based on the information contained in the packet?  I guess what I'm getting at is, "do you need to actually specify the network adapter to use?"

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 10
(4,861 Views)

For the UDP Multicast socket; the help file says "Use the String To IP function to obtain the IP network address of the current computer." This has worked for years on WinXP/Win7: I guess it always got the "Current/Primary" IP of the test PC, but now it just grabs the first IP that is populated. Unfortunately the first isn't always the correct one.

 

I wouldn've thought that LabVIEW would do more to ensure that the IP it pulls is the correct one and such as well, but it is not.

0 Kudos
Message 7 of 10
(4,854 Views)

@jeff-m wrote:

For the UDP Multicast socket; the help file says "Use the String To IP function to obtain the IP network address of the current computer." This has worked for years on WinXP/Win7: I guess it always got the "Current/Primary" IP of the test PC, but now it just grabs the first IP that is populated. Unfortunately the first isn't always the correct one.

 

I wouldn've thought that LabVIEW would do more to ensure that the IP it pulls is the correct one and such as well, but it is not.


Thanks - I didn't realize you were multicasting.  Just glad you got it to work (again).  This was kind of a "learning" post for me, so thanks.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 10
(4,849 Views)
#Paul_cardinale

Can I get it in the 2010 version?
0 Kudos
Message 9 of 10
(3,936 Views)

@Codeblack wrote:
#Paul_cardinale

Can I get it in the 2010 version?


Here

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 10 of 10
(3,848 Views)