Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Function TIME()(Particolar use in a FB)
Function TIME() [message #1740693] Wed, 17 August 2016 10:58 Go to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi everybody,
I have a question for the use of the function TIME() in a FB.

In the development of my 4DIAC application, I need to represent an event "wait 3 seconds and then.." before to change state.

Simple example:
In a FB add, I want to add 2 number after 3 second of a request REQ. But without use new variables (input or output), because I can't change FB'interface (otherwise I need to remake the network below).
I attach my first try solution.

How I can do?
I hope to be clear.

Best regards,
Michele Citro
Re: Function TIME() [message #1740716 is a reply to message #1740693] Wed, 17 August 2016 17:45 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Hi,

No, unfortunately this will not work as expected. The first reason is that the time function only returns the time that has elapsed since FORTE was started. So you could use it to measure the time on the start and at at the next event and calculate the difference. However you would need a dedicated event.

The best option to do this is to use the ATimeOut adapter. You can find examples how it is used in the traffic light example. However this requires the chnage the FBs interface. This is no problem you can update an FB interface in your application by inoking the context menu update FB.

I hope this helps.

Alois
Re: Function TIME() [message #1740757 is a reply to message #1740716] Thu, 18 August 2016 08:13 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

surely your help is precious,

Therefore, I understand the solution but isn't clear yet how I can update FB interface without problems.
I want to better explain.
Some times when I change FB interface (example, adding an Input) a popup appears with the words "need to remake the network" or similar(I don't remember),
so I see that events or I/O data aren't longer connected (in example.EMB_RES) even if I click dx-->Update FB Type.

What is the problem in this case?
It's my mystake?

Best regards,
Michele CItro
Re: Function TIME() [message #1740955 is a reply to message #1740757] Sun, 21 August 2016 11:46 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Hi,

no it is definitely not your mistake. The problem is that when you press "Update FB Type" 4diac tries to match the existing connections with the new FB type's interface. The only thing we can currently do is that we are keeping the connections to the interface elements with the same name. If you are changing a name of a FB interface element (e.g., REQ to REQ_RD) then we can not match this anymore automatically and currently delete the connection. Therefore if you only add interface elements or delete some the network will still be correct after the update.

We have some ideas to improve the situation in the future by showing you a dialog with the connections that would be lost and give you choices to which ports you may want to connect them. Any ideas how to present this and what would be needed are highly appreciated.

BR,
Alois
Re: Function TIME() [message #1741449 is a reply to message #1740955] Thu, 25 August 2016 09:08 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,
thank you for the reply.

I understand perfectly, so I'm trying this solution.
But, unfortunately, the result isn't the same. Because, even if I add inputs only (such in the image attached) I have, after "update FB Type", events and data lost in the Resourse mapped.

The image will be more clear than my words.
Have you any tips?

Best regards,
Michele Citro
Re: Function TIME() [message #1741569 is a reply to message #1741449] Thu, 25 August 2016 21:16 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Hi,

thanks for pointing this out. I think you found a bug in 4diac-ide. I hope you have saved your project so you can back up.

Can you please tell me which 4diac version you are using. From the error message dialog that is shown in the figure it looks like it is not 1.8.0.

BR,
Alois
Re: Function TIME() [message #1741602 is a reply to message #1741569] Fri, 26 August 2016 08:52 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

yes, I saved all and tryed on a test project.

Anyway, I'm using 4diac-ide version 1.8M1.

If this bug can not be solved, the only solution maybe is remake a new equal FB with the additional input output and move event and data from old FB to the new FB (unmapping e removing the old FB in the end)

Best regards,
Michele Citro
Re: Function TIME() [message #1741635 is a reply to message #1741602] Fri, 26 August 2016 13:31 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Hi,

The latest version is 1.8.0. We did lots of fixes between 1.8M1 and 1.8.0 but I don't know if your issue has been fixed. I also don't know how much effort it would be. Would you be so kind and give 1.8.0 a try?

Instead of making a new FB you can alos change the old type. But then instead of invoking the update FB perform the manual changes as you are suggesting.
Re: Function TIME() [message #1741708 is a reply to message #1741635] Sun, 28 August 2016 10:20 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

surely, no problem.
I have tried tris morning with 4DIAC-IDE version 1.8.0 and there is the issue yet.

The only thing that changes is the not appearance of the error message dialog, such as you said.

Thanks for your help.

Best regards,
Michele Citro

Re: Function TIME() [message #1741789 is a reply to message #1741708] Mon, 29 August 2016 15:40 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Hi,

thanks for the info. Instead of the error message there should have been a pop-up on the bottom left with automatic error reporting. Did you see this?

Would you be so kind and report a bug in our bugzilla so that we can keep track of this issue.

BR,
Alois
Re: Function TIME() [message #1741861 is a reply to message #1741789] Tue, 30 August 2016 08:54 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

no, a pop-up don't seems to appear.

Surely, I will report a bug soon.

Best regards,
Michele Citro
Re: Function TIME() [message #1741871 is a reply to message #1741861] Tue, 30 August 2016 10:34 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Oh ok. We integrated an automated error reporting infrastructure which can report such issues for you. Normally when I tested it it showed a small pop-up on the bottom left. On the first error the pop-up asks if it automatic error reporting should be activated. And on any further error it asks if it should send it. This should make it very convenient for you to report issues. And it makes it very convenient for us as we get some stack traces and furhter information on the state of 4diac-ide. Helping us to track the error down.
Re: Function TIME() [message #1779301 is a reply to message #1741871] Fri, 05 January 2018 05:57 Go to previous messageGo to next message
Daniel Ng is currently offline Daniel NgFriend
Messages: 9
Registered: October 2017
Junior Member
Dear Dr Zoitl,

Chanced upon this old thread and just wanted to say that the bug for 'Update FB type' mentioned here still persists in 4DIAC IDE 1.8.4. Unchanged data/event connections remain connected under application but everything else in resource view gets disconnected.

I couldn't find a bug report so I thought I'll mention here first.

Regards
Daniel Ng
Re: Function TIME() [message #1779409 is a reply to message #1779301] Sat, 06 January 2018 18:07 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
Dear Daniel,

thanks for bringing this up again. I think we somehow lost track on this during the work in 4diac-ide 1.9.0. As we are in the final phase of the 1.9.0 release could you be so kind and give the 1.9.0.M2 a try? We did an enormous amount of changes under the hood and if the issue is still here i would like to fix it in the 1.9.x code.

thx in advance,
Alois
Re: Function TIME() [message #1779863 is a reply to message #1779409] Mon, 15 January 2018 03:20 Go to previous message
Daniel Ng is currently offline Daniel NgFriend
Messages: 9
Registered: October 2017
Junior Member
Dear Dr Zoitl,

Unfortunately, the problem persists in 1.9.0M2.

Regards,
Daniel
Previous Topic: Build Forte error using libmodbus
Next Topic:Measurement of time interval with KOP?
Goto Forum:
  


Current Time: Sat Feb 24 02:53:18 GMT 2018

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

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