Text List Fallback Value

phoward131
2024-03-22
2024-04-18
  • phoward131 - 2024-03-22

    I am relatively new to Codesys and I'm trying to develop an HMI that displays what mode a particular device is in based on an integer value. I am currently using dynamic texts with a text list which works fine but I am looking for a way to display a particular string (ie 'Unknown') when the index doesn't match any of of the indices in the text list. I can enter 'Unknown' in the text property of the text field element which works as expected but it displays the single quotes on the visualization. How can I escape these quotes to simply display the word Unknown? Thanks!

     
  • tomas111 - 2024-04-17

    What version of codesys?
    Need to avoid in any specific element?
    Try writing %s in the text, it should work. Or better yet, attach a screenshot.

     
  • dkugler - 2024-04-18

    why you adding this ' ' ? you don't need them in the text field :-) delete them, write only Unknown and everything will be as expected

     

Log in to post a comment.