Programmatically Acquire MAC Address through LabVIEW

Updated Aug 30, 2023

Environment

Software

  • LabVIEW

Operating System

  • Windows

Media Access Control (MAC) address is a unique ID that identifies your network card and computer. This article explains how to obtain the MAC address of your computer programmatically through LabVIEW.

You can use System Exec.vi in LabVIEW to execute the ipconfig /all command and you will get the full TCP/IP configuration for all adapters including information such as the Host Name, IP Address, or Physical Address. Match Pattern, String Subset, and other LabVIEW APIs can be used to extract the MAC address. 

Besides, you can also use System Exec.vi to execute the wmic bios get serialnumber command to obtain the computer’s serial number which is another unique ID to identify your computer.

The following code executes the ipconfig /all command and displays the MAC Address.
Get MAC.png

The code below executes the wmic bios get serialnumber command and output the serial number of the computer.
GET SN.png