LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MAC Address Verification

Solved!
Go to solution

Hello,

 

I am writing a .vi that reads a list of MAC addresses from an xls file. If the MAC address it reads is good (not all zeros, fs, or blanks) it should assign a "serial number" (a fake 7 digit number I auto generate for this assignment using a random number generator) to the MAC address. Column 1 of the xls file is the serial number to be input. Column 2 is the list of mac addresses. Each time the vi runs, it looks for a blank first column (which means an unassigned MAC address is in the second column), checks the unassigned mac address, and if it's good inputs my global serial number into the blank space.

 

I get conceptually what's going on but I am a beginner at labview so I'm not sure how to code it exactly. I've gotten as far as looking for the blank first column, but I'm not sure how to check that the unassigned MAC address is in the correct range without just doing a case that looks for each of the options. My teacher said It can be coded to check for a range. And then I'm not sure how to input a single element into a blank space in a large array (I used spreadsheet string to array at the beginning).

 

Thanks!

 

 

0 Kudos
Message 1 of 2
(2,374 Views)
Solution
Accepted by topic author notAWizard0555

Hello,

 

You could use a Case Structure and have the default case be for when a MAC address comes in, and then create cases for non-valid MAC addresses to skip the process.  You could also specify a range of numbers as a case that would be for valid MAC addresses and then have another case for non-valid MAC addresses.

 

More information about Case Structures can be found in the LabVIEW Help.

 

For inputting the data, you can use the Input Into Array function.  This will allow you to place an element into an index you specify.

Niki Budgell | Product Planner - SW Management | NI
Message 2 of 2
(2,320 Views)