LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining MAC address

You enabled NetBios correctly if you're not using DHCP to dynamically assign IP addresses.

What did the new version say about LANA numbers?  I didn't expect you to get the same errors.  I expected either an error on NCBENUM or a message saying "No adapters found.\n".   Are you sure you rebuilt the project and ran the new version?

I'm using WinXP Pro with Client for Microsoft Networking, TCP/IP with NetBios setting from the DHCP server.

0 Kudos
Message 11 of 19
(4,277 Views)
After I play a little bit with debug and DOS commands I instantly start to get Physical addresses for LANA4 and LANA6 on one of the machines. One of them is not physical (VPN client), the other one is the WLAN but I'm missing the LAN adapter. It is not connected - maybe this is the problem, but it's still listed in ipconfig.

I still have Error: 0x3F on the other machine.

I don't know maybe it's my compilation or something else but it doesn't seems that this solution is going to work 100% on every machines for my distribution.
Except that, is there any way to programmatically enable NetBIOS on the distributive machine (some installation script or Registry setting)?
0 Kudos
Message 12 of 19
(4,270 Views)

OK, try this one.  It uses Simple (hah!) Network Management Protocol (SNMP) to get the MAC address.

I found so many copies of this on the web with so many different people claiming to have authored it that I can't give anyone credit.  I sure didn't write it and don't understand most of it.  I just hacked it up to get it to work with CVI.

Message 13 of 19
(4,236 Views)

Al S,

This is a very good one.

It's really the perfect solution for the application I'm working on. Works on any PC I've tried ( I did not try it on Win9x - it's outdated in most cases).

Very simple and easy to implement, regardles that I almost don't understand the way it works. I guess that I need to read deeply in this library function Smiley Wink

I would like to thank you so much for your time you spent with this problem. The way you delivere these samples is an example of huge knolledge. I can use your code almost untouched. I am sure many people who made an attempt to find a solution for this problem will be happy to see your code. Thank you again Smiley HappySmiley HappySmiley Happy

 

P.S.

Just as alternative in a totally different way of obtaining MAC, Volume & uP ID's. It is a VBS script - the most interesting is the processor solution. I really do not know how to implement such a code into CVI but just for information. I found it a week ago surfing the web.

Message Edited by DVD_Boost on 01-11-2007 03:22 PM

0 Kudos
Message 14 of 19
(4,215 Views)
This is the attachment which disappeared when I submit my last message:
0 Kudos
Message 15 of 19
(4,204 Views)
Actually, there is a problem using MAC address with the purpose of my application !

The current filtering returns all MAC's, even the virtual adapters.
I've studied the library and there is a possibility of requesting the description of the NIC using OID_ifDescr = {1, 3, 6, 1, 2, 1, 2, 2, 1, 2}
I also found the code, I beleave, is the source of whole this solution. There is a little bit written about this OID:
http://www.koders.com/cpp/fid95EC7B73663B58A26B2172F5B76A0098F624064D.aspx

My idea is to retrieve the description string, scan the string for the word "Virtual" (and may be something else, usual for non physical adapters), filter the virtual NIC's and return only the MAC for physical adapters.

Do you thing this is possible, modifying the code given by Al S a few messages above?
Is there anyone who can help me with this ?

Thank you in advance.

Message Edited by DVD_Boost on 01-14-2007 07:39 AM

0 Kudos
Message 16 of 19
(4,176 Views)

Thanks to Al for these very useful samples! Smiley Happy

I added this discussion to my bookmarks!

 

Message Edited by Roberto Bozzolo on 02-13-2007 12:39 PM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 17 of 19
(4,052 Views)
(message deleted, sorry i messed up the order of all the posts)


Message Edited by dummy_decoy on 03-27-2008 12:07 PM
0 Kudos
Message 18 of 19
(3,545 Views)
thank you!
0 Kudos
Message 19 of 19
(2,726 Views)