There is an option to use VAR_IN_OUT CONSTANT variables.
This is described in the Help of CODESYS
WARNING: Uncheck the option "Replace constants", otherwise you will get exceptions in CODESYS.
See the menu: Project => Project Settings => Compile options
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The following code does not compile:
Are x and y not considered constants here?
I get the error : Border '((x * y) - 1)' of array is no constant value
Why do you declare the constant as INPUT? Makes no sense...
This will work:
If you want to create the array dynamic, you have to use __NEW if your target system supports this.
There is an option to use VAR_IN_OUT CONSTANT variables.
This is described in the Help of CODESYS
WARNING: Uncheck the option "Replace constants", otherwise you will get exceptions in CODESYS.
See the menu: Project => Project Settings => Compile options