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

Library TextListUtils 3.5.16.0, function GetTextListInfo

kislov
2020-05-21
2022-11-14
  • kislov - 2020-05-21

    Hi.
    Maybe someone have code snippet for function GetTextListInfo from library TextListUtils 3.5.16.0?
    I want to get number of entries in my textlist and get ID for each of them with IEC-code.

    I will be really appreciated for any help.

     
  • m.prestel - 2020-05-25

    Hello @kislov,

    PROGRAM PLC_PRG
    VAR
        itfTextListInfo : TLU.ITextListInfo;
        udiNum : UDINT;
        iterator : COL.IIterator;
        itfElem : COL.IElement;
        itfStringElem : COL.IStringElement;
        wst : STRING;
        sTextListName, stText : STRING;
        xRead : BOOL;
    END_VAR
    IF xRead THEN
        xRead := FALSE;
        itfTextListInfo := TLU.GetTextListInfo(stTextListName:=sTextListName);
        IF itfTextListInfo <> 0 THEN
            udiNum := itfTextListInfo.NumberOfEntries;
            iterator := itfTextListInfo.GetIdIterator();
            IF iterator <> 0 THEN
                WHILE iterator.HasNext() DO
                    iterator.Next(itfElement=>itfElem);
                    __QUERYINTERFACE(itfElem, itfStringElem);
                    wst := itfStringElem.StringValue;
                    sTextListName := itfTextListInfo.Name;
                    TLU.GetText(sTextList:=sTextListName, sTextIndex:=wst, psText:=ADR(stText), diSize:=SIZEOF(stText));
                END_WHILE
            END_IF
            itfTextListInfo.Release();
        END_IF
    END_IF
    

    Best regards,
    Marcel

     
    πŸ‘
    1
  • kislov - 2020-05-25

    Thank you very much, sir Marcel!

     

    Last edit: kislov 2020-05-25
  • coder - 2022-06-30

    Hi,

    it does not work with version V3.5SP16. Any ideas why? No entries created. Textlist "Languages" created in a folder "Textlist".
    Thanks and regards

     

    Last edit: coder 2022-07-01
  • malin67 - 2022-11-13

    Hello, coder,
    Maybe there is no visualization in the project?

     
  • coder - 2022-11-14

    Hi Malin67,
    visualization is working fine.
    Regards.

     
  • coder - 2022-11-14
     

    Last edit: coder 2022-11-14
  • coder - 2022-11-14
     

    Last edit: coder 2022-11-14

Log in to post a comment.