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 » data input with connection in CustomFB
data input with connection in CustomFB [message #1822566] Tue, 10 March 2020 05:54 Go to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
\project\forte-incubation_1.11.0\src\core\dataconn.cpp

void CDataConnection::readData(CIEC_ANY *pa_poValue) const{
if(m_poValue){
if(!mSpecialCastConnection){
pa_poValue->setValue(*m_poValue);
}
else{
CIEC_ANY::specialCast(*m_poValue, *pa_poValue);
}
}
the m_poValue is always false when there is data connection
plz see the attachement, each time i trigger event REQ of b1, then the Reqval of b1 is FALSE, if there is not data connection, the Reqval is TRUE,
Re: data input with connection in CustomFB [message #1822572 is a reply to message #1822566] Tue, 10 March 2020 08:28 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
So what is you question or suggestion?
Re: data input with connection in CustomFB [message #1822575 is a reply to message #1822572] Tue, 10 March 2020 08:44 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
i think it is a bug, the REQ event didn't pass any data, then it should keep it as the old one, not init it with false default value each time.
even i set the default value to true, but doesn't work.

[Updated on: Tue, 10 March 2020 08:46]

Report message to a moderator

Re: data input with connection in CustomFB [message #1822576 is a reply to message #1822575] Tue, 10 March 2020 08:49 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Have you debugged this? If there is a bug in this part of the code, more than your single FB should be affected.
Please provide your FB definition(s) and your test procedure for this scenario.
Re: data input with connection in CustomFB [message #1822577 is a reply to message #1822576] Tue, 10 March 2020 08:51 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
the two FBs are only initialized, the second FB data connected to the first one data, make the First Req result the First Reqval=false, if remove the data connection, then the first Reqval is true(this is corrrect behavior)
Re: data input with connection in CustomFB [message #1822578 is a reply to message #1822576] Tue, 10 March 2020 08:54 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
This is the attachment, i didn't pack all the template fbs, just my own

After deploying, i just triger the First FB's Req event by manually.
  • Attachment: M35.7z
    (Size: 5.19KB, Downloaded 53 times)
  • Attachment: 1.jpg
    (Size: 29.81KB, Downloaded 64 times)
  • Attachment: 2.jpg
    (Size: 28.52KB, Downloaded 56 times)
  • Attachment: noconn1.jpg
    (Size: 27.00KB, Downloaded 59 times)
  • Attachment: noconn2.jpg
    (Size: 27.52KB, Downloaded 62 times)

[Updated on: Tue, 10 March 2020 09:00]

Report message to a moderator

Re: data input with connection in CustomFB [message #1822583 is a reply to message #1822578] Tue, 10 March 2020 09:18 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
The strange thing to me is that the booleans are seen as true before the event. They are initialized to false. It looks like the debugging is showing true when it's actually false, so when the REQ is triggered, the real value (FALSE) is passed, but this is just an assumption
Re: data input with connection in CustomFB [message #1822584 is a reply to message #1822583] Tue, 10 March 2020 09:22 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member

void CDataConnection::readData(CIEC_ANY *pa_poValue) const{
if(m_poValue){
if(!mSpecialCastConnection){
pa_poValue->setValue(*m_poValue);
}
else{
CIEC_ANY::specialCast(*m_poValue, *pa_poValue);
}
}
}

if(!mSpecialCastConnection) then use the *m_poValue, actully the *m_poValue seems to be false all the time
Re: data input with connection in CustomFB [message #1822598 is a reply to message #1822584] Tue, 10 March 2020 11:55 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
Mr. Jose CabralFriend is right,

if the event with data IOs, then it will be false, if not, the data will not be changed. I use another event to implement it.
It's not a bug,
but the monitor status display may be a problem.
Re: data input with connection in CustomFB [message #1822602 is a reply to message #1822598] Tue, 10 March 2020 12:34 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

this is perfectly correct behavior of 4diac FORTE. The value that you see is the value at the FB's data store. However this is not the value available for other FBs, as it is defined in IEC 61499. The value is only made available when you send an event. In 4diac FORTE this is solved such that we have a data buffer in the connection. On the occurrence of the output event the FB's value is copied to the connection. On the occurrence of the input event the value is copied from the connection to the value.

When we implemented the monitoring we discussed a long time what values we should show to the users. After weighing all the pros and cons we decided to always show the values at the FB. Although this may lead to a strange situation like in your case you always get the values that are available in your FB for ECC and Algorithms. Maybe we should add a feature to monitor the connection. But I'm not sure if this adds any value.
Previous Topic:Understanding FORTE code
Next Topic:Adapter connect to several FBs
Goto Forum:
  


Current Time: Fri Mar 29 06:37:47 GMT 2024

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

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

Back to the top