Get text from textlist

viksym
2024-05-31
2024-06-03
  • viksym - 2024-05-31

    Does anybody know how to get a specific text from a text list within a program. Obviously it works in a visualization, but because I will have an HMI that has it's own system and I will have to send variables to this HMI via an OPC UA connection, I need to be able to get a text into a string.

    I tried using the VisuElems like this, but it only returns an empty "" and nothing else.

    IF trig THEN
        sText := VisuElems.cmpDynamictext.DynamicTextGetDefaultText(ADR(sTextList), ADR(sAlarmID))^;
        //sText := VisuElems.cmpDynamictext.DynamicTextGetText(ADR(sTextList), ADR(sAlarmID))^;
        trig := FALSE;
    END_IF
    

    Any help and idea is highly appreciated because I am getting desperate here.

     
  • paro - 2024-05-31

    I think you will find something in the libary TexlistUtils: https://content.helpme-codesys.com/en/libs/TextListUtils/Current/index.html

     
    • viksym - 2024-06-03

      Thank you, but sadly I already tried this and it also doesn't work. It's not doing anything.

       

Log in to post a comment.