Convert string to real.

damian177
2022-08-22
2022-08-22
  • damian177 - 2022-08-22

    Hi,
    Do someone have any simple idea how convert this string : 'temp=44.4$'C$N'
    to real variable temp= 44.5 ?

     
  • dFx

    dFx - 2022-08-22

    I don't know about general purpose variable writing, but you should have a look at the forums. Already saw a post trying to get values from a file (like JSON does)

    For specific purposes and few variables, you may do it in 2 steps.
    1) Get the variable name and test if it match one expected
    2) Convert the value to desired datatype https://help.codesys.com/webapp/_cds_operator_string_to;product=codesys;version=3.5.14.0

     

Log in to post a comment.