Case switch Constant
How do I use Constant variables in a "CASE ... OF".
Because defining it in the Variables list in FB doesn't work for me.
How do I use Constant variables in a "CASE ... OF".
Because defining it in the Variables list in FB doesn't work for me.
Comments
Hi!
Try this workaround
BR
Thank you for the work around.
But we wanted to know if its even possible to use Constant.
Because we want to make a guide for basic programming in crosse multiple platforms and not every platform can use Enumerations.
I created a constant in the variable tabel and can use it in a CASE statement.
Does it help if you put a space between the variable and the colon?
This works for me in a Function Block, in PLCnext Engineer 2024.0.2:
Also, work for ide 2023.9
Sorry, little bit careless of me but we work in 2023.0.5.
I have tried something see images, but still it does not work.
Could it be that the version doesn't support this.
Could it be that the version doesn't support this.
Yes, that's possible.
Does the same problem happen for you in PLCnext Engineer version 2024.0.2?
Are you aware if i can upgrade from 2023.0.5 to 2024.0.2, without any problems. Because i cant not really find any information about it.
This should be possible without any problems*. You should take a copy of the project before upgrading it. If you are not happy with the result, then you can easily go back to the earlier version.
* but please check the compatibility of all the apps you are using in your solution, including any PLCnext Engineer libraries from the PLCnext Store.
Thank you, I have upgraded it to 2024.0.2 without any problems.