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

I need adviсe :)

Mouse
2012-02-27
2012-02-27
  • Mouse - 2012-02-27

    Hello! I've made for instance an array in my library. Now i want to give an ability to the user of my library to define the size of this array. I It's static array which would be compiled with users project, but user needs to define the size of library's array.

    I tried use pragma {IF defined ...} {END_IF}, but it doesn't work in variable's area.

    How to realize this possibility?

     
  • TimvH

    TimvH - 2012-02-27

    An option is to use parameters. You can add these to the library (only available when creating libraries).
    When the user adds the library he can specify the value of this parameter in the library manager.

    This parameter is then in your case the size of the array.

     
  • Mouse - 2012-02-27

    Thanks!
    This is exactly what I needed! even better

     

Log in to post a comment.