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

Use Global Variables

freedumz
2017-08-09
2017-08-10
  • freedumz - 2017-08-09

    Hi everyone,

    Since I've installed codesys version 3.5.8, when I want to use a global variable which is declared for example in the GVL file, I have to call it by this way: Gvl.VariableName
    But before, with the version 3.5.5, I didnt have to do that, only the name was enough
    And if I update an old progam created with 3.5.5 to version 3.5.10, I can continue to call my variable only by their name, I have done a quick check in the setting between the bot version but I found nothing
    Someone has an idea of what I have to do?

    Many thanks in advance

    Dom

     
  • bjh - 2017-08-09

    Remove this from the top of your GVL:

    {attribute 'qualified_only'}
    

    This attribute forces one to use the fully qualified variable name, i.e "GVL.Variable" instead of just "Variable".

    However, I find that forcing the qualified name can be helpful because it makes it more difficult to get your variables mixed up and it becomes very clear that you're dealing with a global.

     
  • teichhei - 2017-08-10

    Agreed, using qualified_only as the default makes perfect sense. Makes it easier to organise as well.

    Sent from my SM-G935F using Tapatalk

     

Log in to post a comment.