Cannot toggle between library enumeration names

ert
2014-01-23
2014-01-24
  • ert - 2014-01-23

    I have a following enumeration type:

    TYPE MY_ENUM_TYPE :
    (
    Β  Β MY_VERY_LONG_ENUM_VALUE_1Β  Β := 101,
    Β  Β MY_VERY_LONG_ENUM_VALUE_2Β  Β := 205,
    Β  Β MY_VERY_LONG_ENUM_VALUE_3Β  Β := 892
    );
    END_TYPE
    

    When I use this DUT in a project (e.g. in a function block) I can toggle Prepared Value when online between MY_VERY_LONG_ENUM_VALUE_1 / MY_VERY_LONG_ENUM_VALUE_2 / MY_VERY_LONG_ENUM_VALUE_3 - simply by clicking on Prepared Value.

    When I create a library (based on CoDeSys Common Library Template) and have that DUT definition in the library I cannot toggle as described above. That means I either have to know the target value (101, 205, 892) or corresponding name, which I am not happy with.
    This is just an example showing that the numbers and names can be not obvious to a user, so I would prefer to easily toggle between them without need to know the names/values.

    Why does it happen? Is there a way to resolve it?

     
  • Anonymous - 2014-01-24

    Originally created by: Captive Engineer

    Hello, ert.

    Have you tried creating a library without the Common Library Template? I tried to duplicate your work except for using any library template, and the behavior of my clicking on the Prepared Value field was the same for my library enumeration and for my application-defined enumeration.

    For clarity's sake, when you say that the field "toggles," do you mean that it automatically cycles through all the enumerated items with each click? This was what I was expecting when I first read your post, but in neither case did this happen with my experiments. Instead, in both cases, a drop-down list box appeared with the first enumerated item selected by default. Subsequent mouse work was required by me to select either of the alternatives. So if your interface was letting you toggle through the options, maybe there is an Options or Customization setting that you have different from mine, which are pretty much default values at the moment.

    Best regards,
    The Captive Engineer

     
  • ert - 2014-01-24

    Hello, Captive Engineer,

    I created an empty library and it worked! I have the dropdown list as you described.

    When using as a project I had that toggle which was different to dropdown list. The VAR_INPUT value changed while I was clicking on it.
    But in a library it wasn't working.

    So I assume it was some settings of the library which prevented it from working. I am still confused with that dropdown list / toggle differences, but buth are acceptable for me.

    Thank you for your help!

    EDIT:
    It seems that the issue is somehow related to LanguageModelAttribute of the library. When I set it to 'qualified-access-only' the enums don't work...
    Strange, isnt it?

     

Log in to post a comment.