There is the function "getadapterinfo" in CmpSysEthernet.library. I try to use it to get MAC of local Ethernet adapter. But i can't understand what it gets me. The field MAC, which the function returns, doesn't match the real MAC of any adapter in my PC. Unfortunately I can't find extra information of this function.
Is some other function (way) there, which can get MAC address?
==> start menu "Run"
Enter "cmd" + Return
"ipconfig" will return the IP and MAC addresses of all present network adapters.
Thank's, but i need to get MAC in IEC-task for different system. Now i get it by outer ARP request and send the result back to IEC-task. But it's inconvenient way, and it doesn't work behind router (router changes PLCs MAC on its own). i need something local and universal to get MAC in IEC-code.
1. you need to add/check if a component is in your runtime:
FOR iAdapter := 0 TO diNumber DO
iAdapterNum := iAdapter,
pbName := ADR(stName),
pbDescrition := ADR(stDescription),
iBuffersize := SIZEOF(stName),
iMacLength := 6,
sMacAdress := ADR(aby_address));
Log in to post a comment.