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 » Condition at ECC Transitions(Conditions ECC)
Condition at ECC Transitions [message #1833014] Wed, 30 September 2020 15:51 Go to next message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
Hello,

I currently have an ECC where I want to transition to the next state only if my data input is TRUE (bool). The documentation states I need to compare this using the '==' operator, but 4diac tells me this is incorrect and gives me the following message: "no viable alternative at input '='" .

I've tried using '=' to compare the value and it seems like it does not work. Is there an example how I can accomplish this?

Thank you in advance,

Mario
Re: Condition at ECC Transitions [message #1833023 is a reply to message #1833014] Wed, 30 September 2020 20:25 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1582
Registered: January 2014
Senior Member

Hi Mario,

'=' is the symbol for comparison in structured text expressions (i.e., the syntax behind transition conditions. And sofar I thought it worked. Can you provide us with the generated cpp snippet for the code in question? or a sample transition conditon?

Alois
Re: Condition at ECC Transitions [message #1833040 is a reply to message #1833023] Thu, 01 October 2020 09:16 Go to previous messageGo to next message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
Hello Alois,

This is what I thought the issue might be, but 4diac keeps telling me there is something wrong when using '=='. So how am I supposed to compare this boolean value?

Thank you for your quick response,

Mario
Re: Condition at ECC Transitions [message #1833041 is a reply to message #1833040] Thu, 01 October 2020 09:23 Go to previous messageGo to next message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
Another thing I've found is that the code generated when using '==' looks like this:

case scm_nStateIdle_Empty:
if((scm_nEventSTARTID == pa_nEIID) && (((IsConveyorLoaded() == == false))))
enterStateStarting();

But when I use '=' to compare the values in ST the generated code looks correct to me:

case scm_nStateIdle_Empty:
if((scm_nEventSTARTID == pa_nEIID) && (((IsConveyorLoaded() == false))))
enterStateStarting();

I can still somehow enter the Starting State regardless of the Loaded Flag being TRUE or FALSE
Re: Condition at ECC Transitions [message #1833046 is a reply to message #1833041] Thu, 01 October 2020 10:34 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1582
Registered: January 2014
Senior Member

I think we have here a C++ de-referencing Problem. Can you try to write [FALSE = IsConveyorLoaded] in your transition condition and see if that works?

Alois

PS '==' is defininitly worng. Where in the documentation have you found this?

Re: Condition at ECC Transitions [message #1833050 is a reply to message #1833046] Thu, 01 October 2020 11:10 Go to previous message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
It doesn't seem to work, for now I am using permit blocks as a quick fix so I can continue on other things. Strangely I have a StateMachine where this works as intended so there might be an issue on my end.

I found this under the section 12 in Change the ECC here: https://www.eclipse.org/4diac/en_help.php?helppage=html/4diacIDE/createOwnTypes.html
Previous Topic:Error when compiling
Next Topic:Using Forte with non supported WAGO PFC200 IO modules
Goto Forum:
  


Current Time: Fri Apr 19 10:44:26 GMT 2024

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

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

Back to the top