Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:36 Go to next message
Agostino Mascitti is currently offline Agostino MascittiFriend
Messages: 15
Registered: May 2018
Junior Member
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 09:55 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 635
Registered: January 2014
Senior Member
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: Tue Sep 25 03:35:58 GMT 2018

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

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

Back to the top