question on type conversions

sarathbabu
2012-09-26
2012-10-02
  • sarathbabu - 2012-09-26

    Hi,

    Below is the function am using but i did not understand how the conversion works here.
    

    function IDVAR:string
    var_input
    ID_VARONE:string;
    ID_VARTWO:STRING;
    end_var
    VAR
    TEMP:STRING;
    END_VAR


    TEMP:=CONCAT(ID_VARONE,'^');
    TEMP:=CONCAT(TEMP,ID_VARTWO);
    IDVAR:=(TEMP,'^');


    function TEST:string
    var_input
    VarSARID:string;
    Act_Count:udint;
    end_var


    TEST:=IDVAR('12345',UDINT_TO_STRING(Act_Count));

    In codesys i did not find the UDINT_TO_STRING conversion but it is working any thing is hidden?

    Thanks
    sarath

     
  • shooter - 2012-09-26

    Nothing hidden.
    i like to propose you the use of the F2 key.
    there you will find every conversion and any thing you can type in at a particular moment.

     
  • sarathbabu - 2012-09-26

    Thanks for the info i did not find it in the help file,I thought all conversions can be found in help file

     
  • shooter - 2012-10-01

    IDVAR:=(TEMP,'^');

    this is not allowed
    it should read IDVAR:=TEMP;
    however you can do this in previous line

     
  • sarathbabu - 2012-10-02

    Hi,

    I misstyped it should be

    IDVAR:=CONCAT(TEMP,'^');

    Thanks

     

Log in to post a comment.