Check values of BOOL[16] [message #1791433] |
Fri, 29 June 2018 05:36  |
Eclipse User |
|
|
|
Hello,
I have a FB that accepts an array of booleans, 16 entries. How can I programmatially check their value (e.g., if MY_Array()[7] == false)?
I tried with the following snippet but it doesn't work. Also, there is no similar example in the current repo, it seems.
if(RESET_Array()[i] == false) {
x = i;
break;
}
Thank you for your support!
Agostino
|
|
|
Re: Check values of BOOL[16] [message #1791435 is a reply to message #1791433] |
Fri, 29 June 2018 05:55  |
Eclipse User |
|
|
|
Hi,
The syntax for accessing variables and arrays from C++ is not that clear. We had to do here some tricks to make our ST code generation easier. Therefore I can recommend to test such cases in ST generate the C+++ code and look there for reference. Or even better, if possible write your FB's algorithms in ST.
For your example the code would be:
if(RESET()[i] == false) {
x = i;
break;
}
Cheers,
Alois
|
|
|
Powered by
FUDForum. Page generated in 0.03363 seconds