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 extract the name of an FB to a variable

jbarrio
2018-10-09
2018-10-11
  • jbarrio - 2018-10-09

    hello:

    There is some way to extract the name of a function block (from it) to a variable in the same FB.

    I do not know if I explained myself very well

    Best regards

     
  • josepmariarams - 2018-10-10

    Try

    {Attribute 'parameterstringof'}

    Sent from my Moto G (5S) Plus using Tapatalk

     
  • jbarrio - 2018-10-10

    hello:

    Thanks for request, you can write a example to show me some example of the use of that attribute, I do not find any example or help on how to use it.

    Best Regards,

     
  • josepmariarams - 2018-10-10

    Example:

    IMG: parameterstringof.png

     
  • josepmariarams - 2018-10-10

    The attribute is instance-path and noInit not parameterstringof aI am sorry.

    Is mandatory add both attributes: noInit and instance-path

    Salut!

     
  • jbarrio - 2018-10-10

    very thanks,

    I have created a function block to see how it works with the following code.
    FUNCTION_BLOCK POU_1
    VAR_INPUT
    in1: BOOL;
    in2: BOOL;
    END_VAR
    VAR_OUTPUT
    out1: BOOL;
    END_VAR
    VAR
    {attribute 'symbol' := 'none'}
    {attribute 'hide'}
    {attribute 'instance-path'}
    {attribute 'noinit'}
    FbName : STRING(255);
    END_VAR

    if I run that FB in a plc the variable FB_name nor see it.

    BR

     
  • jbarrio - 2018-10-11

    very thanks

     

Log in to post a comment.