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
This may be possible by setting the BY variable to a variable of your enumeration, and then setting an instance of your DUT to the value of X. Such as:
FORj:=0TO100byxDOmyDut:=x;x:=myArray[j];END_FOR
I hope this points you in the right direction. Please let me know if you have further questions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your reply !
I'm not sure I understand exactly what you mean, what would "myArray" be in that case ? Also with what value is "x" supposed to be initialized with ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Is there a way to iterate over enum members in CodeSys ? For example, if I have the following enumeration definition :
Is it possible to iterate over each enum member in a for loop for example ?
This may be possible by setting the BY variable to a variable of your enumeration, and then setting an instance of your DUT to the value of X. Such as:
I hope this points you in the right direction. Please let me know if you have further questions.
Thanks for your reply !
I'm not sure I understand exactly what you mean, what would "myArray" be in that case ? Also with what value is "x" supposed to be initialized with ?