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 » How calculate time scan softPLC
How calculate time scan softPLC [message #1735119] Wed, 15 June 2016 16:03 Go to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

I'm trying the use of 4DIAC for an University project, for the first time.

In particular, I use this environment to move an automated warehouse.
I ask, Can I calculate the time scan of my program? If yes, how?
Thanks.

Best regards
Michele
Re: How calculate time scan softPLC [message #1735262 is a reply to message #1735119] Thu, 16 June 2016 16:35 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

could you be more specific what you mean with time scan? Would you like to cyclically trigger the scanning of inputs? For this you can use the E_CYCLE function block.
If you need to get the elapsed time you can use the function TIME() in an algorithm which will give you the time elapsed since the FORTE was started. By taking the TIME at different points in your program you can use this to calculate the elapsed time. Please be aware that currently this gives you in the default setup roughly an accuracy in the ms range. If you need higher accuracy a better approach would be to write an function block which is reading the system time from the operating system and translates it into a TIME_OF_DAY date type. Also for this data type we offer functions and function blocks to do calculations with. For this it would be interesting on which operating system you plan to run FORTE on.

BR,
Alois
Re: How calculate time scan softPLC [message #1735263 is a reply to message #1735119] Thu, 16 June 2016 16:36 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

could you be more specific what you mean with time scan? Would you like to cyclically trigger the scanning of inputs? For this you can use the E_CYCLE function block.
If you need to get the elapsed time you can use the function TIME() in an algorithm which will give you the time elapsed since the FORTE was started. By taking the TIME at different points in your program you can use this to calculate the elapsed time. Please be aware that currently this gives you in the default setup roughly an accuracy in the ms range. If you need higher accuracy a better approach would be to write an function block which is reading the system time from the operating system and translates it into a TIME_OF_DAY date type. Also for this data type we offer functions and function blocks to do calculations with. For this it would be interesting on which operating system you plan to run FORTE on.

BR,
Alois
Re: How calculate time scan softPLC [message #1735276 is a reply to message #1735263] Thu, 16 June 2016 21:03 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Today on my way home from work I spent some more thoughts on your question. I found out that we should have some FBs in 4DIAC which allow you to get some time information based on events. I came with the two FBs you can see in the attached figure:


  • E_TimeStamp gives you a time stamp value every time you trigger the EI input event.
  • E_StopWatch gives you the time duration that has elapsed between receiving a START and a STOP event

index.php/fa/26194/0/

Would such FBs be helpfull in for your work?

I even think these are FBs that should be suggested for the upcoming IEC 61499 update.

Cheers,
Alois
Re: How calculate time scan softPLC [message #1735306 is a reply to message #1735262] Fri, 17 June 2016 09:06 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Good morning Alois Zoitl,
and thanks for the precious answers.

I mean the time scan in the PLC's processing cycle (sush as it indicate in photo).
Particurarly,I would calculate time scan of my program, decentralized on more machine (pc desktop and portable, sush as in photo), to understand what are the time game and to compare it with the response time that I expect.
In short, I would do an analysis of this type.

Quote:

If you need to get the elapsed time you can use the function TIME() in an algorithm which will give you the time elapsed since the FORTE was started.


How is this function? I don't find it in typelibrary of 4DIAC.

Quote:

If you need higher accuracy a better approach would be to write an function block which is reading the system time from the operating system and translates it into a TIME_OF_DAY date type.


For the second approach, more accurate, I would use Windows 7 64bit to run FORTE (on both systems).
Furthermore, I see the FB E_TimeStamp and E_StopWatch. I think that this second FB can help me,in particular, for my work.

But, I ask advises to you all

Best regards,
Michele

[Updated on: Fri, 17 June 2016 09:21]

Report message to a moderator

Re: How calculate time scan softPLC [message #1735449 is a reply to message #1735306] Sun, 19 June 2016 20:51 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

thanks for your figures this helped my to better understand your application. But before going into detail for your questions I have two remarks:

  1. Although you can implement a pure scan-based architecture also in IEC 61499 you will loose a lot of the advantages you can get with events. Do you really need to do it in a scanned based way or wouldn't an event driven IEC 61499 approach bring you more benefits. En example for a potential architecture/deign pattern that can help you is presented in [1]. Especially in warehouse and intraprocess logistics (e.g., conveyor belts) most actions are event triggered (e.g., rising or falling edge of a sensor, command from higher level system).
  2. Please note that when you want to measure time delays across different devices you need to apply some time synchronization means so that you can compare the time stamps.


Regarding the TIME() function: this is an function you can call in an algorithm. Therefore you will not find it in the type library. But you could use it for implementing your own stopwatch FB as basic FB. you can do this by having two algorithms: START, STOP:
Algorithm START in ST:
    startTime := TIME();

where startTime would be an internal variable.
 Algorithm STOP in ST:
    DT :=  TIME()  - startTime;


I hope this helps.

Cheers,
Alois

[1] http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6389773
Re: How calculate time scan softPLC [message #1735640 is a reply to message #1735449] Tue, 21 June 2016 14:18 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

thanks as always.

I know the advantages of this standard and I don't want to lose them surely.
Infact, my application wants to work with them.
In the end of my project, I have to present and show the reasons of this choice.
Now I can't see the article, but I read it soon possible.

Leaving scan-based architecture, I'm trying to understand how to calculate the times in my decentralized application.
How are the steps I need to do? How should I think?
Is the first time that I'm in front this problems and I'm in difficult.
I wouldn't forget nothing.

Best regards

Michele

[Updated on: Tue, 21 June 2016 15:02]

Report message to a moderator

Re: How calculate time scan softPLC [message #1735667 is a reply to message #1735640] Tue, 21 June 2016 18:41 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

The question would be is are the events for starting and stopping occurring on the same device. In this case you wouldn't need to bother with the different timescales and times on the two devices. It would be the measurement of the roundtrip time. and maybe even more closely comparable to a classic PLC.

If start and stop are on different devices you need to get the absolute times on both devices and need to ensure that the devices are time synced. For Linux based devices you could have a look on the PTPd for high precision time syncing based on IEEE 1588 or maybe an NTP would be sufficent for your task. Depends on what accuracy you are needing.
Re: How calculate time scan softPLC [message #1738675 is a reply to message #1735667] Fri, 22 July 2016 07:41 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

sorry for the late reply. I didn't see the notification of message.

Yes, the events for starting and stopping are on the same device.I use an interface, created by FBDK.
I will try to do in this way.

Thank you so much.

Regards,
Michele Citro
Re: How calculate time scan softPLC [message #1738824 is a reply to message #1738675] Mon, 25 July 2016 09:04 Go to previous messageGo to next message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,
good morning.

I'm working on this feature of my application.

I don't have problem in the use of "E_StopWatch" if the device on which is mapped it's a RMT_DEV.
But I don't succeed on a RMT_FRAME, with un "Unsupported Type error" in console.
Can I, for example, compute the time beetween button click and a publication on a socket?

In attached, I show this situation.
Thank you.

Regards,
Michele Citro
Re: How calculate time scan softPLC [message #1738827 is a reply to message #1738824] Mon, 25 July 2016 09:33 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

RMT_FRAME devices utilize the FBRT provided by Holobloc Inc [1]. FBRT is implemented in Java. So in order to have also an E_StopWatch you need to implement it using the FBDK tool and adjust the generated Java code.

Alois


[1] www.holobloc.com
Re: How calculate time scan softPLC [message #1738850 is a reply to message #1738827] Mon, 25 July 2016 12:52 Go to previous message
Michele Citro is currently offline Michele CitroFriend
Messages: 29
Registered: June 2016
Junior Member
Hi,

I understand.
I thinked that using an EMB_RES, I could solve the problem.

Hance, I will use the FBDK tool.
Thank you.

Best regards,
Michele Citro


Previous Topic:Error in the use of SubApplication
Next Topic:New distribuited Application Problem
Goto Forum:
  


Current Time: Tue Apr 23 17:33:45 GMT 2024

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

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

Back to the top