Get a instance name as string variable?

ssssssara
2010-02-26
2010-02-27
  • ssssssara - 2010-02-26

    I have a short question. Is it possible to get the instance name of a variable and use it as a string?

    In this example I would like to, instead of using a new string to input 'BlockName', use the actual variable name of the block. Is it possible, and if so, how?

    IMG: Bild

     
  • Igor Petrov - 2010-02-27

    CoDeSys I a compiler. Therefore in programming system we see variables and POUs names, but after the compilation there no symbolic names in code – only machine memory addresses.

    In this case I’d add extra string (or constant string) variable in the FB . In each instance initialization section assign any reasonable name for it. Next use the variable as the instance name.

     

Log in to post a comment.