LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching mac address

Dear Experts,

I have developed the following code to develop mac address. No errors but not getting the output displayed. Herewith, I attach the vi here. Kindly help.

 

CODE:

salauddin_0-1575638525376.png

 

FRONT PANEL:

salauddin_1-1575638582878.png

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

Hi salauddin,

 

because that button is missing its label… (Sarcasm.)

 

Your VI works for me - after removing the while loop and the case structure.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,193 Views)

Remove the While Loop and the Case Structure (leave the True Case code).  Then it will work.

 

Bob Schor

0 Kudos
Message 3 of 10
(4,148 Views)

Also, LabVIEW makes no distinction between row and column 1D arrays. There is no need to build the output of the FOR loop into a 2D array with one column and transpose it. Just leave it as 1D array and resize downwards.

0 Kudos
Message 4 of 10
(4,116 Views)

I did as you instructed. I choose the target as localhost.  I run the vi and it stops abruptly within fraction of seconds. And the mac id doesn't get displayed. Also, using highlight execution, I found the block inside the for loop never runs. Kindly help. Herewith, I attach the updated vi here.

 

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

What's the size of the autoindeixing input array of the FOR loop? If the size is zero, it iterate zero times, of course.

 

(Sorry, I don't have the toolkit, don't have these subVIs and cannot test)

0 Kudos
Message 6 of 10
(4,078 Views)

I ran this on my laptop, which includes VM Workstation and thus a VMWare Network Adapter.  When I run this, it finds 4 MAC Addresses -- my Router, my Bluetooth Device, and two VMWare Virtual Ethernet Adapters (for VMnet1 and VMnet8).

 

Here's a question -- your While Loop enumerates the Hardware MAC Addresses and (through the indexing Tunnel) outputs them as an Array of Strings.  Why not create an indicator (called "Array of MAC Addresses") right there, and avoid the two unnecessary Array functions?  If you drag the 1D Array of Strings downward and compare it with the 2D Array you created, you'll see that the contents are identical, and your 2D Array is really an array of N rows and 1 column, where the simpler 1D array is simply N rows.

 

I then took another look at your code, as I haven't used all of these VIs before.  When I tried to get Help on the third System VI, "Find", it failed to give me a Detailed View.  I also couldn't find this VI in the Palettes, finding instead a VI named Find Hardware, which does have detailed help.

 

Is it possible you have a "flawed" version of LabVIEW 2019?  [Goodness knows, there were numerous problems with the initial release].  The release I'm currently running (from Help, About LabVIEW) is Version 19.0f2 (32-bit).

 

Bob Schor

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

May be, this approach would work better...

I am running "ipconfig /all" and process its output to return structured data.

It returns all network related information, works much faster than VI above (on my PC is 120 mS vs 1.2 S).

But it is required some sub-VIs, let me know if any is missing.

 

See example of screenshot.

SergeS_0-1677251897147.png

 

P.S. Main VI is "Get_IPConfig_Network_Connections_Info.vi"
Added some sub-VIs used in there...

0 Kudos
Message 8 of 10
(2,266 Views)

Hi Serge,

 


@SergeS wrote:

May be, this approach would work better...

I am running "ipconfig /all" and process its output to return structured data.

It returns all network related information, works much faster than VI above (on my PC is 120 mS vs 1.2 S).

But it is required some sub-VIs, let me know if any is missing.


It always helps to attach the whole project as ZIP file!

 

Btw. your VI does not work for me because it requires English responses: there might be a lot of people worldwide having the same problem like me…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(2,187 Views)

always helps to attach the whole project as ZIP file!

Btw. your VI does not work for me because it requires English responses: there might be a lot of people worldwide having the same problem like me…


Thank you for repacking all VI in one zip, although I cannot open it now due to my LabVIEW is too old 🙂

And yes, you are perfectly right, these VI are for English response only, for other languages you have to adjust parsing.

0 Kudos
Message 10 of 10
(2,156 Views)