i looked for a function that converts the value of the any variable into a string. While i couldn't find a library or at least some documentations for this case, i written my own function.
you should be able to call the generic TO_STRING() operator. For example, myString := TO_STRING(myDint);, where myString is a variable of type STRING and myDint is a variable of type DINT.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately you misunderstood my needs.
I was looking for a Function like ANY_TO_STRING not DINT_TO_STRING.
As you can see in the attached project, the ANY-type needs to be decoded firstly in a IEC datatype.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
dear codesys colleagues,
i looked for a function that converts the value of the any variable into a string. While i couldn't find a library or at least some documentations for this case, i written my own function.
Hints or improvements are welcome!
more posts ...
you should be able to call the generic
TO_STRING()
operator. For example,myString := TO_STRING(myDint);
, where myString is a variable of type STRING and myDint is a variable of type DINT.Thanks for your response.
Unfortunately you misunderstood my needs.
I was looking for a Function like ANY_TO_STRING not DINT_TO_STRING.
As you can see in the attached project, the ANY-type needs to be decoded firstly in a IEC datatype.