Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

How to use __VARINFO within a function block to obtain the origin variable name?

Kim
2016-11-01
2022-03-15
  • Kim - 2016-11-01

    I know how to use __VARINFO to obtain the symbol name of a variable or object, but I have a problem with it.
    I would like a function block to obtain the symbol name of the variable that was used as input to it.
    Obviously, if I use __VARINFO I will only get the local pin name, not the symbol name of the variable that is actually connected to the pin outside of the block.

    The same problem occurs when I loop through my EtherCAT nodes using pointers and dereferencing.
    Obviously I'm not able to obtain the symbolic name of the node, only the symbolic name of the pointer.

    Suggestions anyone? Or is this a dead end?

     
  • surikan - 2022-03-06

    Hi Kim, did you ever manage to find a solution to this?

     
  • crthomas - 2022-03-15

    Hey, there is no way to know the symbol name from VARINFO. The only way that I know that the system has any access to symbolic naming is through the symbol configurator. But the symbol configurator works more for taking a symbolic name and deriving the VARINFO information from it, not the other way around.

     

Log in to post a comment.