Codesys Newbie Convert Word to ASCII String

2015-04-28
2015-04-29
  • EnterDownload - 2015-04-28

    Hello All

    I am a newbie to Codesys...about 3 weeks.

    I have an HMI where an operator can choose a filename to execute.

    The filename is 10 words long, 2 characters per word.

    The filename e.g. "PROG1" is selected from the HMI and sent over Modbus to the Festo PLC.

    On the Modbus, the filename text "PROG1" seen as 3 words

    Word1: Decimal Value = 21072
    Word2: Decimal Value = 18255
    Word3: Decimal Value = 49

    The question is how can I convert a value of any length word(s) from their Decimal Value to the ASCII equivalent string and read it back into a variable ?

    From this ...Word1+Word2+Word3 .....How do I get this ----> "PROG1"

    Can someone help the newbie ?? Please let me know if more clarification is needed..

    thanks

    JL

     
  • EnterDownload - 2015-04-29

    SOLVED : Take 3 WORDS and convert back to the ASCII String that the Words represent

    The Words :

    Word1- Decimal Value : 21072
    Word2- Decimal Value : 18255
    Word3- Decimal Value : 49

    The 3 Words Converted back to a String = "PROG1".....as seen in the attached picture, (the value for the result variable "sProgramName")

    IMG: Convert_Word_to_String.jpg

     

Log in to post a comment.