Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Read Serial Number of PLC

Brine
2018-03-27
2018-03-28
  • Brine - 2018-03-27

    Hi,

    I'm trying to read the Serial number of the PLC using the SysTarget library function, "SysTargetGetSerialNumber" function.
    I get a result of 12, when I'm expecting a value of 2341920805002900322006146049 for the Serial number.
    What am I missing?
    I have included the screenshot of the running program.

    IMG: 2018

     
  • eschwellinger

    eschwellinger - 2018-03-27

    Hi,
    which plc are you using,
    this does not work at the moment... will be implemented to the 3.5SP13 - (June) release.

    BR
    Edwin

     
  • Brine - 2018-03-27

    Hi Edwin,

    Thank you for your reply. I'm trying this on a Festo PLC (CECC-LK).
    Is there another way to read any unique ID of the PLC? Say Mac ID or Serial number as an example.

    Edwin Schwellinger hat geschrieben:
    Hi,
    which plc are you using,
    this does not work at the moment... will be implemented to the 3.5SP13 - (June) release.
    BR
    Edwin

     
  • eschwellinger

    eschwellinger - 2018-03-28

    Hi,
    see attached Project...

    PROGRAM PLC_PRG
    VAR
       diNumber: DINT;
       iAdapter: DINT;
       stName: STRING(255);
       stDescription: STRING(255);
       aby_address:ARRAY[1..6]OF BYTE;
    END_VAR
    

    ```

    getnumberofadapters(ADR(diNumber));
    FOR iAdapter := 0 TO diNumber DO
       getadapterinfo(
       iAdapterNum := iAdapter,
       pbName := ADR(stName),
       pbDescrition := ADR(stDescription),
       iBuffersize := SIZEOF(stName),
       iMacLength := 6,
       sMacAdress := ADR(aby_address));
    END_FOR

    ```BR
    Edwin

    GetMacAdressSp12.project [64.39 KiB]

     

Log in to post a comment.