<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to get MAC-address?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/</id><updated>2020-02-27T14:23:17.049000Z</updated><subtitle>Recent posts to How to get MAC-address?</subtitle><entry><title>How to get MAC-address?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/?limit=25#f855" rel="alternate"/><published>2020-02-27T14:23:17.049000Z</published><updated>2020-02-27T14:23:17.049000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.come898112518aa667bb19ae236311eadf1449cb6f3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
1. you need to add/check if a component is in your runtime:&lt;br/&gt;
Component.x=SysEthernet&lt;br/&gt;
(runtime config)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;use the following snippet:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;declare:&lt;br/&gt;
diNumber: DINT;&lt;br/&gt;
iAdapter: DINT;&lt;br/&gt;
stName: STRING(255);&lt;br/&gt;
stDescription: STRING(255);&lt;br/&gt;
aby_address:ARRAY&lt;span&gt;[1..6]&lt;/span&gt;OF BYTE;&lt;/p&gt;
&lt;p&gt;program:&lt;br/&gt;
getnumberofadapters(ADR(diNumber));&lt;br/&gt;
FOR iAdapter := 0 TO diNumber DO&lt;br/&gt;
    getadapterinfo(&lt;br/&gt;
    iAdapterNum := iAdapter, &lt;br/&gt;
    pbName := ADR(stName), &lt;br/&gt;
    pbDescrition := ADR(stDescription), &lt;br/&gt;
    iBuffersize := SIZEOF(stName), &lt;br/&gt;
    iMacLength := 6, &lt;br/&gt;
    sMacAdress := ADR(aby_address));&lt;br/&gt;
END_FOR&lt;/p&gt;
&lt;p&gt;cu&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to get MAC-address?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/?limit=25#5e4d" rel="alternate"/><published>2020-02-27T14:23:16.651000Z</published><updated>2020-02-27T14:23:16.651000Z</updated><author><name>Mouse</name><uri>https://forge.codesys.com/u/mouse/</uri></author><id>https://forge.codesys.coma180281300f9922096151f8711c295ae2971ff2b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to get MAC-address?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/?limit=25#9106" rel="alternate"/><published>2020-02-27T14:23:15.462000Z</published><updated>2020-02-27T14:23:15.462000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.com7a4d09d8c356022a77151a585452c05717703e38</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Windows-system?&lt;br/&gt;
If yes&lt;br/&gt;
  ==&amp;gt; start menu "Run"&lt;br/&gt;
Enter "cmd" + Return&lt;br/&gt;
"ipconfig" will return the IP and MAC addresses of all present network adapters.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to get MAC-address?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3803a3aec6/?limit=25#6897" rel="alternate"/><published>2020-02-27T14:23:15.057000Z</published><updated>2020-02-27T14:23:15.057000Z</updated><author><name>Mouse</name><uri>https://forge.codesys.com/u/mouse/</uri></author><id>https://forge.codesys.com27d241a0e903dfa3cf8f708e9a2b49cc7fc889cc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello!&lt;br/&gt;
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.  &lt;/p&gt;
&lt;p&gt;Is some other function (way) there, which can get MAC address?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>