취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Convert hex number to mac address with colons

해결 완료!
솔루션으로 이동

This might be a simple thing to do but I can't make it happen 😞

 

So I need to make a mac address with colons. At first, the Address is  divided in two sections.

First the constant part C87248 and the second part as a running number from 0 to appr. 16000000

The outcome should look like this C8:72:48:00:00:00

 

The .vi is going to be used in teststand 3.5.

The running number is an input parameter and .vi should return the mac address as a string so that teststand could read it.

 

These hex conversions in labview drives me crazy. I'm able to convert the address to format

C872 4800 0000 but I can't reformat it the way i want it.

 

 

0 포인트
1/7 메시지
8,315 조회수

Hi sebulban,

  Please tell me whether the Hex address is a string or an integer...How it is stored in testStand variables?

 

 

Thanks and regards,

srikrishna

Regards,
Srikrishna


0 포인트
2/7 메시지
8,310 조회수
솔루션
승인자 sebulban

This should do it, although it's probably not the most efficient way.

 

 

build mac address.png

 

MC

 

0 포인트
3/7 메시지
8,299 조회수

Thanks ! That works just fine 🙂

0 포인트
4/7 메시지
8,287 조회수

mac.png

Omar
0 포인트
5/7 메시지
8,273 조회수

And here is yet another solution.

 

Note: Right click on the Search And Replace function and check Regular Expression.

 

To MAC Address.png

 

Edit: Added the 6 constant to length input of number to hex

=====================
LabVIEW 2012


0 포인트
6/7 메시지
8,264 조회수

Speed is probably not important for something like this. But out of curiosity I did a comparison of all three techniques above. I ran the algorithms 10M times each.

 

MaxCrunch 250mS

Omar II 1586mS

SteveChandler 1590mS

Altenbach: <46pS (Only he has not yet posted his version 매우 기쁨 이모티콘)

=====================
LabVIEW 2012


0 포인트
7/7 메시지
8,254 조회수