Skip to main content



      Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Check values of BOOL[16]
Check values of BOOL[16] [message #1791433] Fri, 29 June 2018 05:36 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:[SOLVED] Creating an array and giving it as FB output
Next Topic:Monitoring Documentation
Goto Forum:
  


Current Time: Sat Jul 05 02:50:09 EDT 2025

Powered by FUDForum. Page generated in 0.03363 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top